B2BITS FIX Antenna C++  2.27.1
Public Types | Public Member Functions | List of all members
Utils::Emptily< T > Class Template Reference

Represents entity with two states - initialized and not initialized. More...

#include <B2BITS_NullableValue.h>

Public Types

typedef Emptily< value_type_Myt
 Self type. More...
 
typedef T value_type
 Type of the store value. More...
 

Public Member Functions

 Emptily (const value_type &value)
 Conversion constructor. More...
 
 Emptily (Utils::EmptyValue)
 Conversion constructor Allow user to use "empty" identifier instead of Emptily. More...
 
 Emptily (const value_type &value, bool aIsEmpty)
 Initializes object with value and flag. More...
 
 Emptily ()
 Default constructor. More...
 
template<typename Other >
 Emptily (const Emptily< Other > &other)
 Generic copy constructor. More...
 
template<typename Other >
 Emptily (const Other &other)
 Generic conversion constructor. More...
 
 Emptily (const Utils::NullableValue< T > &value)
 Explicit conversion constructor from NullableValue User cannot pass NullableValue with undefined state. More...
 
bool equals (const _Myt &rv) const
 Compares two Emptilies. More...
 
T * get ()
 Returns pointer to strored value If value was not assigned, std::exception will be raised. More...
 
const T * get () const
 Returns pointer to strored value If value was not assigned, std::exception will be raised. More...
 
bool hasValue () const
 Returns true if value WAS assigned. More...
 
void init ()
 Initializes object with default value. More...
 
bool isEmpty () const
 Returns true if value was NOT assigned. More...
 
bool operator!= (const _Myt &rv) const
 Compare operator Compares two emptilies. More...
 
T & operator* ()
 Returns strored value If value was not assigned, std::exception will be raised. More...
 
const T & operator* () const
 Returns strored value If value was not assigned, std::exception will be raised. More...
 
T * operator-> ()
 Selector. More...
 
const T * operator-> () const
 Const selector. More...
 
_Mytoperator= (const _Myt &value)
 Assign operator. More...
 
_Mytoperator= (const value_type &value)
 Assign operator. More...
 
_Mytoperator= (const Utils::NullableValue< T > &value)
 Assign operator. More...
 
template<typename Other >
_Mytoperator= (const Other &value)
 Generic assign operator. More...
 
_Mytoperator= (Utils::EmptyValue)
 Assign operator for "empty" identifier. More...
 
template<typename Other >
_Mytoperator= (const Emptily< Other > &value)
 Generic assign operator for Emptily. More...
 
bool operator== (const _Myt &rv) const
 Compare operator Compares two emptilies. More...
 

Detailed Description

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

Represents entity with two states - initialized and not initialized.

Member Typedef Documentation

◆ _Myt

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

Self type.

◆ value_type

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

Type of the store value.

Constructor & Destructor Documentation

◆ Emptily() [1/7]

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

Conversion constructor.

Converts value_type to self type.

◆ Emptily() [2/7]

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

Conversion constructor Allow user to use "empty" identifier instead of Emptily.

◆ Emptily() [3/7]

template<typename T>
Utils::Emptily< T >::Emptily ( const value_type value,
bool  aIsEmpty 
)
inline

Initializes object with value and flag.

◆ Emptily() [4/7]

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

Default constructor.

◆ Emptily() [5/7]

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

Generic copy constructor.

◆ Emptily() [6/7]

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

Generic conversion constructor.

◆ Emptily() [7/7]

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

Explicit conversion constructor from NullableValue User cannot pass NullableValue with undefined state.

Member Function Documentation

◆ equals()

template<typename T>
bool Utils::Emptily< T >::equals ( const _Myt rv) const
inline

◆ get() [1/2]

template<typename T>
T* Utils::Emptily< T >::get ( )
inline

Returns pointer to strored value If value was not assigned, std::exception will be raised.

◆ get() [2/2]

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

Returns pointer to strored value If value was not assigned, std::exception will be raised.

◆ hasValue()

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

Returns true if value WAS assigned.

◆ init()

template<typename T>
void Utils::Emptily< T >::init ( )
inline

Initializes object with default value.

◆ isEmpty()

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

Returns true if value was NOT assigned.

◆ operator!=()

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

Compare operator Compares two emptilies.

◆ operator*() [1/2]

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

Returns strored value If value was not assigned, std::exception will be raised.

◆ operator*() [2/2]

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

Returns strored value If value was not assigned, std::exception will be raised.

◆ operator->() [1/2]

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

Selector.

◆ operator->() [2/2]

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

Const selector.

◆ operator=() [1/6]

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

Assign operator.

◆ operator=() [2/6]

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

Assign operator.

◆ operator=() [3/6]

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

Assign operator.

◆ operator=() [4/6]

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

Generic assign operator.

◆ operator=() [5/6]

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

Assign operator for "empty" identifier.

◆ operator=() [6/6]

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

Generic assign operator for Emptily.

◆ operator==()

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

Compare operator Compares two emptilies.