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

#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.
 
MovableAllocTestTypeoperator= (const MovableAllocTestType &rhs)
 
MovableAllocTestTypeoperator= (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::Allocatorallocator () 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)
 

Detailed Description

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 bsltf_movablealloctesttype

Constructor & Destructor Documentation

◆ MovableAllocTestType() [1/6]

bsltf::MovableAllocTestType::MovableAllocTestType ( )

◆ MovableAllocTestType() [2/6]

bsltf::MovableAllocTestType::MovableAllocTestType ( bslma::Allocator basicAllocator)
explicit

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

data() == -1
int data() const
Return the value of the data attribute of this object.
Definition bsltf_movablealloctesttype.h:311

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

◆ MovableAllocTestType() [3/6]

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.

◆ MovableAllocTestType() [4/6]

bsltf::MovableAllocTestType::MovableAllocTestType ( bslmf::MovableRef< MovableAllocTestType original)

◆ MovableAllocTestType() [5/6]

bsltf::MovableAllocTestType::MovableAllocTestType ( bslmf::MovableRef< MovableAllocTestType original,
bslma::Allocator basicAllocator 
)

◆ MovableAllocTestType() [6/6]

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.

◆ ~MovableAllocTestType()

bsltf::MovableAllocTestType::~MovableAllocTestType ( )

Member Function Documentation

◆ allocator()

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

◆ BSLMF_NESTED_TRAIT_DECLARATION()

bsltf::MovableAllocTestType::BSLMF_NESTED_TRAIT_DECLARATION ( MovableAllocTestType  ,
bsl::is_nothrow_move_constructible   
)

◆ copyMoveState()

CopyMoveState::Enum bsltf::MovableAllocTestType::copyMoveState ( ) const
inline

◆ data()

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

◆ movedFrom()

MoveState::Enum bsltf::MovableAllocTestType::movedFrom ( ) const
inline

DEPRECATED Use CopyMoveState::isMovedFrom instead. Return the move state of this object as source of a move operation.

◆ movedInto()

MoveState::Enum bsltf::MovableAllocTestType::movedInto ( ) const
inline

DEPRECATED Use CopyMoveState::isMovedInto instead. Return the move state of this object as target of a move operation.

◆ operator=() [1/2]

MovableAllocTestType & bsltf::MovableAllocTestType::operator= ( bslmf::MovableRef< MovableAllocTestType rhs)

◆ operator=() [2/2]

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.

◆ setCopyMoveState()

void bsltf::MovableAllocTestType::setCopyMoveState ( CopyMoveState::Enum  state)
inline

◆ setData()

void bsltf::MovableAllocTestType::setData ( int  value)

◆ setMovedInto()

void bsltf::MovableAllocTestType::setMovedInto ( MoveState::Enum  value)
inline

Friends And Related Symbol Documentation

◆ copyMoveState

CopyMoveState::Enum copyMoveState ( const MovableAllocTestType obj)
friend

Return the copy/move state of the specified obj. This function is an ADL customization point used by CopyMoveState::get(obj).

◆ setCopyMoveState

void setCopyMoveState ( MovableAllocTestType obj,
CopyMoveState::Enum  state 
)
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).


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