14#ifndef _UNIQUEIDALLOCATOR_H
15#define _UNIQUEIDALLOCATOR_H
46 void free(uint32_t index);
49 void output(std::ostream &out)
const;
50 void write(std::ostream &out)
const;
53 static const uint32_t IndexEnd;
54 static const uint32_t IndexAllocated;
void initial_reserve_id(uint32_t id)
This may be called to mark a particular id as having already been allocated (for instance,...
void output(std::ostream &out) const
...intended for debugging only.
void write(std::ostream &out) const
...intended for debugging only.
uint32_t allocate()
Returns an id between _min and _max (that were passed to the constructor).
PN_stdfloat fraction_used() const
return the decimal fraction of the pool that is used.
void free(uint32_t index)
Free an allocated index (index must be between _min and _max that were passed to the constructor).
UniqueIdAllocator(uint32_t min=0, uint32_t max=20)
Create a free id pool in the range [min:max].
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.