STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | List of all members
stdext::allocators::allocator_base< _Ty, _Sync > Class Template Reference
Inheritance diagram for stdext::allocators::allocator_base< _Ty, _Sync >:

Public Types

typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef _Ty * pointer
 
typedef const _Ty * const_pointer
 
typedef voidvoid_pointer
 
typedef const voidconst_void_pointer
 
typedef _Ty & reference
 
typedef const _Ty & const_reference
 
typedef _Ty value_type
 

Public Member Functions

 allocator_base ()
 
template<class _Other >
 allocator_base (const allocator_base< _Other, _Sync > &_Right)
 
pointer address (reference _Val)
 
const_pointer address (const_reference _Val)
 
template<class _Other >
pointer allocate (size_type _Nx, const _Other *)
 
pointer allocate (size_type _Nx)
 
void deallocate (pointer _Ptr, size_type _Nx)
 
void construct (pointer _Ptr, const _Ty &_Val)
 
template<class _Uty , class _Other >
void construct (_Uty *_Ptr, const _Other &_Val)
 
template<class _Other >
void construct (pointer _Ptr, _Other &&_Val)
 
template<class _Uty >
void construct (_Uty *_Ptr)
 
template<class _Other >
void destroy (_Other *_Ptr)
 
size_type max_size () const
 

Member Typedef Documentation

template<class _Ty , class _Sync >
typedef const _Ty* stdext::allocators::allocator_base< _Ty, _Sync >::const_pointer
template<class _Ty , class _Sync >
typedef const _Ty& stdext::allocators::allocator_base< _Ty, _Sync >::const_reference
template<class _Ty , class _Sync >
typedef const void* stdext::allocators::allocator_base< _Ty, _Sync >::const_void_pointer
template<class _Ty , class _Sync >
typedef ptrdiff_t stdext::allocators::allocator_base< _Ty, _Sync >::difference_type
template<class _Ty , class _Sync >
typedef _Ty* stdext::allocators::allocator_base< _Ty, _Sync >::pointer
template<class _Ty , class _Sync >
typedef _Ty& stdext::allocators::allocator_base< _Ty, _Sync >::reference
template<class _Ty , class _Sync >
typedef size_t stdext::allocators::allocator_base< _Ty, _Sync >::size_type
template<class _Ty , class _Sync >
typedef _Ty stdext::allocators::allocator_base< _Ty, _Sync >::value_type
template<class _Ty , class _Sync >
typedef void* stdext::allocators::allocator_base< _Ty, _Sync >::void_pointer

Constructor & Destructor Documentation

template<class _Ty , class _Sync >
stdext::allocators::allocator_base< _Ty, _Sync >::allocator_base ( )
inline
694  { // default construct
695  }
template<class _Ty , class _Sync >
template<class _Other >
stdext::allocators::allocator_base< _Ty, _Sync >::allocator_base ( const allocator_base< _Other, _Sync > &  _Right)
inline
699  : _Sync(_Right)
700  { // construct by copying x
701  }
const _Ty & _Right
Definition: algorithm:4087

Member Function Documentation

template<class _Ty , class _Sync >
pointer stdext::allocators::allocator_base< _Ty, _Sync >::address ( reference  _Val)
inline
704  { // get address of _Val
705  return (&_Val);
706  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty , class _Sync >
const_pointer stdext::allocators::allocator_base< _Ty, _Sync >::address ( const_reference  _Val)
inline
709  { // get const address of _Val
710  return (&_Val);
711  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty , class _Sync >
template<class _Other >
pointer stdext::allocators::allocator_base< _Ty, _Sync >::allocate ( size_type  _Nx,
const _Other *   
)
inline
715  { // allocate _Nx elements, ignore hint
716  return (allocate(_Nx));
717  }
pointer allocate(size_type _Nx, const _Other *)
Definition: allocators:714
template<class _Ty , class _Sync >
pointer stdext::allocators::allocator_base< _Ty, _Sync >::allocate ( size_type  _Nx)
inline
720  { // allocate array of _Nx elements
721  if (_Nx <= 0)
722  _Nx = 0;
723  else if (((size_t)(-1) / sizeof (_Ty) < _Nx))
724  _STD _Xbad_alloc();
725 
726  if (_Nx == 1)
727  return ((_Ty *)_Sync::allocate(sizeof (_Ty)));
728  else
729  return ((_Ty *)::operator new(_Nx * sizeof (_Ty)));
730  }
template<class _Ty , class _Sync >
void stdext::allocators::allocator_base< _Ty, _Sync >::construct ( pointer  _Ptr,
const _Ty &  _Val 
)
inline
756  { // construct object at _Ptr with value _Val
757  ::new ((void *)_Ptr) _Ty(_Val);
758  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty , class _Sync >
template<class _Uty , class _Other >
void stdext::allocators::allocator_base< _Ty, _Sync >::construct ( _Uty *  _Ptr,
const _Other &  _Val 
)
inline
763  { // construct object at _Ptr with value _Val
764  ::new ((void *)_Ptr) _Uty(_Val);
765  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty , class _Sync >
template<class _Other >
void stdext::allocators::allocator_base< _Ty, _Sync >::construct ( pointer  _Ptr,
_Other &&  _Val 
)
inline
769  { // construct object at _Ptr with value _Val
770  ::new ((void *)_Ptr) _Ty((_Other&&)_Val);
771  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty , class _Sync >
template<class _Uty >
void stdext::allocators::allocator_base< _Ty, _Sync >::construct ( _Uty *  _Ptr)
inline
775  { // default construct
776  ::new ((void *)_Ptr) _Uty();
777  }
template<class _Ty , class _Sync >
void stdext::allocators::allocator_base< _Ty, _Sync >::deallocate ( pointer  _Ptr,
size_type  _Nx 
)
inline
733  { // deallocate array of _Nx elements
734  if (_Ptr == 0)
735  ;
736  else if (_Nx == 1)
737  _Sync::deallocate(_Ptr, sizeof (_Ty));
738  else
739  ::operator delete(_Ptr);
740  }
template<class _Ty , class _Sync >
template<class _Other >
void stdext::allocators::allocator_base< _Ty, _Sync >::destroy ( _Other *  _Ptr)
inline
781  { // destroy *_Ptr
782  _Ptr->~_Other();
783  }
template<class _Ty , class _Sync >
size_type stdext::allocators::allocator_base< _Ty, _Sync >::max_size ( ) const
inline
786  { // return maximum number of objects that could be allocated
787  return ((size_t)(-1) / sizeof (_Ty));
788  }

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