AllocationMap Class Reference

An index allocation map. More...

#include <AllocationMap.h++>

List of all members.

Public Member Functions

 AllocationMap (size_t size)
 Construct a new AllocationMap with the given size.
 ~AllocationMap () throw ()
 Destructor.
int reserve () throw ()
 Reserve an index from the map.
bool release (uint_t index) throw ()
 Release an index.
bool isReserved (uint_t index) const throw ()
 Determine if a given index is reserved.
uint_t getSize () const throw ()
 Get the size of the map.

Detailed Description

An index allocation map.

Author:
Mark Lindner

Constructor & Destructor Documentation

AllocationMap ( size_t  size  ) 

Construct a new AllocationMap with the given size.

Parameters:
size The number of indexes to allocate in the map.
~AllocationMap (  )  throw ()

Destructor.


Member Function Documentation

uint_t getSize (  )  const throw () [inline]

Get the size of the map.

Returns:
The number of indexes in the map.
bool isReserved ( uint_t  index  )  const throw ()

Determine if a given index is reserved.

Parameters:
index The index to test.
Returns:
true if the index is reserved, false if it is available.
bool release ( uint_t  index  )  throw ()

Release an index.

Parameters:
index The index to release.
Returns:
true if the index was released, false if the index wasn't reserved or if the index is out of range.
int reserve (  )  throw ()

Reserve an index from the map.

Returns:
The reserved index, or -1 if no free index is available.

The documentation for this class was generated from the following files:
Generated on Sat Nov 26 16:49:08 2011 for libcommonc++ by  doxygen 1.6.3