OnixS BME SENAF Handler C++ library  2.2.0
API documentation
Optional< T > Class Template Reference

#include <OnixS/Senaf/MarketData/Optional.h>

Public Member Functions

 Optional ()
 
 Optional (const T &val)
 
 Optional (const Optional< T > &opt)
 
Optionaloperator= (const Optional< T > &opt)
 
Optionaloperator= (const T &val)
 
 ~Optional ()
 
 operator bool () const
 
T & operator* ()
 
const T & operator* () const
 
T & value ()
 
const T & value () const
 
void reset ()
 

Protected Member Functions

void * storage ()
 
const void * storage () const
 
T & get ()
 
const T & get () const
 
void destruct ()
 
void construct (const T &data)
 

Protected Attributes

char data_ [sizeof(T)]
 
bool init_
 

Detailed Description

template<typename T>
class OnixS::Senaf::MarketData::Optional< T >

Definition at line 29 of file Optional.h.

Constructor & Destructor Documentation

Optional ( )
inline

Uninitialized instance.

Definition at line 33 of file Optional.h.

Optional ( const T &  val)
inline

Constructs the optional object.

Definition at line 36 of file Optional.h.

Optional ( const Optional< T > &  opt)
inline

Initializes the contained value by copying the contained value of other, but only if other is engaged. other is still in engaged state if it was in engaged state before the call.

Definition at line 46 of file Optional.h.

~Optional ( )
inline

If engaged, destroys the contained value.

Definition at line 77 of file Optional.h.

Member Function Documentation

void construct ( const T &  data)
inlineprotected

Definition at line 147 of file Optional.h.

void destruct ( )
inlineprotected

Definition at line 141 of file Optional.h.

T& get ( )
inlineprotected

Definition at line 131 of file Optional.h.

const T& get ( ) const
inlineprotected

Definition at line 136 of file Optional.h.

operator bool ( ) const
inline

Checks whether the object is in engaged state.

Definition at line 83 of file Optional.h.

T& operator* ( )
inline

Returns a reference to the contained value.

Definition at line 89 of file Optional.h.

const T& operator* ( ) const
inline

Returns a const reference to the contained value.

Definition at line 95 of file Optional.h.

Optional& operator= ( const Optional< T > &  opt)
inline

Assigns contents.

Definition at line 54 of file Optional.h.

Optional& operator= ( const T &  val)
inline

Assigns contents.

Definition at line 65 of file Optional.h.

void reset ( )
inline

Reset stored value and set state to Uninitialized.

Definition at line 113 of file Optional.h.

void* storage ( )
inlineprotected

Definition at line 121 of file Optional.h.

const void* storage ( ) const
inlineprotected

Definition at line 126 of file Optional.h.

T& value ( )
inline

A reference to the contained value.

Definition at line 101 of file Optional.h.

const T& value ( ) const
inline

A const reference to the contained value.

Definition at line 107 of file Optional.h.

Member Data Documentation

char data_[sizeof(T)]
protected

Definition at line 152 of file Optional.h.

bool init_
protected

Definition at line 153 of file Optional.h.


The documentation for this class was generated from the following file: