B2BITS FIX Antenna HFT  1.0.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Enumerations | Functions | Variables
object_pool.h File Reference
#include <concurrent_list.h>
#include <bilist.h>
#include <stdexcept>
+ Include dependency graph for object_pool.h:
+ This graph shows which files directly or indirectly include this file:

Classes

struct  ObjPoolBiListElem< ElemT >
 
struct  ObjPoolElem< ElemT >
 

Typedefs

typedef unsigned obj_idx_t
 

Enumerations

enum  ObjPoolGrowStrategy { NoGrowth, GrowByAllocNewElements, GrowByAllocNewPool }
 

Functions

template<class ElemT >
struct __attribute__ ((aligned(64))) object_pool
 
ElemT * get_object (obj_idx_t *obj_idx=NULL)
 
ElemT * get_object_nolock (obj_idx_t *obj_idx)
 
ElemT * get_object_NOLOCK (obj_idx_t *obj_idx)
 
ElemT * get_object_slave ()
 
ElemT * get_object_slave_NOLOCK ()
 
ElemT * getObjectByIdx (obj_idx_t idx)
 
int idxOf (ElemT *elem)
 
void init (int staticPoolObjcount, enum ObjPoolGrowStrategy growStrategy)
 
bool isSlave ()
 
 object_pool (object_pool< ElemT > *master)
 
void reset ()
 
void return_object (ElemT *elem)
 
void return_object_NOLOCK (ElemT *elem)
 
bool return_object_slave (ElemT *elem)
 
bool return_object_slave_NOLOCK (ElemT *elem)
 
 ~object_pool ()
 

Variables

object_pool< ElemT > *volatile curr_
 
ElemT * elems_
 
enum ObjPoolGrowStrategy growStrategy_
 
object_pool< ElemT > * master_
 
bilist< object_pool< ElemT > > poolChain_
 
unsigned staticPoolSize_
 

Typedef Documentation

typedef unsigned obj_idx_t

Enumeration Type Documentation

Enumerator
NoGrowth 
GrowByAllocNewElements 
GrowByAllocNewPool 

Function Documentation

template<class ElemT >
struct __attribute__ ( (aligned(64))  )

References curr_, elems_, master_, and object_pool().

ElemT* get_object ( obj_idx_t obj_idx = NULL)
ElemT* get_object_nolock ( obj_idx_t obj_idx)
ElemT* get_object_NOLOCK ( obj_idx_t obj_idx)
ElemT* get_object_slave ( )
ElemT* get_object_slave_NOLOCK ( )
ElemT* getObjectByIdx ( obj_idx_t  idx)
int idxOf ( ElemT *  elem)

References elems_, and staticPoolSize_.

void init ( int  staticPoolObjcount,
enum ObjPoolGrowStrategy  growStrategy 
)
bool isSlave ( )
inline

References master_.

Referenced by return_object(), and return_object_NOLOCK().

object_pool ( object_pool< ElemT > *  master)
explicit

Referenced by __attribute__().

void reset ( )
void return_object ( ElemT *  elem)
void return_object_NOLOCK ( ElemT *  elem)
bool return_object_slave ( ElemT *  elem)
bool return_object_slave_NOLOCK ( ElemT *  elem)

References elems_, and poolChain_.

Variable Documentation

object_pool< ElemT >* volatile curr_
ElemT* elems_
enum ObjPoolGrowStrategy growStrategy_
object_pool< ElemT >* master_
bilist< object_pool< ElemT > > poolChain_
unsigned staticPoolSize_