BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > Class Template Reference

#include <bdlb_variant.h>

Inheritance diagram for bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >:
bdlb::VariantImp< bslmf::TypeList13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::ListType >

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION_IF (Variant13, bslma::UsesBslmaAllocator, Traits::k_VARIANT_USES_BSLMA_ALLOCATOR)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (Variant13, bslmf::IsBitwiseCopyable, Traits::k_VARIANT_IS_BITWISE_COPYABLE)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (Variant13, bslmf::IsBitwiseMoveable, Traits::k_VARIANT_IS_BITWISE_MOVEABLE)
 
 BSLMF_NESTED_TRAIT_DECLARATION (Variant13, HasPrintMethod)
 
 Variant13 ()
 
template<class TYPE_OR_ALLOCATOR >
 Variant13 (const TYPE_OR_ALLOCATOR &valueOrAllocator)
 
template<class TYPE >
 Variant13 (const TYPE &value, bslma::Allocator *basicAllocator)
 
template<class TYPE >
 Variant13 (bslmf::MovableRef< TYPE > value)
 
template<class TYPE >
 Variant13 (bslmf::MovableRef< TYPE > value, bslma::Allocator *basicAllocator)
 
 Variant13 (const Variant13 &original, bslma::Allocator *basicAllocator=0)
 
 Variant13 (bslmf::MovableRef< Variant13 > original)
 
 Variant13 (bslmf::MovableRef< Variant13 > original, bslma::Allocator *basicAllocator)
 
template<class TYPE >
Variant13operator= (const TYPE &value)
 
template<class TYPE >
Variant13operator= (bslmf::MovableRef< TYPE > value)
 
Variant13operator= (const Variant13 &rhs)
 
Variant13operator= (bslmf::MovableRef< Variant13 > rhs)
 
template<class TYPE >
Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > & operator= (const TYPE &value)
 
template<class TYPE >
Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > & operator= (bslmf::MovableRef< TYPE > value)
 
- Public Member Functions inherited from bdlb::VariantImp< bslmf::TypeList13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::ListType >
 BSLMF_NESTED_TRAIT_DECLARATION_IF (VariantImp, bslma::UsesBslmaAllocator, Traits::k_VARIANT_USES_BSLMA_ALLOCATOR)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (VariantImp, bslmf::IsBitwiseCopyable, Traits::k_VARIANT_IS_BITWISE_COPYABLE)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (VariantImp, bslmf::IsBitwiseMoveable, Traits::k_VARIANT_IS_BITWISE_MOVEABLE)
 
 BSLMF_NESTED_TRAIT_DECLARATION (VariantImp, HasPrintMethod)
 
 VariantImp ()
 
 VariantImp (const TYPE_OR_ALLOCATOR &valueOrAllocator)
 
 VariantImp (const TYPE &value, bslma::Allocator *basicAllocator)
 
 VariantImp (bslmf::MovableRef< TYPE > value)
 
 VariantImp (bslmf::MovableRef< TYPE > value, bslma::Allocator *basicAllocator)
 
 VariantImp (const VariantImp &original, bslma::Allocator *basicAllocator=0)
 
 VariantImp (bslmf::MovableRef< VariantImp > original)
 
 VariantImp (bslmf::MovableRef< VariantImp > original, bslma::Allocator *basicAllocator)
 
 ~VariantImp ()
 
VariantImpoperator= (const TYPE &value)
 
VariantImpoperator= (bslmf::MovableRef< TYPE > value)
 
VariantImpoperator= (const VariantImp &rhs)
 
VariantImpoperator= (bslmf::MovableRef< VariantImp > rhs)
 
VariantImp< bslmf::TypeList13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::ListType > & operator= (const TYPE &value)
 
VariantImp< bslmf::TypeList13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::ListType > & operator= (bslmf::MovableRef< TYPE > value)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type apply (VISITOR &visitor)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type apply (const VISITOR &visitor)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type apply (VISITOR &visitor, const TYPE &defaultValue)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type apply (const VISITOR &visitor, const TYPE &defaultValue)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type apply (VISITOR &visitor)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type apply (const VISITOR &visitor)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type apply (VISITOR &visitor, const TYPE &defaultValue)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type apply (const VISITOR &visitor, const TYPE &defaultValue)
 
RET_TYPE apply (VISITOR &visitor)
 
RET_TYPE apply (const VISITOR &visitor)
 
RET_TYPE apply (VISITOR &visitor, const TYPE &defaultValue)
 
RET_TYPE apply (const VISITOR &visitor, const TYPE &defaultValue)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type apply (VISITOR &visitor) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type apply (const VISITOR &visitor) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type apply (VISITOR &visitor, const TYPE &defaultValue) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type apply (const VISITOR &visitor, const TYPE &defaultValue) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type apply (VISITOR &visitor) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type apply (const VISITOR &visitor) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type apply (VISITOR &visitor, const TYPE &defaultValue) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type apply (const VISITOR &visitor, const TYPE &defaultValue) const
 
RET_TYPE apply (VISITOR &visitor) const
 
RET_TYPE apply (const VISITOR &visitor) const
 
RET_TYPE apply (VISITOR &visitor, const TYPE &defaultValue) const
 
RET_TYPE apply (const VISITOR &visitor, const TYPE &defaultValue) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type applyRaw (VISITOR &visitor)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type applyRaw (const VISITOR &visitor)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type applyRaw (VISITOR &visitor)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type applyRaw (const VISITOR &visitor)
 
RET_TYPE applyRaw (VISITOR &visitor)
 
RET_TYPE applyRaw (const VISITOR &visitor)
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type applyRaw (VISITOR &visitor) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==1, typenameVISITOR::ResultType >::type applyRaw (const VISITOR &visitor) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type applyRaw (VISITOR &visitor) const
 
bsl::enable_if< Variant_ReturnValueHelper< VISITOR >::value==0, void >::type applyRaw (const VISITOR &visitor) const
 
RET_TYPE applyRaw (VISITOR &visitor) const
 
RET_TYPE applyRaw (const VISITOR &visitor) const
 
VariantImpassign (const TYPE &value)
 
VariantImpassign (bslmf::MovableRef< TYPE > value)
 
VariantImp< bslmf::TypeList13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::ListType > & assign (const TYPE &value)
 
VariantImp< bslmf::TypeList13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::ListType > & assign (bslmf::MovableRef< TYPE > value)
 
VariantImpassignTo (const SOURCE_TYPE &value)
 
VariantImp< bslmf::TypeList13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::ListType > & assignTo (const SOURCE_TYPE &value)
 
TYPE & createInPlace (ARGS &&... arguments)
 
void reset ()
 
void swap (VariantImp &other)
 
TYPE & the ()
 
const TYPE & the () const
 
bool is () const
 
bool isUnset () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 
int typeIndex () const
 
const bsl::type_info & typeInfo () const
 
STREAM & bdexStreamIn (STREAM &stream, int version)
 DEPRECATED: Do not use.
 
int maxSupportedBdexVersion () const
 DEPRECATED: Do not use.
 
STREAM & bdexStreamOut (STREAM &stream, int version) const
 DEPRECATED: Do not use.
 

Detailed Description

template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
class bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >

This class is a "specialization" of Variant for a fixed number (13) of types. Its 13 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A13>.

Constructor & Destructor Documentation

◆ Variant13() [1/8]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::Variant13 ( )
inline

Create a variant object in the unset state that uses the currently installed default allocator to supply memory.

◆ Variant13() [2/8]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
template<class TYPE_OR_ALLOCATOR >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::Variant13 ( const TYPE_OR_ALLOCATOR &  valueOrAllocator)
inlineexplicit

Create a variant object with the specified valueOrAllocator that can be either a value of a type that the variant can hold or an allocator to supply memory. If valueOrAllocator is not a bslma::Allocator *, then the variant will hold the value and type of valueOrAllocator, and use the currently installed default allocator to supply memory. Otherwise, the variant will be unset and use valueOrAllocator to supply memory. TYPE_OR_ALLOCATOR must be the same as one of the types that this variant can hold or be convertible to bslma::Allocator *. Note that this parameterized constructor is defined instead of two constructors (one taking a bslma::Allocator * and the other not) because template parameter arguments are always a better match than derived-to-base conversion (a concrete allocator pointer converted to bslma::Allocator *).

◆ Variant13() [3/8]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
template<class TYPE >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::Variant13 ( const TYPE &  value,
bslma::Allocator basicAllocator 
)
inline

Create a variant object having the specified value of template parameter TYPE and that uses the specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used. TYPE must be the same as one of the types that this variant can hold.

◆ Variant13() [4/8]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
template<class TYPE >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::Variant13 ( bslmf::MovableRef< TYPE >  value)
inlineexplicit

◆ Variant13() [5/8]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
template<class TYPE >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::Variant13 ( bslmf::MovableRef< TYPE >  value,
bslma::Allocator basicAllocator 
)
inline

◆ Variant13() [6/8]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::Variant13 ( const Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > &  original,
bslma::Allocator basicAllocator = 0 
)
inline

Create a variant object having the type and value of the specified original variant. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ Variant13() [7/8]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::Variant13 ( bslmf::MovableRef< Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > >  original)
inline

Create a variant object having the type and value of the specified original object by moving the contents of original to the newly-created object. The allocator associated with original (if any) is propagated for use in the newly-created object. original is left in a valid but unspecified state.

◆ Variant13() [8/8]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::Variant13 ( bslmf::MovableRef< Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > >  original,
bslma::Allocator basicAllocator 
)
inline

Create a variant object having the type and value of the specified original object that uses the specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The contents of original are moved to the newly-created object with original left in a valid but unspecified state.

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION()

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::BSLMF_NESTED_TRAIT_DECLARATION ( Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >  ,
HasPrintMethod   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF() [1/3]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >  ,
bslma::UsesBslmaAllocator  ,
Traits::k_VARIANT_USES_BSLMA_ALLOCATOR   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF() [2/3]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >  ,
bslmf::IsBitwiseCopyable  ,
Traits::k_VARIANT_IS_BITWISE_COPYABLE   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF() [3/3]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >  ,
bslmf::IsBitwiseMoveable  ,
Traits::k_VARIANT_IS_BITWISE_MOVEABLE   
)

◆ operator=() [1/6]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
template<class TYPE >
Variant13 & bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::operator= ( bslmf::MovableRef< TYPE >  value)

◆ operator=() [2/6]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
template<class TYPE >
Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > & bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::operator= ( bslmf::MovableRef< TYPE >  value)
inline

◆ operator=() [3/6]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > & bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::operator= ( bslmf::MovableRef< Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > >  rhs)
inline

Assign to this object the type and value currently held by the specified rhs object, and return a reference providing modifiable access to this object. The value currently held by this variant (if any) is destroyed if that value's type is not the same as the type held by the rhs object. The contents of rhs are either move-inserted into or move-assigned to this object with rhs left in a valid but unspecified state.

◆ operator=() [4/6]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
template<class TYPE >
Variant13 & bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::operator= ( const TYPE &  value)

Assign to this object the specified value of template parameter TYPE, and return a reference providing modifiable access to this object. The value currently held by this variant (if any) is destroyed if that value's type is not the same as TYPE. TYPE must be the same as one of the types that this variant can hold.

◆ operator=() [5/6]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
template<class TYPE >
Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > & bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::operator= ( const TYPE &  value)
inline

◆ operator=() [6/6]

template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class A12 , class A13 >
Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > & bdlb::Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 >::operator= ( const Variant13< A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13 > &  rhs)
inline

Assign to this object the type and value currently held by the specified rhs object, and return a reference providing modifiable access to this object. The value currently held by this variant (if any) is destroyed if that value's type is not the same as the type held by the rhs object.


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