BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsltf::StdAllocTestType< ALLOC > Class Template Reference

#include <bsltf_stdalloctesttype.h>

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

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 ()
 
StdAllocTestTypeoperator= (const StdAllocTestType &rhs)
 
void setData (int value)
 
int data () const
 
const ALLOC & allocator () const
 

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

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() [4/4]

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

◆ ~StdAllocTestType()

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

Destroy this object.

Member Function Documentation

◆ allocator()

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

Return the allocator used by this object to supply memory.

◆ data()

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

Return the value of the data attribute of this object.

◆ 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

Set the data attribute of this object to the specified value.


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