fintp_utils
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FinTP::WorkItemPool< T > Class Template Reference

#include <WorkItemPool.h>

Public Member Functions

 WorkItemPool ()
 
 ~WorkItemPool ()
 
void reservePoolSize (const unsigned int reservedPoolSize) volatile
 
void waitForPoolEmpty (const unsigned int secWait=0) volatile
 
void waitToWrite (pthread_t selfId) volatile
 
void addPoolItem (const string &id, const WorkItem< T > &item) volatile
 
void addUniquePoolItem (const string id, const WorkItem< T > &item) volatile
 
WorkItem< T > getPoolItem (const string id, const bool throwOnError=true) volatile
 
WorkItem< T > getPoolItem (const bool lock=true) volatile
 
WorkItem< T > removePoolItem (const bool lock=true) volatile
 
void erasePoolItem (string id, const bool throwOnError=true) volatile
 
WorkItem< T > removePoolItem (string id, const bool throwOnError=true) volatile
 
void Dump () volatile
 
unsigned int getSize () volatile
 
void SignalAllReaders ()
 
void SignalReaders ()
 
void SignalWriters ()
 
void ShutdownPool ()
 
void ShutdownPoolWriters ()
 
bool IsRunning () const
 

Private Types

typedef pair< string, WorkItem
< T > > 
WorkItemPool_QueuedItemType
 
typedef deque
< WorkItemPool_QueuedItemType
WorkItemPool_QueueType
 
typedef map< pthread_t,
unsigned int > 
WorkItemPool_CounterType
 

Private Member Functions

 WorkItemPool (const WorkItemPool &)
 
WorkItemPooloperator= (const WorkItemPool &)
 

Static Private Member Functions

static void DeleteReserves (void *data)
 

Private Attributes

pthread_key_t ReserveKey
 
bool m_Shutdown
 
volatile WorkItemPool_QueueType m_Pool
 
volatile WorkItemPool_CounterType m_WriterItems
 
pthread_mutex_t PoolSyncMutex
 
pthread_mutex_t ReserveSyncMutex
 
pthread_cond_t PoolReaderBarrier
 
pthread_cond_t PoolWriterBarrier
 

Member Typedef Documentation

template<class T >
typedef map< pthread_t, unsigned int > FinTP::WorkItemPool< T >::WorkItemPool_CounterType
private
template<class T >
typedef pair< string, WorkItem< T > > FinTP::WorkItemPool< T >::WorkItemPool_QueuedItemType
private
template<class T >
typedef deque< WorkItemPool_QueuedItemType > FinTP::WorkItemPool< T >::WorkItemPool_QueueType
private

Constructor & Destructor Documentation

template<class T >
FinTP::WorkItemPool< T >::WorkItemPool ( const WorkItemPool< T > &  )
private
template<class T >
FinTP::WorkItemPool< T >::WorkItemPool ( )
inline
template<class T >
FinTP::WorkItemPool< T >::~WorkItemPool ( )
inline

Member Function Documentation

template<class T >
void FinTP::WorkItemPool< T >::addPoolItem ( const string &  id,
const WorkItem< T > &  item 
) volatile
inline
template<class T >
void FinTP::WorkItemPool< T >::addUniquePoolItem ( const string  id,
const WorkItem< T > &  item 
) volatile
inline
template<class T >
static void FinTP::WorkItemPool< T >::DeleteReserves ( void *  data)
inlinestaticprivate
template<class T >
void FinTP::WorkItemPool< T >::Dump ( ) volatile
inline
template<class T >
void FinTP::WorkItemPool< T >::erasePoolItem ( string  id,
const bool  throwOnError = true 
) volatile
inline
template<class T >
WorkItem< T > FinTP::WorkItemPool< T >::getPoolItem ( const string  id,
const bool  throwOnError = true 
) volatile
inline
template<class T >
WorkItem< T > FinTP::WorkItemPool< T >::getPoolItem ( const bool  lock = true) volatile
inline
template<class T >
unsigned int FinTP::WorkItemPool< T >::getSize ( ) volatile
inline
template<class T >
bool FinTP::WorkItemPool< T >::IsRunning ( ) const
inline
template<class T >
WorkItemPool& FinTP::WorkItemPool< T >::operator= ( const WorkItemPool< T > &  )
private
template<class T >
WorkItem< T > FinTP::WorkItemPool< T >::removePoolItem ( const bool  lock = true) volatile
inline
template<class T >
WorkItem< T > FinTP::WorkItemPool< T >::removePoolItem ( string  id,
const bool  throwOnError = true 
) volatile
inline
template<class T >
void FinTP::WorkItemPool< T >::reservePoolSize ( const unsigned int  reservedPoolSize) volatile
inline
template<class T >
void FinTP::WorkItemPool< T >::ShutdownPool ( )
inline
template<class T >
void FinTP::WorkItemPool< T >::ShutdownPoolWriters ( )
inline
template<class T >
void FinTP::WorkItemPool< T >::SignalAllReaders ( )
inline
template<class T >
void FinTP::WorkItemPool< T >::SignalReaders ( )
inline
template<class T >
void FinTP::WorkItemPool< T >::SignalWriters ( )
inline
template<class T >
void FinTP::WorkItemPool< T >::waitForPoolEmpty ( const unsigned int  secWait = 0) volatile
inline
template<class T >
void FinTP::WorkItemPool< T >::waitToWrite ( pthread_t  selfId) volatile
inline

Member Data Documentation

template<class T >
volatile WorkItemPool_QueueType FinTP::WorkItemPool< T >::m_Pool
private
template<class T >
bool FinTP::WorkItemPool< T >::m_Shutdown
private
template<class T >
volatile WorkItemPool_CounterType FinTP::WorkItemPool< T >::m_WriterItems
private
template<class T >
pthread_cond_t FinTP::WorkItemPool< T >::PoolReaderBarrier
private
template<class T >
pthread_mutex_t FinTP::WorkItemPool< T >::PoolSyncMutex
private
template<class T >
pthread_cond_t FinTP::WorkItemPool< T >::PoolWriterBarrier
private
template<class T >
pthread_key_t FinTP::WorkItemPool< T >::ReserveKey
private
template<class T >
pthread_mutex_t FinTP::WorkItemPool< T >::ReserveSyncMutex
private

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