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
326  : _Head(0)
327  { // construct with empty list
328  }
node * _Head
Definition: allocators:359

Member Function Documentation

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

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: