UniqueIdAllocator UniqueIdAllocator::UniqueIdAllocator(unsigned int min = (0), unsigned int max = (20)); Description: Create a free id pool in the range [min:max]. |
allocate unsigned int UniqueIdAllocator::allocate(void); Description: Returns an id between _min and _max (that were passed to the constructor). IndexEnd is returned if no ids are available. |
fractionUsed float UniqueIdAllocator::fraction_used(void) const; Description: return the decimal fraction of the pool that is used. The range is 0 to 1.0 (e.g. 75% would be 0.75). |
free void UniqueIdAllocator::free(unsigned int index); Description: Free an allocated index (index must be between _min and _max that were passed to the constructor). |
initialReserveId void UniqueIdAllocator::initial_reserve_id(unsigned int id); Description: This may be called to mark a particular id as having already been allocated (for instance, by a prior pass). The specified id is removed from the available pool. Because of the limitations of this algorithm, this is most efficient when it is called before the first call to allocate(), and when all the calls to initial_reserve_id() are made in descending order by id. However, this is a performance warning only; if performance is not an issue, any id may be reserved at any time. |
output void UniqueIdAllocator::output(ostream &out) const; Description: ...intended for debugging only. |
write void UniqueIdAllocator::write(ostream &out) const; Description: ...intended for debugging only. |