BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlar::NullableValueRef Class Reference

#include <bdlar_nullablevalueref.h>

Public Types

typedef bdlat_TypeCategory::NullableValue CategoryTag
 

Public Member Functions

template<class t_NULLABLE >
 NullableValueRef (t_NULLABLE &nullable, typename bsl::enable_if< IsNullable< t_NULLABLE >::value >::type *=0)
 
 NullableValueRef (void *objectAddress, const NullableValueVtable *vtable)
 
void makeValue () const
 
template<class t_MANIPULATOR >
int manipulateValue (t_MANIPULATOR &manipulator) const
 
void reset () const
 
template<class t_ACCESSOR >
int accessValue (t_ACCESSOR &accessor) const
 
const NullableValueVtablevtable () const
 
bool isNull () const
 
void * objectAddress () const
 
bdlat_TypeCategory::Value valueCategory () const
 

Member Typedef Documentation

◆ CategoryTag

Constructor & Destructor Documentation

◆ NullableValueRef() [1/2]

template<class t_NULLABLE >
bdlar::NullableValueRef::NullableValueRef ( t_NULLABLE &  nullable,
typename bsl::enable_if< IsNullable< t_NULLABLE >::value >::type *  = 0 
)
inlineexplicit

Create NullableValueRef object that type erases the supplied nullable object.

◆ NullableValueRef() [2/2]

bdlar::NullableValueRef::NullableValueRef ( void *  objectAddress,
const NullableValueVtable vtable 
)
inline

Create NullableValueRef object.

Precondition
The behaviour is undefined unless objectAddress and vtable point to the valid objects.

Member Function Documentation

◆ accessValue()

template<class t_ACCESSOR >
int bdlar::NullableValueRef::accessValue ( t_ACCESSOR &  accessor) const
inline

Invoke the specified accessor on the referred non-null value. The supplied accessor must be a callable type that can be called as if it had the following signature:

int accessor(const VALUE& refOrValue);

Return the value from the invocation of accessor.

Precondition
The behavior is undefined if the referred object is null.

◆ isNull()

bool bdlar::NullableValueRef::isNull ( ) const
inline

Return true if the referred object contains a null value, and false otherwise.

◆ makeValue()

void bdlar::NullableValueRef::makeValue ( ) const
inline

Assign to the referred object the default value for the contained type.

◆ manipulateValue()

template<class t_MANIPULATOR >
int bdlar::NullableValueRef::manipulateValue ( t_MANIPULATOR &  manipulator) const
inline

Invoke the specified manipulator on the referred non-null value. The supplied manipulator must be a callable type that can be called as if it had the following signature:

int manipulator(VALUE *refOrValue);

Return the value from the invocation of manipulator.

Precondition
The behavior is undefined if the referred object is null.

◆ objectAddress()

void * bdlar::NullableValueRef::objectAddress ( ) const
inline

Return a pointer to the wrapped object.

◆ reset()

void bdlar::NullableValueRef::reset ( ) const
inline

Reset the referred object to the default value.

◆ valueCategory()

bdlat_TypeCategory::Value bdlar::NullableValueRef::valueCategory ( ) const
inline

Return the value type category.

◆ vtable()

const NullableValueVtable * bdlar::NullableValueRef::vtable ( ) const
inline

Return a pointer to the vtable.


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