BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 > Class Template Reference

#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)
 
TestChoiceoperator= (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 Selection0TypetheSelection0 () const
 
const Selection1TypetheSelection1 () const
 
const Selection2TypetheSelection2 () const
 

Static Public Member Functions

static bool areEqual (const TestChoice &lhs, const TestChoice &rhs)
 

Detailed Description

template<class TYPED_SELECTION_0 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_1 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_2 = TypedTestSelection<TestNilValue, TestSelection<0> >>
class s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >

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:

  • The type must have two member type definitions, 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.

See s_baltst_testchoice

Member Typedef Documentation

◆ Selection0

template<class TYPED_SELECTION_0 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_1 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_2 = TypedTestSelection<TestNilValue, TestSelection<0> >>
typedef TYPED_SELECTION_0::Selection s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection0

◆ Selection0Type

template<class TYPED_SELECTION_0 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_1 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_2 = TypedTestSelection<TestNilValue, TestSelection<0> >>
typedef TYPED_SELECTION_0::Type s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection0Type

◆ Selection1

template<class TYPED_SELECTION_0 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_1 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_2 = TypedTestSelection<TestNilValue, TestSelection<0> >>
typedef TYPED_SELECTION_1::Selection s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection1

◆ Selection1Type

template<class TYPED_SELECTION_0 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_1 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_2 = TypedTestSelection<TestNilValue, TestSelection<0> >>
typedef TYPED_SELECTION_1::Type s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection1Type

◆ Selection2

template<class TYPED_SELECTION_0 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_1 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_2 = TypedTestSelection<TestNilValue, TestSelection<0> >>
typedef TYPED_SELECTION_2::Selection s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection2

◆ Selection2Type

template<class TYPED_SELECTION_0 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_1 = TypedTestSelection<TestNilValue, TestSelection<0> >, class TYPED_SELECTION_2 = TypedTestSelection<TestNilValue, TestSelection<0> >>
typedef TYPED_SELECTION_2::Type s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::Selection2Type

Constructor & Destructor Documentation

◆ TestChoice() [1/4]

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::TestChoice ( )

◆ TestChoice() [2/4]

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::TestChoice ( bslma::Allocator basicAllocator)
explicit

◆ TestChoice() [3/4]

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
template<class VALUE >
s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::TestChoice ( const VALUE &  value,
bslma::Allocator basicAllocator = 0 
)
explicit

◆ TestChoice() [4/4]

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
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 
)

Member Function Documentation

◆ accessSelection()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
template<class ACCESSOR >
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.

◆ areEqual()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
bool s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::areEqual ( const TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 > &  lhs,
const TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 > &  rhs 
)
static

◆ className()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
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.

◆ hasSelection() [1/2]

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
bool s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::hasSelection ( const char *  selectionName,
int  selectionNameLength 
) const

◆ hasSelection() [2/2]

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
bool s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::hasSelection ( int  selectionId) const

◆ makeSelection() [1/2]

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
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.

◆ makeSelection() [2/2]

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
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.

◆ manipulateSelection()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
template<class MANIPULATOR >
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.

◆ operator=()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
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)

◆ reset()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
void s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::reset ( )

◆ selectionId()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
int s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::selectionId ( ) const

◆ theSelection0()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
const TYPED_SELECTION_0::Type & s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::theSelection0 ( ) const

◆ theSelection1()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
const TYPED_SELECTION_1::Type & s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::theSelection1 ( ) const

◆ theSelection2()

template<class TYPED_SELECTION_0 , class TYPED_SELECTION_1 , class TYPED_SELECTION_2 >
const TYPED_SELECTION_2::Type & s_baltst::TestChoice< TYPED_SELECTION_0, TYPED_SELECTION_1, TYPED_SELECTION_2 >::theSelection2 ( ) const

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