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

#include <bdlar_simpletyperef.h>

Public Member Functions

template<class t_TYPE >
 SimpleTypeConstRef (const t_TYPE &object, typename bsl::enable_if< IsSimple< t_TYPE >::value >::type *=0)
 
 SimpleTypeConstRef (const void *objectAddress, const SimpleTypeConstVtable *vtable)
 
 SimpleTypeConstRef (const SimpleTypeRef &object)
 
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 SimpleTypeConstVtablevtable () const
 
const void * objectAddress () const
 
SimpleTypeId typeId () const
 
const char * xsdName (int format) const
 

Constructor & Destructor Documentation

◆ SimpleTypeConstRef() [1/3]

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

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

◆ SimpleTypeConstRef() [2/3]

bdlar::SimpleTypeConstRef::SimpleTypeConstRef ( const void *  objectAddress,
const SimpleTypeConstVtable vtable 
)
inline

Create a SimpleTypeConstRef object.

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

◆ SimpleTypeConstRef() [3/3]

bdlar::SimpleTypeConstRef::SimpleTypeConstRef ( const SimpleTypeRef object)
inline

Create a 'SimpleTypeConstRef' object that wraps the same object as the specified 'object'.

Member Function Documentation

◆ access() [1/2]

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

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::SimpleTypeConstRef::access ( t_ACCESSOR &  accessor,
const t_INFO &  info 
) const

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::SimpleTypeConstRef::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.

◆ objectAddress()

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

Return a pointer to the wrapped object.

◆ typeId()

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

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

◆ vtable()

const SimpleTypeConstVtable * bdlar::SimpleTypeConstRef::vtable ( ) const
inline

Return a pointer to the vtable.

◆ xsdName()

const char * bdlar::SimpleTypeConstRef::xsdName ( int  format) const
inline

Return the bdlat_TypeName::xsdName value for the underlying object.


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