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
316  : _Head(0)
317  { // construct with empty list
318  }
node * _Head
Definition: allocators:349

Member Function Documentation

template<size_t _Sz, class _Max>
void* stdext::allocators::freelist< _Sz, _Max >::pop ( )
inline
334  { // pop node from free list
335  void *_Ptr = _Head;
336  if (_Ptr != 0)
337  { // relink
338  _Head = _Head->_Next;
339  this->released();
340  }
341  return (_Ptr);
342  }
node * _Next
Definition: allocators:347
node * _Head
Definition: allocators:349
template<size_t _Sz, class _Max>
bool stdext::allocators::freelist< _Sz, _Max >::push ( void _Ptr)
inline
321  { // push onto free list depending on max
322  if (this->full())
323  return (false);
324  else
325  { // push onto free list
326  ((node*)_Ptr)->_Next = _Head;
327  _Head = (node*)_Ptr;
328  this->saved();
329  return (true);
330  }
331  }
node * _Head
Definition: allocators:349

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: