BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsltf::AllocTestType Class Reference

#include <bsltf_alloctesttype.h>

Public Types

typedef bsl::allocator< int > allocator_type
 

Public Member Functions

 AllocTestType ()
 
 AllocTestType (const allocator_type &allocator)
 
 AllocTestType (int data, const allocator_type &allocator=allocator_type())
 
 AllocTestType (const AllocTestType &original, const allocator_type &allocator=allocator_type())
 
 ~AllocTestType ()
 Destroy this object.
 
AllocTestTypeoperator= (const AllocTestType &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.
 
bslma::Allocatorallocator () const
 Return get_allocator().mechanism().
 
allocator_type get_allocator () const
 Return the allocator used by this object to supply memory.
 

Detailed Description

This unconstrained (value-semantic) attribute class that uses a bsl::allocator<> to supply memory and defines 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 having an allocator. See the Attributes section under @DESCRIPTION in the component-level documentation for information on the class attributes.

See bsltf_alloctesttype

Member Typedef Documentation

◆ allocator_type

Constructor & Destructor Documentation

◆ AllocTestType() [1/4]

bsltf::AllocTestType::AllocTestType ( )

◆ AllocTestType() [2/4]

bsltf::AllocTestType::AllocTestType ( const allocator_type allocator)
explicit

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

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

Optionally specify a allocator used to supply memory. If allocator is 0, the currently installed default allocator is used.

◆ AllocTestType() [3/4]

bsltf::AllocTestType::AllocTestType ( int  data,
const allocator_type allocator = allocator_type() 
)
explicit

Create a AllocTestType object having the specified data attribute value. Optionally specify a allocator used to supply memory (e.g., the address of a bslma::Allocator object). If allocator is not specified, the currently installed default allocator is used.

◆ AllocTestType() [4/4]

bsltf::AllocTestType::AllocTestType ( const AllocTestType original,
const allocator_type allocator = allocator_type() 
)

Create a AllocTestType object having the same value as the specified original object. Optionally specify a allocator used to supply memory (e.g., the address of a bslma::Allocator object). If allocator is not specified, the currently installed default allocator is used.

◆ ~AllocTestType()

bsltf::AllocTestType::~AllocTestType ( )

Member Function Documentation

◆ allocator()

bslma::Allocator * bsltf::AllocTestType::allocator ( ) const
inline

◆ data()

int bsltf::AllocTestType::data ( ) const
inline

◆ get_allocator()

AllocTestType::allocator_type bsltf::AllocTestType::get_allocator ( ) const
inline

◆ operator=()

AllocTestType & bsltf::AllocTestType::operator= ( const AllocTestType rhs)

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

◆ setData()

void bsltf::AllocTestType::setData ( int  value)
inline

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