ircproxy The Ultimate Cyborg |
#include <Index.h>
Definition at line 21 of file Index.h.
Public Member Functions | |
int | index (void) const |
Return a small integer, unique for the instance and constant throughout it's life time. | |
Static Public Member Functions | |
static int | size (void) |
Return the size of a vector that would be needed for the largest index currently in use. | |
Static Public Attributes | |
static int const | max_index = 8 * sizeof(long) |
The maximum number of allowed INDEX_POOL_TYPE instances. | |
Protected Member Functions | |
Index (void) | |
Construct an Index base class, automatically setting M_index to a free index. | |
~Index (void) | |
Destructor. Frees up the index for reuse. | |
Private Attributes | |
int const | M_index |
The index of this instance. | |
Static Private Attributes | |
static long | S_index_pool = ~0 |
A mask to keep track of used indices (a set bit marks a FREE index). |
Construct an Index base class, automatically setting M_index to a free index.
Definition at line 31 of file Index.h.
00031 : M_index(ffsl(S_index_pool) - 1) { ASSERT(M_index != -1); S_index_pool &= ~(1UL << M_index); }
Destructor. Frees up the index for reuse.
Definition at line 33 of file Index.h.
00033 { S_index_pool |= (1 << M_index); }
int Index< INDEX_POOL_TYPE >::index | ( | void | ) | const [inline] |
static int Index< INDEX_POOL_TYPE >::size | ( | void | ) | [inline, static] |
Return the size of a vector that would be needed for the largest index currently in use.
Definition at line 40 of file Index.h.
00040 { int r = 0; unsigned long i = (~static_cast<unsigned long>(S_index_pool)) << 1; while(i >>= 1) ++r; return r; }
long Index< INDEX_POOL_TYPE >::S_index_pool = ~0 [inline, static, private] |
A mask to keep track of used indices (a set bit marks a FREE index).
Definition at line 26 of file Index.h.
Referenced by Index< ServerSession >::Index(), Index< ServerSession >::size(), and Index< ServerSession >::~Index().
The index of this instance.
Definition at line 27 of file Index.h.
Referenced by Index< ServerSession >::index(), Index< ServerSession >::Index(), and Index< ServerSession >::~Index().
Copyright © 2005-2007 Carlo Wood. All rights reserved. |
---|