MySQL  8.0.17
Source Code Documentation
Mysql::Nullable< T_value > Class Template Reference

Class for storing value or NULL value. More...

#include <nullable.h>

Public Member Functions

 Nullable ()
 
 Nullable (T_value value)
 
 Nullable (const Nullable< T_value > &other)
 
Nullable< T_value > & operator= (const Nullable< T_value > &other)
 Assigns value from another Nullable<> object. More...
 
bool operator== (const Nullable< T_value > &other) const
 Compares two Nullable<> objects for equality. More...
 
bool operator!= (const Nullable< T_value > &other) const
 Compares two Nullable<> objects for in-equality. More...
 
bool has_value () const
 Returns true if object has not-NULL value assigned. More...
 
const T_value & value () const
 Returns actual value of object. More...
 

Private Attributes

bool m_has_value
 Specifies if this object represents NULL value. More...
 
T_value m_value {}
 Actual value, if m_has_value is true. More...
 

Detailed Description

template<typename T_value>
class Mysql::Nullable< T_value >

Class for storing value or NULL value.

Constructor & Destructor Documentation

◆ Nullable() [1/3]

template<typename T_value>
Mysql::Nullable< T_value >::Nullable ( )
inline

◆ Nullable() [2/3]

template<typename T_value>
Mysql::Nullable< T_value >::Nullable ( T_value  value)
inline

◆ Nullable() [3/3]

template<typename T_value>
Mysql::Nullable< T_value >::Nullable ( const Nullable< T_value > &  other)
inline

Member Function Documentation

◆ has_value()

template<typename T_value>
bool Mysql::Nullable< T_value >::has_value ( ) const
inline

Returns true if object has not-NULL value assigned.

If this is false, one should not try to get value by value().

◆ operator!=()

template<typename T_value>
bool Mysql::Nullable< T_value >::operator!= ( const Nullable< T_value > &  other) const
inline

Compares two Nullable<> objects for in-equality.

◆ operator=()

template<typename T_value>
Nullable<T_value>& Mysql::Nullable< T_value >::operator= ( const Nullable< T_value > &  other)
inline

Assigns value from another Nullable<> object.

◆ operator==()

template<typename T_value>
bool Mysql::Nullable< T_value >::operator== ( const Nullable< T_value > &  other) const
inline

Compares two Nullable<> objects for equality.

◆ value()

template<typename T_value>
const T_value& Mysql::Nullable< T_value >::value ( ) const
inline

Returns actual value of object.

Do not call this method if has_value() returns false.

Member Data Documentation

◆ m_has_value

template<typename T_value>
bool Mysql::Nullable< T_value >::m_has_value
private

Specifies if this object represents NULL value.

If this is false, one should not try to get value by value().

◆ m_value

template<typename T_value>
T_value Mysql::Nullable< T_value >::m_value {}
private

Actual value, if m_has_value is true.

Undefined if m_has_value is false.


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