A generic container that stores per-client data.
More...
#include <generic_service.h>
Public Member Functions |
| ClientDataStorage () |
unsigned | alloc_identity (T *data, A *obj) |
unsigned | alloc_client_data (Utcb &utcb, T *&data, unsigned pseudonym, A *obj) |
| Allocates session data for a client.
|
unsigned | free_client_data (Utcb &utcb, T *data, A *obj) |
T * | next (T *prev=0) |
| Iterator.
|
unsigned | get_client_data (Utcb &utcb, T *&data, unsigned identity) |
T * | get_invalid_client (Utcb &utcb, A *obj, T *client=0) |
| Returns a client which pseudonym does not exist anymore.
|
void | cleanup_clients (Utcb &utcb, A *obj) |
| Find all dead clients and mark them for removal by gc()
|
Private Attributes |
T * | _head |
union { |
}; | |
Detailed Description
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
class ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >
A generic container that stores per-client data.
Missing: iterator
Member Typedef Documentation
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
Constructor & Destructor Documentation
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
Member Function Documentation
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
unsigned ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::alloc_client_data |
( |
Utcb & |
utcb, |
|
|
T *& |
data, |
|
|
unsigned |
pseudonym, |
|
|
A * |
obj |
|
) |
| |
|
inline |
Allocates session data for a client.
Sets data->pseudonym to pseudonym and creates a new session identity.
- Parameters
-
| utcb | UTCB |
[out] | data | Allocated client data |
| pseudonym | Pseudonym that the client used to identify to us |
| obj | CapAllocator |
- Returns
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
unsigned ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::alloc_identity |
( |
T * |
data, |
|
|
A * |
obj |
|
) |
| |
|
inline |
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
Find all dead clients and mark them for removal by gc()
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
unsigned ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::free_client_data |
( |
Utcb & |
utcb, |
|
|
T * |
data, |
|
|
A * |
obj |
|
) |
| |
|
inline |
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
Garbage collect - remove clients which are marked for removal.
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
unsigned ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::get_client_data |
( |
Utcb & |
utcb, |
|
|
T *& |
data, |
|
|
unsigned |
identity |
|
) |
| |
|
inline |
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
T* ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::get_invalid_client |
( |
Utcb & |
utcb, |
|
|
A * |
obj, |
|
|
T * |
client = 0 |
|
) |
| |
|
inline |
Returns a client which pseudonym does not exist anymore.
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
Member Data Documentation
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
The documentation for this class was generated from the following file: