BDE 4.14.0 Production release
|
#include <s_baltst_testchoice.h>
Public Types | |
typedef TYPED_SELECTION_0::Selection | Selection0 |
typedef TYPED_SELECTION_0::Type | Selection0Type |
typedef TYPED_SELECTION_1::Selection | Selection1 |
typedef TYPED_SELECTION_1::Type | Selection1Type |
typedef TYPED_SELECTION_2::Selection | Selection2 |
typedef TYPED_SELECTION_2::Type | Selection2Type |
Public Member Functions | |
TestChoice () | |
TestChoice (bslma::Allocator *basicAllocator) | |
template<class VALUE > | |
TestChoice (const VALUE &value, bslma::Allocator *basicAllocator=0) | |
TestChoice (const TestChoice &original, bslma::Allocator *basicAllocator=0) | |
TestChoice & | operator= (const TestChoice &original) |
int | makeSelection (int selectionId) |
int | makeSelection (const char *selectionName, int selectionNameLength) |
template<class MANIPULATOR > | |
int | manipulateSelection (MANIPULATOR &manipulator) |
void | reset () |
template<class ACCESSOR > | |
int | accessSelection (ACCESSOR &accessor) const |
bool | hasSelection (int selectionId) const |
bool | hasSelection (const char *selectionName, int selectionNameLength) const |
const char * | className () const |
int | selectionId () const |
const Selection0Type & | theSelection0 () const |
const Selection1Type & | theSelection1 () const |
const Selection2Type & | theSelection2 () const |
Static Public Member Functions | |
static bool | areEqual (const TestChoice &lhs, const TestChoice &rhs) |
This in-core value-semantic class provides a basic implementation of the concept defined by the Choice
bdlat
type category. The template parameters TYPED_SELECTION_0
, TYPED_SELECTION_1
, and TYPED_SELECTION_2
must all satisfy the following requirements:
Type
, and Selection
.Type
must meet the requirements of an in-core value-semantic type.Type
must meet the requirements of exactly one of the bdlat
value categories.Selection
must be a specialization of the TestSelection
type. Further, each TestSelection
member type definition of a template argument must return values for TestSelection::id()
and TestSelection::name()
that are different from all others within this TestChoice
specialization.Additionally, The Type
of any template argument may be TestNilValue
if all Type
member type definitions of subsequent template arguments are also TestNilValue
.
The Type
and Selection
member type definitions of the template arguments define the type and bdlat_SelectionInfo
of the selections of the bdlat
Choice
implementation provided by this class. A template argument having a TestNilValue
Type
indicates that the corresponding selection does not exist.
typedef TYPED_SELECTION_0::Selection s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection0 |
typedef TYPED_SELECTION_0::Type s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection0Type |
typedef TYPED_SELECTION_1::Selection s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection1 |
typedef TYPED_SELECTION_1::Type s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection1Type |
typedef TYPED_SELECTION_2::Selection s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection2 |
typedef TYPED_SELECTION_2::Type s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection2Type |
s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::TestChoice | ( | ) |
|
explicit |
|
explicit |
s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::TestChoice | ( | const TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 > & | original, |
bslma::Allocator * | basicAllocator = 0 |
||
) |
int s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::accessSelection | ( | ACCESSOR & | accessor | ) | const |
Invoke the specified accessor
on the (non-modifiable) selection of the this object, supplying accessor
with the corresponding selection information structure. Return -1 if the selection is undefined, and the value returned from the invocation of accessor
otherwise.
|
static |
const char * s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::className | ( | ) | const |
Return a null-terminated string containing the exported name for this type.
bool s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::hasSelection | ( | const char * | selectionName, |
int | selectionNameLength | ||
) | const |
bool s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::hasSelection | ( | int | selectionId | ) | const |
int s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::makeSelection | ( | const char * | selectionName, |
int | selectionNameLength | ||
) |
Set the value of this object to the default for the selection indicated by the specified selectionName
of the specified selectionNameLength
. Return 0 on success, and a non-zero value otherwise.
int s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::makeSelection | ( | int | selectionId | ) |
Set the value of this object to the default for the selection indicated by the specified selectionId
. Return 0 on success, and a non-zero value otherwise.
int s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::manipulateSelection | ( | MANIPULATOR & | manipulator | ) |
Invoke the specified manipulator
on the address of the (modifiable) selection of this object, supplying manipulator
with the corresponding selection information structure. Return -1 if the selection is undefined, and the value returned from the invocation of manipulator
otherwise.
TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 > & s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::operator= | ( | const TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 > & | original | ) |
void s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::reset | ( | ) |
int s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::selectionId | ( | ) | const |
const TYPED_SELECTION_0::Type & s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::theSelection0 | ( | ) | const |
const TYPED_SELECTION_1::Type & s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::theSelection1 | ( | ) | const |
const TYPED_SELECTION_2::Type & s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::theSelection2 | ( | ) | const |