BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsltf::StdAllocTestType< ALLOC > Class Template Reference

#include <bsltf_stdalloctesttype.h>

Public Types

typedef ALLOC allocator_type
 

Public Member Functions

 StdAllocTestType (const ALLOC &stdAllocator=ALLOC())
 
 StdAllocTestType (int value, const ALLOC &stdAllocator=ALLOC())
 
 StdAllocTestType (const StdAllocTestType &original)
 
 StdAllocTestType (const StdAllocTestType &original, const ALLOC &stdAllocator)
 
 ~StdAllocTestType ()
 Destroy this object.
 
StdAllocTestTypeoperator= (const StdAllocTestType &rhs)
 
void setData (int value)
 Set the data attribute of this object to the specified value.
 
int data () const
 Return the value of the data attribute of this object.
 
const ALLOC & allocator () const
 Return the allocator used by this object to supply memory.
 

Detailed Description

template<class ALLOC>
class bsltf::StdAllocTestType< ALLOC >

This unconstrained (value-semantic) attribute class uses a standard allocator of (template parameter) type ALLOC to allocate memory. This class does NOT define the type trait bslma::UsesBslmaAllocator, but the trait will be true if ALLOC is convertible from bslma::Allocator * (e.g., if it is an instantiation of bsl::allocator). This class is primarily provided to facilitate testing of templates by defining a simple type representative of user-defined types using a standard allocator. See the Attributes section for information on the class attributes.

See bsltf_stdalloctesttype

Member Typedef Documentation

◆ allocator_type

template<class ALLOC >
typedef ALLOC bsltf::StdAllocTestType< ALLOC >::allocator_type

Constructor & Destructor Documentation

◆ StdAllocTestType() [1/4]

template<class ALLOC >
bsltf::StdAllocTestType< ALLOC >::StdAllocTestType ( const ALLOC &  stdAllocator = ALLOC())
inlineexplicit

Create a StdAllocTestType object having the (default) attribute values:

data() == 0
int data() const
Return the value of the data attribute of this object.
Definition bsltf_stdalloctesttype.h:383

Optionally specify a stdAllocator used to supply memory. If an allocator is not supplied, a default-constructed object of the template parameter type ALLOC is used.

◆ StdAllocTestType() [2/4]

template<class ALLOC >
bsltf::StdAllocTestType< ALLOC >::StdAllocTestType ( int  value,
const ALLOC &  stdAllocator = ALLOC() 
)
inlineexplicit

Create a StdAllocTestType object having the specified data attribute value. Optionally specify a stdAllocator used to supply memory. If basicAllocator is not supplied, a default constructed object of (template parameter) type ALLOC is used.

◆ StdAllocTestType() [3/4]

template<class ALLOC >
bsltf::StdAllocTestType< ALLOC >::StdAllocTestType ( const StdAllocTestType< ALLOC > &  original)
inline

◆ StdAllocTestType() [4/4]

template<class ALLOC >
bsltf::StdAllocTestType< ALLOC >::StdAllocTestType ( const StdAllocTestType< ALLOC > &  original,
const ALLOC &  stdAllocator 
)
inline

Create a StdAllocTestType object having the same value as the specified original object. Optionally specify a stdAllocator used to supply memory. If basicAllocator is not supplied, a default constructed object of (template parameter) type ALLOC is used.

◆ ~StdAllocTestType()

template<class ALLOC >
bsltf::StdAllocTestType< ALLOC >::~StdAllocTestType ( )
inline

Member Function Documentation

◆ allocator()

template<class ALLOC >
const ALLOC & bsltf::StdAllocTestType< ALLOC >::allocator ( ) const
inline

◆ data()

template<class ALLOC >
int bsltf::StdAllocTestType< ALLOC >::data ( ) const
inline

◆ operator=()

template<class ALLOC >
StdAllocTestType< ALLOC > & bsltf::StdAllocTestType< ALLOC >::operator= ( const StdAllocTestType< ALLOC > &  rhs)
inline

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

◆ setData()

template<class ALLOC >
void bsltf::StdAllocTestType< ALLOC >::setData ( int  value)
inline

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