#include <nullable.h>
Public Member Functions | |
Nullable () | |
Nullable (const NullValue &) | |
Nullable (const T &t) | |
Nullable (const Nullable< T > &t) | |
Nullable< T > & | operator= (const T &t) |
Nullable< T > & | operator= (const Nullable< T > &t) |
bool | isNull () const |
operator T () const | |
T & | value () |
T | value (const T &defaultval=T()) const |
bool | operator== (const T &t) const |
bool | operator!= (const T &t) const |
bool | operator== (const Nullable< T > &t) const |
bool | operator!= (const Nullable< T > &t) const |
bool | operator== (const NullValue &) const |
compares the Nullable with the special null value | |
bool | operator!= (const NullValue &) const |
compares the Nullable with the special null value |
wrapper around scalar values that makes them NULL-able, i.e. the virtual value NULL is added to the range of the wrapped value; wrapped classes must have a default constructor and =, == and != operators
creates a wrapped non-NULL value that is equivalent to the original
copies a nullable value
bool Nullable< T >::isNull | ( | ) | const [inline] |
returns whether this instance is NULL
Nullable< T >::operator T | ( | ) | const [inline] |
converts this nullable to the original wrapped class - uses the default constructor if it is NULL
bool Nullable< T >::operator!= | ( | const T & | t | ) | const [inline] |
compares this instance with a value of the original class, NULL is different from ANY instance of the original class
compares two nullable instances, if both are NULL it returns false
compares the Nullable with the special null value
copies the given nullable value
makes this instance non-NULL and equivalent to the given value
compares two nullable instances, if both are NULL it returns true
compares the Nullable with the special null value
bool Nullable< T >::operator== | ( | const T & | t | ) | const [inline] |
compares this instance with a value of the original class, NULL is different from ANY instance of the original class
T Nullable< T >::value | ( | const T & | defaultval = T() |
) | const [inline] |
returns the original value, if it is currently NULL it returns the given default value, if no default is given an instance created with the default constructor is returned
T& Nullable< T >::value | ( | ) | [inline] |
returns a reference to the wrapped value - the result is undefined if it us currently NULL