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

#include <bdlar_choiceref.h>

Public Member Functions

template<class t_CHOICE >
 ChoiceConstRef (const t_CHOICE &choice, typename bsl::enable_if< IsChoice< t_CHOICE >::value >::type *=0)
 
 ChoiceConstRef (const void *objectAddress, const ChoiceConstVtable *vtable)
 
 ChoiceConstRef (const ChoiceRef &object)
 
template<typename t_ACCESSOR >
int accessSelection (t_ACCESSOR &accessor) const
 
const ChoiceConstVtablevtable () const
 
bool hasSelection (int selectionId) const
 
bool hasSelection (const char *selectionName, int selectionNameLength) const
 
const void * objectAddress () const
 
int selectionId () const
 
const char * xsdName (int format) const
 

Constructor & Destructor Documentation

◆ ChoiceConstRef() [1/3]

template<class t_CHOICE >
bdlar::ChoiceConstRef::ChoiceConstRef ( const t_CHOICE &  choice,
typename bsl::enable_if< IsChoice< t_CHOICE >::value >::type *  = 0 
)
inlineexplicit

Create ChoiceConstRef object that type erases the supplied choice object.

◆ ChoiceConstRef() [2/3]

bdlar::ChoiceConstRef::ChoiceConstRef ( const void *  objectAddress,
const ChoiceConstVtable vtable 
)
inline

Create ChoiceConstRef object.

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

◆ ChoiceConstRef() [3/3]

bdlar::ChoiceConstRef::ChoiceConstRef ( const ChoiceRef object)
inline

Create ChoiceConstRef object that wraps the same object as the specified object.

Member Function Documentation

◆ accessSelection()

template<typename t_ACCESSOR >
int bdlar::ChoiceConstRef::accessSelection ( t_ACCESSOR &  accessor) const
inline

Invoke the specified accessor on the (non-modifiable) selection, supplying accessor with the corresponding selection information structure. The supplied accessor must be a callable type that can be called as if it had the following signature:

template <class t_INFO>
int accessor(const SELECTION& refOrValue, const t_INFO& info);

Return the value returned from the invocation of accessor.

Precondition
The behavior is undefined unless selectionId() != -1.

◆ hasSelection() [1/2]

bool bdlar::ChoiceConstRef::hasSelection ( const char *  selectionName,
int  selectionNameLength 
) const
inline

Return true if the object has a selection with the specified selectionName of the specified selectionNameLength, and false otherwise.

◆ hasSelection() [2/2]

bool bdlar::ChoiceConstRef::hasSelection ( int  selectionId) const
inline

Return true if the object has a selection with the specified selectionId, and false otherwise.

◆ objectAddress()

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

Return a pointer to the wrapped array.

◆ selectionId()

int bdlar::ChoiceConstRef::selectionId ( ) const
inline

Return the id of the current selection if the selection is defined, and -1 otherwise.

◆ vtable()

const ChoiceConstVtable * bdlar::ChoiceConstRef::vtable ( ) const
inline

Return a pointer to the vtable.

◆ xsdName()

const char * bdlar::ChoiceConstRef::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: