#include <bdlar_choiceref.h>
◆ ChoiceRef() [1/2]
template<class t_CHOICE >
| bdlar::ChoiceRef::ChoiceRef |
( |
t_CHOICE & |
choice, |
|
|
typename bsl::enable_if< IsChoice< t_CHOICE >::value >::type * |
= 0 |
|
) |
| |
|
inlineexplicit |
Create ChoiceRef object that type erases the supplied choice object.
◆ ChoiceRef() [2/2]
| bdlar::ChoiceRef::ChoiceRef |
( |
void * |
objectAddress, |
|
|
const ChoiceVtable * |
vtable |
|
) |
| |
|
inline |
Create ChoiceRef object.
- Precondition
- The behaviour is undefined unless
objectAddress and vtable point to the valid objects.
◆ accessSelection()
template<typename t_ACCESSOR >
| int bdlar::ChoiceRef::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::ChoiceRef::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::ChoiceRef::hasSelection |
( |
int |
selectionId | ) |
const |
|
inline |
Return true if the object has a selection with the specified selectionId, and false otherwise.
◆ makeSelection() [1/2]
| int bdlar::ChoiceRef::makeSelection |
( |
const char * |
selectionName, |
|
|
int |
selectionNameLength |
|
) |
| const |
|
inline |
Set the value to be the default for the selection indicated by the specified selectionName of the specified selectionNameLength. Return 0 on success, and non-zero value otherwise (i.e., the selection is not found).
◆ makeSelection() [2/2]
| int bdlar::ChoiceRef::makeSelection |
( |
int |
selectionId | ) |
const |
|
inline |
Set the value to be the default for the selection indicated by the specified selectionId. Return 0 on success, and non-zero value otherwise (i.e., the selection is not found).
◆ manipulateSelection()
template<typename t_MANIPULATOR >
| int bdlar::ChoiceRef::manipulateSelection |
( |
t_MANIPULATOR & |
manipulator | ) |
const |
|
inline |
Invoke the specified manipulator on the address of the (modifiable) selection, supplying manipulator with the corresponding selection information structure. The supplied manipulator must be a callable type that can be called as if it had the following signature:
template <class t_INFO>
int manipulator(SELECTION *refOrValue, const t_INFO& info);
Return the value returned from the invocation of manipulator.
- Precondition
- The behavior is undefined unless
selectionId() != -1.
◆ objectAddress()
| void * bdlar::ChoiceRef::objectAddress |
( |
| ) |
const |
|
inline |
Return a pointer to the wrapped array.
◆ reset()
| void bdlar::ChoiceRef::reset |
( |
| ) |
const |
|
inline |
Reset the referred object to the default value.
◆ selectionId()
| int bdlar::ChoiceRef::selectionId |
( |
| ) |
const |
|
inline |
Return the id of the current selection if the selection is defined, and -1 otherwise.
◆ vtable()
Return a pointer to the vtable.
The documentation for this class was generated from the following file: