Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bsltf::AllocArgumentType< N > Class Template Reference

#include <bsltf_allocargumenttype.h>

List of all members.

Public Member Functions

 AllocArgumentType (bslma::Allocator *basicAllocator=0)
 AllocArgumentType (int value, bslma::Allocator *basicAllocator=0)
 AllocArgumentType (const AllocArgumentType &original, bslma::Allocator *basicAllocator=0)
 AllocArgumentType (bslmf::MovableRef< AllocArgumentType > original)
 AllocArgumentType (bslmf::MovableRef< AllocArgumentType > original, bslma::Allocator *basicAllocator)
 ~AllocArgumentType ()
AllocArgumentTypeoperator= (const AllocArgumentType &rhs)
AllocArgumentTypeoperator= (BloombergLP::bslmf::MovableRef< AllocArgumentType > rhs)
bslma::Allocatorallocator () const
 operator int () const
MoveState::Enum movedInto () const
MoveState::Enum movedFrom () const

Detailed Description

template<int N>
class bsltf::AllocArgumentType< N >

This class template declares a separate type for each template parameter value N, bsltf::AllocArgumentType<N>, that wraps an integer value and provides implicit conversion to and from int. The wrapped integer will be dynamically allocated using the supplied allocator, or the default allocator if none is supplied. Its main purpose is that having separate types for testing enables distinguishing them when calling through a function template interface, thereby avoiding ambiguities or accidental switching of arguments in the implementation of in-place constructors. It further tests that allocators are propagated correctly, or not, as required.

See Component bsltf_allocargumenttype


Constructor & Destructor Documentation

template<int N>
bsltf::AllocArgumentType< N >::AllocArgumentType ( bslma::Allocator basicAllocator = 0  )  [explicit]

Create an AllocArgumentType object having the (default) attribute value -1. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Note, that default constructor does not allocate memory.

template<int N>
bsltf::AllocArgumentType< N >::AllocArgumentType ( int  value,
bslma::Allocator basicAllocator = 0 
) [explicit]

Create an AllocArgumentType object having the specified value. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless value >= 0.

template<int N>
bsltf::AllocArgumentType< N >::AllocArgumentType ( const AllocArgumentType< N > &  original,
bslma::Allocator basicAllocator = 0 
)

Create an AllocArgumentType object having the same value as the specified original. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Note, that no memory is allocated if original refers to a default-constructed object.

template<int N>
bsltf::AllocArgumentType< N >::AllocArgumentType ( bslmf::MovableRef< AllocArgumentType< N > >  original  ) 

Create an AllocArgumentType object having the same value as the specified original. Note, that no memory is allocated if original refers to a default-constructed object.

template<int N>
bsltf::AllocArgumentType< N >::AllocArgumentType ( bslmf::MovableRef< AllocArgumentType< N > >  original,
bslma::Allocator basicAllocator 
)

Create an AllocArgumentType object having the same value as the specified original using the specified basicAllocator to supply memory. Note, that no memory is allocated if original refers to a default-constructed object.

template<int N>
bsltf::AllocArgumentType< N >::~AllocArgumentType (  ) 

Destroy this object.


Member Function Documentation

template<int N>
AllocArgumentType& bsltf::AllocArgumentType< N >::operator= ( const AllocArgumentType< N > &  rhs  ) 

Assign to this object the value of the specified rhs object.

template<int N>
AllocArgumentType& bsltf::AllocArgumentType< N >::operator= ( BloombergLP::bslmf::MovableRef< AllocArgumentType< N > >  rhs  ) 

Assign to this object the value of the specified rhs object. Note that rhs is left in a valid but unspecified state.

template<int N>
bslma::Allocator* bsltf::AllocArgumentType< N >::allocator (  )  const

Return the allocator used by this object to supply memory.

template<int N>
bsltf::AllocArgumentType< N >::operator int (  )  const

Return the value of this test argument object.

template<int N>
MoveState::Enum bsltf::AllocArgumentType< N >::movedInto (  )  const

Return the move state of this object as target of a move operation.

template<int N>
MoveState::Enum bsltf::AllocArgumentType< N >::movedFrom (  )  const

Return the move state of this object as source of a move operation.


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