This commit is contained in:
Dave Schuyler 2003-03-18 02:32:38 +00:00
parent 8f564ea8ce
commit 35127b5d1b
1 changed files with 15 additions and 1 deletions

View File

@ -27,7 +27,21 @@ typedef unsigned long U32;
////////////////////////////////////////////////////////////////////
// Class : UniqueIdAllocator
// Description :
// Description : Manage a set of ID values from min to max inclusive.
// The ID numbers that are freed will be allocated
// (reused) in the same order. I.e. the oldest ID numbers
// will be allocated.
//
// This implementation will use 4 bytes per id number,
// plus a few bytes of management data. e.g. 10,000
// ID numbers will use 40KB.
//
// There are other implementations that can better leverage
// runs of used or unused IDs or use bit arrays for the
// IDs. But, it takes extra work to track the age of
// freed IDs, which is required for what we wanted. If
// you would like to kick around other implementation
// ideas, please contact Schuyler.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA UniqueIdAllocator {
PUBLISHED: