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