BDE 4.14.0 Production release
|
#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) | |
TBD: comment this. | |
MovableAllocTestType (const MovableAllocTestType &original, bslma::Allocator *basicAllocator=0) | |
~MovableAllocTestType () | |
Destroy this object. | |
MovableAllocTestType & | operator= (const MovableAllocTestType &rhs) |
MovableAllocTestType & | operator= (bslmf::MovableRef< MovableAllocTestType > rhs) |
TBD: comment this. | |
void | setCopyMoveState (CopyMoveState::Enum state) |
Set the copy/move state of this object to the specified state . | |
void | setData (int value) |
Set the data attribute of this object to the specified value . | |
void | setMovedInto (MoveState::Enum value) |
Set the moved-into state of this object to the specified value . | |
CopyMoveState::Enum | copyMoveState () const |
Return the copy/move state of this object. | |
int | data () const |
Return the value of the data attribute of this object. | |
MoveState::Enum | movedInto () const |
MoveState::Enum | movedFrom () const |
bslma::Allocator * | allocator () const |
Return the allocator used by this object to supply memory. | |
Friends | |
CopyMoveState::Enum | copyMoveState (const MovableAllocTestType &obj) |
void | setCopyMoveState (MovableAllocTestType *obj, CopyMoveState::Enum state) |
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.
bsltf::MovableAllocTestType::MovableAllocTestType | ( | ) |
|
explicit |
Create a MovableAllocTestType
object having the (default) attribute values:
Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used.
|
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 | ||
) |
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 | ( | ) |
|
inline |
bsltf::MovableAllocTestType::BSLMF_NESTED_TRAIT_DECLARATION | ( | MovableAllocTestType | , |
bsl::is_nothrow_move_constructible | |||
) |
|
inline |
|
inline |
|
inline |
DEPRECATED Use CopyMoveState::isMovedFrom
instead. Return the move state of this object as source of a move operation.
|
inline |
DEPRECATED Use CopyMoveState::isMovedInto
instead. Return the move state of this object as target of a move operation.
MovableAllocTestType & bsltf::MovableAllocTestType::operator= | ( | bslmf::MovableRef< MovableAllocTestType > | rhs | ) |
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.
|
inline |
void bsltf::MovableAllocTestType::setData | ( | int | value | ) |
|
inline |
|
friend |
Return the copy/move state of the specified obj
. This function is an ADL customization point used by CopyMoveState::get(obj)
.
|
friend |
Set the copy/move state of object at the specified obj
address to the specified state
. This function is an ADL customization point used by CopyMoveState::set(obj, state)
.