Quick Links: |
#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 () | |
StdAllocTestType & | operator= (const StdAllocTestType &rhs) |
void | setData (int value) |
int | data () const |
const ALLOC & | allocator () const |
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
. 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 under @DESCRIPTION in the component-level documentation for information on the class attributes.
See Component bsltf_stdalloctesttype
typedef ALLOC bsltf::StdAllocTestType< ALLOC >::allocator_type |
needed by uses_allocator
trait
bsltf::StdAllocTestType< ALLOC >::StdAllocTestType | ( | const ALLOC & | stdAllocator = ALLOC() |
) | [explicit] |
Create a StdAllocTestType
object having the (default) attribute values:
data() == 0
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.
bsltf::StdAllocTestType< ALLOC >::StdAllocTestType | ( | int | value, | |
const ALLOC & | stdAllocator = ALLOC() | |||
) | [explicit] |
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.
bsltf::StdAllocTestType< ALLOC >::StdAllocTestType | ( | const StdAllocTestType< ALLOC > & | original | ) |
bsltf::StdAllocTestType< ALLOC >::StdAllocTestType | ( | const StdAllocTestType< ALLOC > & | original, | |
const ALLOC & | stdAllocator | |||
) |
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.
bsltf::StdAllocTestType< ALLOC >::~StdAllocTestType | ( | ) |
Destroy this object.
StdAllocTestType& bsltf::StdAllocTestType< ALLOC >::operator= | ( | const StdAllocTestType< ALLOC > & | rhs | ) |
Assign to this object the value of the specified rhs
object, and return a reference providing modifiable access to this object.
void bsltf::StdAllocTestType< ALLOC >::setData | ( | int | value | ) |
Set the data
attribute of this object to the specified value
.
int bsltf::StdAllocTestType< ALLOC >::data | ( | ) | const |
Return the value of the data
attribute of this object.
const ALLOC& bsltf::StdAllocTestType< ALLOC >::allocator | ( | ) | const |
Return the allocator used by this object to supply memory.