NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ClientDataStorage< T, A, free_pseudonym, __DEBUG__ > Class Template Reference

A generic container that stores per-client data. More...

#include <generic_service.h>

Classes

class  Guard
struct  recycl
struct  recycl_nv

Public Types

typedef T ClientData
typedef A CapAllocator

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 Member Functions

void gc (Utcb &utcb, A *obj)
 Garbage collect - remove clients which are marked for removal.
unsigned create_identity (GenericClientData *data, A *obj)
unsigned create_identity (PerCpuIdClientData *data, A *obj)

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>
typedef A ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::CapAllocator
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
typedef T ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::ClientData

Constructor & Destructor Documentation

template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::ClientDataStorage ( )
inline

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
utcbUTCB
[out]dataAllocated client data
pseudonymPseudonym that the client used to identify to us
objCapAllocator
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>
void ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::cleanup_clients ( Utcb utcb,
A *  obj 
)
inline

Find all dead clients and mark them for removal by gc()

template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
unsigned ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::create_identity ( GenericClientData data,
A *  obj 
)
inlineprivate
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
unsigned ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::create_identity ( PerCpuIdClientData data,
A *  obj 
)
inlineprivate
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>
void ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::gc ( Utcb utcb,
A *  obj 
)
inlineprivate

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>
T* ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::next ( T *  prev = 0)
inline

Iterator.

Member Data Documentation

union { ... }
template<class T, class A, bool free_pseudonym = true, bool __DEBUG__ = false>
T* ClientDataStorage< T, A, free_pseudonym, __DEBUG__ >::_head
private

The documentation for this class was generated from the following file: