eq::base::IDPool Class Reference

#include <idPool.h>

List of all members.


Detailed Description

A identifier pool.

Manages unique identifiers.

Definition at line 25 of file idPool.h.


Public Types

enum  MaxCapacity { MAX_CAPACITY = 0xfffffff0 }

Public Member Functions

 IDPool (const uint32_t initialCapacity)
 Constructs a new identifier pool.
 ~IDPool ()
 Destructs the identifier pool.
uint32_t genIDs (const uint32_t range)
 Generate a new, consecutive block of identifiers.
void freeIDs (const uint32_t start, const uint32_t range)

Classes

struct  Block

Constructor & Destructor Documentation

eq::base::IDPool::IDPool ( const uint32_t  initialCapacity  ) 

Constructs a new identifier pool.

Parameters:
initialCapacity the initial capacity of the pool, the identifiers from initialCapacity to MAX_CAPACITY are considered as allocated.

Definition at line 19 of file idPool.cpp.

eq::base::IDPool::~IDPool (  ) 

Destructs the identifier pool.

Definition at line 32 of file idPool.cpp.


Member Function Documentation

uint32_t eq::base::IDPool::genIDs ( const uint32_t  range  ) 

Generate a new, consecutive block of identifiers.

Parameters:
range The number of identifiers to allocate
Returns:
the first identifier of the block, or EQ_ID_INVALID if no block of size range is available.

Definition at line 48 of file idPool.cpp.

Referenced by eq::net::Session::genIDs().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Dec 6 12:01:49 2008 for Equalizer 0.6 by  1.5.5