API Guides > ConceptRT 3.x
Nullable< valueType > Class Template Reference

Generic class to add Nullable on Simple type More...

Detailed Description

template<class valueType>
class ConceptRT::Nullable< valueType >

Generic class to add Nullable on Simple type

Template Parameters
valueTypeType of the nullable value.
+ Inheritance diagram for Nullable< valueType >:

Public Member Methods

 Nullable ()
 Default constructor. More...
 
 Nullable (valueType value)
 Default constructor. More...
 
 Nullable (const NullableNullClass &value)
 Default constructor. More...
 
Nullable< valueType > & operator= (valueType right)
 Assignment operator. More...
 
Nullable< valueType > & operator= (const NullableNullClass &right)
 Assignment operator. More...
 
 operator const valueType & () const
 valueType& casting operator. More...
 
 operator valueType & ()
 valueType& casting operator. More...
 
bool HasValue () const
 Query if the nullable has a value (!= NULL) More...
 
const valueType & GetValue () const
 Get the value More...
 
valueType & GetValue ()
 Get the value More...
 
void SetNull ()
 Set the nullable to null. More...
 
void ConvertFrom (PCChar8 text)
 Convert from. More...
 
void ConvertTo (BaseStaticString &text) const
 Convert to. More...
 

Constructor & Destructor Documentation

Nullable ( )
inline

Default constructor.

Nullable ( valueType  value)
inline

Default constructor.

Parameters
valueThe value.
Nullable ( const NullableNullClass value)
inline

Default constructor.

Parameters
valueThe value.

Methods Documentation

void ConvertFrom ( PCChar8  text)
virtual

Convert from.

Parameters
textThe text. Use CONCEPTRT_NULL_STRING to specify null.

Implements IStringConvertible.

void ConvertTo ( BaseStaticString text) const
virtual

Convert to.

Parameters
text[in,out] The text.

Implements IStringConvertible.

const valueType& GetValue ( ) const
inline

Get the value

Exceptions
RTExceptionCannot access not defined nullable
Returns
the nullable value.
RT Exceptions:
RT_ERROR_NULLABLE_ACCES_ON_NULL
valueType& GetValue ( )
inline

Get the value

Exceptions
RTExceptionCannot access not defined nullable
Returns
the nullable value.
RT Exceptions:
RT_ERROR_NULLABLE_ACCES_ON_NULL
bool HasValue ( ) const
inline

Query if the nullable has a value (!= NULL)

Returns
True if the nullable has a value.
operator const valueType & ( ) const
inline

valueType& casting operator.

Returns
The result of the operation.
operator valueType & ( )
inline

valueType& casting operator.

Nullable<valueType>& operator= ( valueType  right)
inline

Assignment operator.

Parameters
rightThe right.
Returns
A shallow copy of this object.
Nullable<valueType>& operator= ( const NullableNullClass right)
inline

Assignment operator.

Parameters
rightThe right.
Returns
A shallow copy of this object.
void SetNull ( )
inline

Set the nullable to null.