Public Types | |
enum | ReusePolicy { ReuseFast, ReuseSlow } |
Public Member Functions | |
TReusableIdManager (ReusePolicy reusePolicy=ReuseFast, T max=std::numeric_limits< T >::max(), T min=0) | |
TReusableIdManager (const TReusableIdManager &rhs) | |
virtual | ~TReusableIdManager () |
TReusableIdManager & | operator= (const TReusableIdManager &rhs) |
virtual bool | CanAllocate () const |
virtual T | Allocate () |
virtual void | Free (T id) |
virtual bool | TryFree (T id) |
virtual bool | MarkAsUsed (T id) |
virtual bool | MarkAsUsed (T first, T last) |
_tstring | Dump () const |
void | Swap (const TReusableIdManager &rhs) const |
Protected Types | |
typedef std::set < Interval > | Intervals |
Protected Member Functions | |
TReusableIdManager (const Intervals &idRanges, ReusePolicy reusePolicy) | |
bool | InternalMarkAsUsed (T id) |
bool | InternalTryFree (T id) |
Classes | |
class | Interval |
class | SmartId |
enum ReusePolicy |
TReusableIdManager | ( | ReusePolicy | reusePolicy = ReuseFast , |
|
T | max = std::numeric_limits<T>::max() , |
|||
T | min = 0 | |||
) | [inline, explicit] |
TReusableIdManager | ( | const TReusableIdManager< T > & | rhs | ) |
virtual ~TReusableIdManager | ( | ) | [virtual] |
TReusableIdManager | ( | const Intervals & | idRanges, | |
ReusePolicy | reusePolicy | |||
) | [inline, protected] |
TReusableIdManager& operator= | ( | const TReusableIdManager< T > & | rhs | ) |
bool CanAllocate | ( | ) | const [inline, virtual] |
Reimplemented in TThreadSafeReusableIdManager.
T Allocate | ( | ) | [inline, virtual] |
Reimplemented in TThreadSafeReusableIdManager.
void Free | ( | T | id | ) | [inline, virtual] |
Reimplemented in TThreadSafeReusableIdManager.
bool TryFree | ( | T | id | ) | [inline, virtual] |
Reimplemented in TThreadSafeReusableIdManager.
bool MarkAsUsed | ( | T | id | ) | [inline, virtual] |
Reimplemented in TThreadSafeReusableIdManager.
bool MarkAsUsed | ( | T | first, | |
T | last | |||
) | [inline, virtual] |
Reimplemented in TThreadSafeReusableIdManager.
_tstring Dump | ( | ) | const [inline] |
void Swap | ( | const TReusableIdManager< T > & | rhs | ) | const [inline] |
bool InternalMarkAsUsed | ( | T | id | ) | [inline, protected] |
bool InternalTryFree | ( | T | id | ) | [inline, protected] |