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

#include <bdlar_simpletyperef.h>

Public Member Functions

template<class t_TYPE >
 SimpleTypeRef (t_TYPE &object, typename bsl::enable_if< IsSimple< t_TYPE >::value >::type *=0)
 
 SimpleTypeRef (void *objectAddress, const SimpleTypeVtable *vtable)
 
template<class t_MANIPULATOR >
int manipulate (t_MANIPULATOR &manipulator) const
 
template<class t_MANIPULATOR , class t_INFO >
int manipulate (t_MANIPULATOR &manipulator, const t_INFO &info) const
 
template<class t_MANIPULATOR >
int manipulateWithCategory (t_MANIPULATOR &manipulator) const
 
void reset () const
 
template<class t_ACCESSOR >
int access (t_ACCESSOR &accessor) const
 
template<class t_ACCESSOR , class t_INFO >
int access (t_ACCESSOR &accessor, const t_INFO &info) const
 
template<class t_ACCESSOR >
int accessWithCategory (t_ACCESSOR &accessor) const
 
const SimpleTypeVtablevtable () const
 
void * objectAddress () const
 
SimpleTypeId typeId () const
 

Constructor & Destructor Documentation

◆ SimpleTypeRef() [1/2]

template<class t_TYPE >
bdlar::SimpleTypeRef::SimpleTypeRef ( t_TYPE &  object,
typename bsl::enable_if< IsSimple< t_TYPE >::value >::type *  = 0 
)
inlineexplicit

Create a SimpleTypeRef object that type erases the supplied "simple" object.

◆ SimpleTypeRef() [2/2]

bdlar::SimpleTypeRef::SimpleTypeRef ( void *  objectAddress,
const SimpleTypeVtable vtable 
)
inline

Create a SimpleTypeRef object.

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

Member Function Documentation

◆ access() [1/2]

template<class t_ACCESSOR >
int bdlar::SimpleTypeRef::access ( t_ACCESSOR &  accessor) const
inline

Invoke the specified accessor on the value held by this object. The supplied accessor must be an object callable with a value of any simple type as if it had the following signature:

int accessor(const VALUE& value);

Return the value from the invocation of accessor.

◆ access() [2/2]

template<class t_ACCESSOR , class t_INFO >
int bdlar::SimpleTypeRef::access ( t_ACCESSOR &  accessor,
const t_INFO &  info 
) const
inline

Invoke the specified accessor on the value held by this object supplying accessor with the specified info object. The supplied accessor must be an object callable with a value of any simple type as if it had the following signature:

int accessor(const VALUE& value, const t_INFO& info);

Return the value from the invocation of accessor.

◆ accessWithCategory()

template<class t_ACCESSOR >
int bdlar::SimpleTypeRef::accessWithCategory ( t_ACCESSOR &  accessor) const
inline

Invoke the specified accessor on the value held by this object supplying accessor with an object of bdlat_TypeCategory::Simple type for any type except bsl::vector<char>. The latter is supplied with an object of bdlat_TypeCategory::Array type. The supplied accessor must be an object callable with a value of any simple type as if it had the following signature:

int accessor(const VALUE& value, bdlat_TypeCategory::Simple);
// and
int accessor(const bsl::vector<char>& value,
Definition bslstl_vector.h:1120
Definition bdlat_typecategory.h:1037
Definition bdlat_typecategory.h:1043

Return the value from the invocation of accessor.

◆ manipulate() [1/2]

template<class t_MANIPULATOR >
int bdlar::SimpleTypeRef::manipulate ( t_MANIPULATOR &  manipulator) const

Invoke the specified manipulator on the value held by this object. The supplied manipulator must be an object callable with a value of any simple type as if it had the following signature:

int manipulator(VALUE *value);

Return the value from the invocation of manipulator.

◆ manipulate() [2/2]

template<class t_MANIPULATOR , class t_INFO >
int bdlar::SimpleTypeRef::manipulate ( t_MANIPULATOR &  manipulator,
const t_INFO &  info 
) const

Invoke the specified manipulator on the value held by this object supplying manipulator with the specified info object. The supplied manipulator must be an object callable with a value of any simple type as if it had the following signature:

int manipulator(VALUE *value, const t_INFO& info);

Return the value from the invocation of manipulator.

◆ manipulateWithCategory()

template<class t_MANIPULATOR >
int bdlar::SimpleTypeRef::manipulateWithCategory ( t_MANIPULATOR &  manipulator) const
inline

Invoke the specified manipulator on the value held by this object supplying manipulator with an object of bdlat_TypeCategory::Simple type for any type except bsl::vector<char>. The latter is supplied with an object of bdlat_TypeCategory::Array type. The supplied manipulator must be an object callable with a value of any simple type as if it had the following signature:

int manipulator(VALUE *value, bdlat_TypeCategory::Simple);
// and

Return the value from the invocation of manipulator.

◆ objectAddress()

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

Return a pointer to the wrapped object.

◆ reset()

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

Reset the referred object to the default value.

◆ typeId()

SimpleTypeId bdlar::SimpleTypeRef::typeId ( ) const
inline

Return the type ID corresponding to the simple type held by this object.

◆ vtable()

const SimpleTypeVtable * bdlar::SimpleTypeRef::vtable ( ) const
inline

Return a pointer to the vtable.


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