1#ifndef DATAMODEL_DATAPOOL_H
2#define DATAMODEL_DATAPOOL_H
17#ifndef GAUDIKERNEL_SYSTEM_H
18# include "GaudiKernel/System.h"
20#ifndef INTERFACES_IINCIDENTSVC_H
21# include "GaudiKernel/IIncidentSvc.h"
23#ifndef KERNEL_STATUSCODES_H
24# include "GaudiKernel/StatusCode.h"
26#ifndef GAUDIKERNEL_IINCIDENTLISTENER_H
27# include "GaudiKernel/IIncidentListener.h"
30template <
typename VALUE>
class DataPool :
virtual public IIncidentListener {
32 typedef std::vector<VALUE*>
Pool;
63 unsigned int capacity() {
return m_pool.capacity(); }
99 virtual StatusCode
queryInterface(
const InterfaceID& riid,
void** ppvInterface );
115 static const unsigned int m_minRefCount = 1024;
118 unsigned int m_maxRefCount;
121 unsigned int m_refCount;
127 IIncidentSvc* m_pIncSvc;
130 unsigned long m_instanceCount;
133#include "DataModel/DataPool.icc"
reference nextElementRef()
iterator begin()
begin iterators over pool
Pool::size_type size_type
static const std::string & typeName()
typename of pool
virtual unsigned long addRef()
methods to adhere to IInterface:
const_iterator end() const
void handle(const Incident &)
incident service handle
virtual unsigned long release()
std::vector< VALUE * > Pool
unsigned int capacity()
return capacity of pool
Pool::const_iterator const_iterator
void initialize()
initialization
unsigned int allocated()
return size already allocated
void reset()
reset refCount... but not maxRefCount.
void resizePool()
resize pool if usage exceeds capacity:
void erase()
erase the pool and initializes m_minRefCount default elements
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
Pool::reference reference
const_iterator begin() const
void setSize(unsigned int size)
set size of pool: