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

#include <bsltf_moveonlyalloctesttype.h>

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (MoveOnlyAllocTestType, bsl::is_nothrow_move_constructible)
 
 MoveOnlyAllocTestType (bslma::Allocator *basicAllocator=0)
 
 MoveOnlyAllocTestType (int data, bslma::Allocator *basicAllocator=0)
 
 MoveOnlyAllocTestType (bslmf::MovableRef< MoveOnlyAllocTestType > original) BSLS_KEYWORD_NOEXCEPT
 
 MoveOnlyAllocTestType (bslmf::MovableRef< MoveOnlyAllocTestType > original, bslma::Allocator *basicAllocator)
 
 ~MoveOnlyAllocTestType ()
 Destroy this object.
 
MoveOnlyAllocTestTypeoperator= (bslmf::MovableRef< MoveOnlyAllocTestType > 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.
 
bslma::Allocatorallocator () const
 Return the allocator used by this object to supply memory.
 
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 unconstrained (value-semantic) attribute class that uses a bslma::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_moveonlyalloctesttype

Constructor & Destructor Documentation

◆ MoveOnlyAllocTestType() [1/4]

bsltf::MoveOnlyAllocTestType::MoveOnlyAllocTestType ( bslma::Allocator basicAllocator = 0)
explicit

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

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

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

◆ MoveOnlyAllocTestType() [2/4]

bsltf::MoveOnlyAllocTestType::MoveOnlyAllocTestType ( int  data,
bslma::Allocator basicAllocator = 0 
)
explicit

Create a MoveOnlyAllocTestType 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.

◆ MoveOnlyAllocTestType() [3/4]

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

◆ MoveOnlyAllocTestType() [4/4]

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

Create a MoveAllocTestType 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. After construction, this object will be in a movedInto state, and original will be in a movedFrom state. No allocations shall occur (so no exception will be thrown) unless basicAllocator is not the currently installed default allocator.

◆ ~MoveOnlyAllocTestType()

bsltf::MoveOnlyAllocTestType::~MoveOnlyAllocTestType ( )

Member Function Documentation

◆ allocator()

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

◆ BSLMF_NESTED_TRAIT_DECLARATION()

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

◆ data()

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

◆ movedFrom()

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

◆ movedInto()

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

◆ operator=()

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

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object. If rhs is a reference to this object, there are no other effects; otherwise, the object referenced by rhs will be reset to a default constructed state, rhs shall be in a movedFrom state, and this object will be in a movedTo state. No allocations shall occur (so no exception will be thrown) unless this object and rhs have different allocators. Note that the moved-from state is specified, rather than "valid but unspecified", as this type is intended for verifying test drivers that want to ensure that moves occur correctly where expected.

◆ setData()

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

◆ setMovedInto()

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

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