B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
Utils::NullableValue< T > Class Template Reference

Represents entity with three states - undefined, empty and assigned. More...

#include <B2BITS_NullableValue.h>

Public Types

typedef NullableValue< value_type_Myt
 Self type. More...
 
typedef T value_type
 Type of the stored value. More...
 

Public Member Functions

bool equals (const _Myt &rv) const
 Compares two objects. More...
 
value_typeget ()
 Returns stored value If value is undefined or empty, std::exception is raised. More...
 
const value_typeget () const
 Returns stored value If value is undefined or empty, std::exception is raised. More...
 
bool hasValue () const
 Returns true if value assigned and is not empty. More...
 
bool isDefined () const
 Returns true if value assigned. More...
 
bool isEmpty () const
 Returns true if value assigned with empty value. More...
 
 NullableValue (value_type value)
 Conversion constructor. More...
 
 NullableValue (const Emptily< value_type > &value)
 Conversion constructor. More...
 
 NullableValue (EmptyValue)
 Conversion constructor. More...
 
 NullableValue (UndefinedValue)
 Conversion constructor. More...
 
template<typename Other >
 NullableValue (const Other &value)
 Generic conversion constructor. More...
 
template<typename Other >
 NullableValue (const Emptily< Other > &value)
 Generic copy constructor. More...
 
template<typename Other >
 NullableValue (const NullableValue< Other > &value)
 Generic copy constructor. More...
 
 NullableValue ()
 Default constructor. More...
 
bool operator!= (const _Myt &rv) const
 Compare operator. More...
 
value_typeoperator* ()
 Returns stored value If value is undefined or empty, std::exception is raised. More...
 
const value_typeoperator* () const
 Returns stored value If value is undefined or empty, std::exception is raised. More...
 
value_typeoperator-> ()
 Selector operator. More...
 
const value_typeoperator-> () const
 Selector operator. More...
 
_Mytoperator= (const value_type &value)
 Assign operator. More...
 
_Mytoperator= (const _Myt &value)
 Assign operator. More...
 
_Mytoperator= (const Emptily< value_type > &value)
 Assign operator. More...
 
template<typename Other >
_Mytoperator= (const Other &value)
 Assign operator. More...
 
_Mytoperator= (UndefinedValue)
 Assign operator. More...
 
_Mytoperator= (EmptyValue)
 Assign operator. More...
 
template<typename Other >
_Mytoperator= (const Emptily< Other > &value)
 Assign operator. More...
 
template<typename Other >
_Mytoperator= (const NullableValue< Other > &value)
 Assign operator. More...
 
bool operator== (const _Myt &rv) const
 Compare operator. More...
 
void reset ()
 Resets object to undefined state. More...
 
ValueState state () const
 Returns state of the object. More...
 

Detailed Description

template<typename T>
class Utils::NullableValue< T >

Represents entity with three states - undefined, empty and assigned.

Member Typedef Documentation

template<typename T>
typedef NullableValue<value_type> Utils::NullableValue< T >::_Myt

Self type.

template<typename T>
typedef T Utils::NullableValue< T >::value_type

Type of the stored value.

Constructor & Destructor Documentation

template<typename T>
Utils::NullableValue< T >::NullableValue ( value_type  value)
inline

Conversion constructor.

template<typename T>
Utils::NullableValue< T >::NullableValue ( const Emptily< value_type > &  value)
inline

Conversion constructor.

template<typename T>
Utils::NullableValue< T >::NullableValue ( EmptyValue  )
inline

Conversion constructor.

template<typename T>
Utils::NullableValue< T >::NullableValue ( UndefinedValue  )
inline

Conversion constructor.

template<typename T>
template<typename Other >
Utils::NullableValue< T >::NullableValue ( const Other &  value)
inline

Generic conversion constructor.

template<typename T>
template<typename Other >
Utils::NullableValue< T >::NullableValue ( const Emptily< Other > &  value)
inline

Generic copy constructor.

template<typename T>
template<typename Other >
Utils::NullableValue< T >::NullableValue ( const NullableValue< Other > &  value)
inline

Generic copy constructor.

template<typename T>
Utils::NullableValue< T >::NullableValue ( )
inline

Default constructor.

Member Function Documentation

template<typename T>
bool Utils::NullableValue< T >::equals ( const _Myt rv) const
inline
template<typename T>
value_type* Utils::NullableValue< T >::get ( )
inline

Returns stored value If value is undefined or empty, std::exception is raised.

References Utils::vsAssigned.

template<typename T>
const value_type* Utils::NullableValue< T >::get ( ) const
inline

Returns stored value If value is undefined or empty, std::exception is raised.

References Utils::vsAssigned.

template<typename T>
bool Utils::NullableValue< T >::hasValue ( ) const
inline

Returns true if value assigned and is not empty.

References Utils::vsAssigned.

template<typename T>
bool Utils::NullableValue< T >::isDefined ( ) const
inline

Returns true if value assigned.

References Utils::vsUndefined.

Referenced by Utils::Emptily< System::u64 >::Emptily().

template<typename T>
bool Utils::NullableValue< T >::isEmpty ( ) const
inline

Returns true if value assigned with empty value.

References Utils::vsEmpty.

template<typename T>
bool Utils::NullableValue< T >::operator!= ( const _Myt rv) const
inline

Compare operator.

References Utils::NullableValue< T >::equals().

template<typename T>
value_type& Utils::NullableValue< T >::operator* ( )
inline

Returns stored value If value is undefined or empty, std::exception is raised.

template<typename T>
const value_type& Utils::NullableValue< T >::operator* ( ) const
inline

Returns stored value If value is undefined or empty, std::exception is raised.

template<typename T>
value_type* Utils::NullableValue< T >::operator-> ( )
inline

Selector operator.

template<typename T>
const value_type* Utils::NullableValue< T >::operator-> ( ) const
inline

Selector operator.

template<typename T>
_Myt& Utils::NullableValue< T >::operator= ( const value_type value)
inline

Assign operator.

template<typename T>
_Myt& Utils::NullableValue< T >::operator= ( const _Myt value)
inline

Assign operator.

template<typename T>
_Myt& Utils::NullableValue< T >::operator= ( const Emptily< value_type > &  value)
inline

Assign operator.

template<typename T>
template<typename Other >
_Myt& Utils::NullableValue< T >::operator= ( const Other &  value)
inline

Assign operator.

template<typename T>
_Myt& Utils::NullableValue< T >::operator= ( UndefinedValue  )
inline

Assign operator.

References Utils::vsUndefined.

template<typename T>
_Myt& Utils::NullableValue< T >::operator= ( EmptyValue  )
inline

Assign operator.

References Utils::vsEmpty.

template<typename T>
template<typename Other >
_Myt& Utils::NullableValue< T >::operator= ( const Emptily< Other > &  value)
inline

Assign operator.

template<typename T>
template<typename Other >
_Myt& Utils::NullableValue< T >::operator= ( const NullableValue< Other > &  value)
inline

Assign operator.

template<typename T>
bool Utils::NullableValue< T >::operator== ( const _Myt rv) const
inline

Compare operator.

References Utils::NullableValue< T >::equals().

template<typename T>
void Utils::NullableValue< T >::reset ( )
inline

Resets object to undefined state.

References Utils::vsUndefined.

template<typename T>
ValueState Utils::NullableValue< T >::state ( ) const
inline

Returns state of the object.