Quick Links: |
#include <bsltf_movablealloctesttype.h>
Public Member Functions | |
BSLMF_NESTED_TRAIT_DECLARATION (MovableAllocTestType, bsl::is_nothrow_move_constructible) | |
MovableAllocTestType () | |
MovableAllocTestType (bslma::Allocator *basicAllocator) | |
MovableAllocTestType (int data, bslma::Allocator *basicAllocator=0) | |
MovableAllocTestType (bslmf::MovableRef< MovableAllocTestType > original) BSLS_KEYWORD_NOEXCEPT | |
MovableAllocTestType (bslmf::MovableRef< MovableAllocTestType > original, bslma::Allocator *basicAllocator) | |
MovableAllocTestType (const MovableAllocTestType &original, bslma::Allocator *basicAllocator=0) | |
~MovableAllocTestType () | |
MovableAllocTestType & | operator= (const MovableAllocTestType &rhs) |
MovableAllocTestType & | operator= (bslmf::MovableRef< MovableAllocTestType > rhs) |
void | setData (int value) |
void | setMovedInto (MoveState::Enum value) |
int | data () const |
MoveState::Enum | movedInto () const |
MoveState::Enum | movedFrom () const |
bslma::Allocator * | allocator () const |
This class provides an unconstrained (value-semantic) attribute type that records when move semantics have been invoked with the object instance as the source parameter. The class uses a bslma::Allocator
to allocate memory and defines the type trait bslma::UsesBslmaAllocator
. This class is primarily provided to facilitate testing of templates where move semantics need to be differentiated versus copy semantics. See the Attributes
section under @DESCRIPTION in the component-level documentation for information on the class attributes.
See Component bsltf_movablealloctesttype
bsltf::MovableAllocTestType::MovableAllocTestType | ( | ) |
bsltf::MovableAllocTestType::MovableAllocTestType | ( | bslma::Allocator * | basicAllocator | ) | [explicit] |
Create a MovableAllocTestType
object having the (default) attribute values:
data() == -1
Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used.
bsltf::MovableAllocTestType::MovableAllocTestType | ( | int | data, | |
bslma::Allocator * | basicAllocator = 0 | |||
) | [explicit] |
Create a MovableAllocTestType
object having the specified data
attribute value. Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used.
bsltf::MovableAllocTestType::MovableAllocTestType | ( | bslmf::MovableRef< MovableAllocTestType > | original | ) |
bsltf::MovableAllocTestType::MovableAllocTestType | ( | bslmf::MovableRef< MovableAllocTestType > | original, | |
bslma::Allocator * | basicAllocator | |||
) |
TBD: comment this
bsltf::MovableAllocTestType::MovableAllocTestType | ( | const MovableAllocTestType & | original, | |
bslma::Allocator * | basicAllocator = 0 | |||
) |
Create a MovableAllocTestType
object having the same value as the specified original
object. Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used.
bsltf::MovableAllocTestType::~MovableAllocTestType | ( | ) |
Destroy this object.
bsltf::MovableAllocTestType::BSLMF_NESTED_TRAIT_DECLARATION | ( | MovableAllocTestType | , | |
bsl::is_nothrow_move_constructible | ||||
) |
MovableAllocTestType& bsltf::MovableAllocTestType::operator= | ( | const MovableAllocTestType & | rhs | ) |
Assign to this object the value of the specified rhs
object, and return a reference providing modifiable access to this object.
MovableAllocTestType& bsltf::MovableAllocTestType::operator= | ( | bslmf::MovableRef< MovableAllocTestType > | rhs | ) |
TBD: comment this
void bsltf::MovableAllocTestType::setData | ( | int | value | ) |
Set the data
attribute of this object to the specified value
.
void bsltf::MovableAllocTestType::setMovedInto | ( | MoveState::Enum | value | ) |
Set the moved-into state of this object to the specified value
.
int bsltf::MovableAllocTestType::data | ( | ) | const |
Return the value of the data
attribute of this object.
MoveState::Enum bsltf::MovableAllocTestType::movedInto | ( | ) | const |
Return the move state of this object as target of a move operation.
MoveState::Enum bsltf::MovableAllocTestType::movedFrom | ( | ) | const |
Return the move state of this object as source of a move operation.
bslma::Allocator* bsltf::MovableAllocTestType::allocator | ( | ) | const |
Return the allocator used by this object to supply memory.