STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Private Attributes | List of all members
stdext::allocators::freelist< _Sz, _Max > Class Template Reference
Inheritance diagram for stdext::allocators::freelist< _Sz, _Max >:

Classes

struct  node
 

Public Member Functions

 freelist ()
 
bool push (void *_Ptr)
 
voidpop ()
 

Private Attributes

node_Head
 

Constructor & Destructor Documentation

template<size_t _Sz, class _Max>
stdext::allocators::freelist< _Sz, _Max >::freelist ( )
inline
322  : _Head(0)
323  { // construct with empty list
324  }
node * _Head
Definition: allocators:355

Member Function Documentation

template<size_t _Sz, class _Max>
void* stdext::allocators::freelist< _Sz, _Max >::pop ( )
inline
340  { // pop node from free list
341  void *_Ptr = _Head;
342  if (_Ptr != 0)
343  { // relink
344  _Head = _Head->_Next;
345  this->released();
346  }
347  return (_Ptr);
348  }
node * _Next
Definition: allocators:353
node * _Head
Definition: allocators:355
template<size_t _Sz, class _Max>
bool stdext::allocators::freelist< _Sz, _Max >::push ( void _Ptr)
inline
327  { // push onto free list depending on max
328  if (this->full())
329  return (false);
330  else
331  { // push onto free list
332  ((node*)_Ptr)->_Next = _Head;
333  _Head = (node*)_Ptr;
334  this->saved();
335  return (true);
336  }
337  }
node * _Head
Definition: allocators:355

Member Data Documentation

template<size_t _Sz, class _Max>
node* stdext::allocators::freelist< _Sz, _Max >::_Head
private

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