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

#include <bsltf_movabletesttype.h>

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (MovableTestType, bsl::is_nothrow_move_constructible)
 
 MovableTestType ()
 
 MovableTestType (int data)
 
 MovableTestType (const MovableTestType &original)
 
 MovableTestType (bslmf::MovableRef< MovableTestType > original) BSLS_KEYWORD_NOEXCEPT
 
 ~MovableTestType ()
 Destroy this object.
 
MovableTestTypeoperator= (const MovableTestType &rhs)
 
MovableTestTypeoperator= (bslmf::MovableRef< MovableTestType > rhs)
 
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.
 
int data () const
 Return the value of the data attribute of this object.
 
MoveState::Enum movedInto () const
 Return the move state of this object as target of a move operation.
 
MoveState::Enum movedFrom () const
 Return the move state of this object as source of a move operation.
 

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. 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_movabletesttype

Constructor & Destructor Documentation

◆ MovableTestType() [1/4]

bsltf::MovableTestType::MovableTestType ( )

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

data() == -1
movedInto() == e_NOT_MOVED
movedFrom() == e_NOT_MOVED
MoveState::Enum movedInto() const
Return the move state of this object as target of a move operation.
Definition bsltf_movabletesttype.h:287
int data() const
Return the value of the data attribute of this object.
Definition bsltf_movabletesttype.h:275
MoveState::Enum movedFrom() const
Return the move state of this object as source of a move operation.
Definition bsltf_movabletesttype.h:281

◆ MovableTestType() [2/4]

bsltf::MovableTestType::MovableTestType ( int  data)
explicit

Create a MovableTestType object having the specified data attribute value.

◆ MovableTestType() [3/4]

bsltf::MovableTestType::MovableTestType ( const MovableTestType original)

Create a MovableTestType object having the same value as the specified original object. Note that movedInto() for this object will be e_NOT_MOVED, and original.movedFrom() will also be e_NOT_MOVED.

◆ MovableTestType() [4/4]

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

Create a MovableTestType object having the same value as the specified original object. Note that movedInto() for this object will be e_MOVED, and original.movedFrom() will also be e_MOVED.

◆ ~MovableTestType()

bsltf::MovableTestType::~MovableTestType ( )

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION()

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

◆ data()

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

◆ movedFrom()

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

◆ movedInto()

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

◆ operator=() [1/2]

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

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object. Note that movedInto() for this object will be e_MOVED, and rhs.movedFrom() will also be e_MOVED.

◆ operator=() [2/2]

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

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object. Note that movedInto() for this object will be e_NOT_MOVED, and rhs.movedFrom() will also be e_NOT_MOVED.

◆ setData()

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

◆ setMovedInto()

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

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