BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DataPool< VALUE > Class Template Reference

a typed memory pool that saves time spent allocation small object. This is typically used by container such as DataVector and DataList More...

#include <DataPool.h>

Inheritance diagram for DataPool< VALUE >:

Public Types

typedef std::vector< VALUE * > Pool
typedef Pool::size_type size_type
typedef Pool::pointer pointer
typedef Pool::reference reference
typedef Pool::iterator iterator
typedef Pool::const_iterator const_iterator
typedef std::vector< VALUE * > Pool
typedef Pool::size_type size_type
typedef Pool::pointer pointer
typedef Pool::reference reference
typedef Pool::iterator iterator
typedef Pool::const_iterator const_iterator
typedef std::vector< VALUE * > Pool
typedef Pool::size_type size_type
typedef Pool::pointer pointer
typedef Pool::reference reference
typedef Pool::iterator iterator
typedef Pool::const_iterator const_iterator

Public Member Functions

 DataPool ()
 Constructors:
 DataPool (size_type n)
 DataPool (int n)
virtual ~DataPool ()
void setSize (unsigned int size)
 set size of pool:
void reset ()
 reset refCount... but not maxRefCount.
void erase ()
 erase the pool and initializes m_minRefCount default elements
unsigned int capacity ()
 return capacity of pool
unsigned int allocated ()
 return size already allocated
iterator begin ()
 begin iterators over pool
const_iterator begin () const
iterator end ()
const_iterator end () const
void * mem ()
void * operator() ()
void initialize ()
 initialization
void handle (const Incident &)
 incident service handle
virtual unsigned long addRef ()
 methods to adhere to IInterface:
virtual unsigned long release ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 DataPool ()
 Constructors:
 DataPool (size_type n)
 DataPool (int n)
virtual ~DataPool ()
void setSize (unsigned int size)
 set size of pool:
void reset ()
 reset refCount... but not maxRefCount.
void erase ()
 erase the pool and initializes m_minRefCount default elements
unsigned int capacity ()
 return capacity of pool
unsigned int allocated ()
 return size already allocated
iterator begin ()
 begin iterators over pool
const_iterator begin () const
iterator end ()
const_iterator end () const
void * mem ()
void * operator() ()
void initialize ()
 initialization
void handle (const Incident &)
 incident service handle
virtual unsigned long addRef ()
 methods to adhere to IInterface:
virtual unsigned long release ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 DataPool ()
 Constructors:
 DataPool (size_type n)
 DataPool (int n)
virtual ~DataPool ()
void setSize (unsigned int size)
 set size of pool:
void reset ()
 reset refCount... but not maxRefCount.
void erase ()
 erase the pool and initializes m_minRefCount default elements
unsigned int capacity ()
 return capacity of pool
unsigned int allocated ()
 return size already allocated
iterator begin ()
 begin iterators over pool
const_iterator begin () const
iterator end ()
const_iterator end () const
void * mem ()
void * operator() ()
void initialize ()
 initialization
void handle (const Incident &)
 incident service handle
virtual unsigned long addRef ()
 methods to adhere to IInterface:
virtual unsigned long release ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)

Static Public Member Functions

static const std::string & typeName ()
 typename of pool
static const std::string & typeName ()
 typename of pool
static const std::string & typeName ()
 typename of pool

Protected Member Functions

reference nextElementRef ()
void resizePool ()
 resize pool if usage exceeds capacity:
reference nextElementRef ()
void resizePool ()
 resize pool if usage exceeds capacity:
reference nextElementRef ()
void resizePool ()
 resize pool if usage exceeds capacity:

Detailed Description

template<typename VALUE>
class DataPool< VALUE >

a typed memory pool that saves time spent allocation small object. This is typically used by container such as DataVector and DataList

Author
Srini Rajagopalan - ATLAS Collaboration
Id
DataPool.h,v 1.5 2003/08/19 23:52:06 calaf Exp

Definition at line 30 of file Event/GeneratorObject/include/DataModel/DataPool.h.

Member Typedef Documentation

◆ const_iterator [1/3]

template<typename VALUE>
typedef Pool::const_iterator DataPool< VALUE >::const_iterator

◆ const_iterator [2/3]

template<typename VALUE>
typedef Pool::const_iterator DataPool< VALUE >::const_iterator

◆ const_iterator [3/3]

template<typename VALUE>
typedef Pool::const_iterator DataPool< VALUE >::const_iterator

◆ iterator [1/3]

template<typename VALUE>
typedef Pool::iterator DataPool< VALUE >::iterator

◆ iterator [2/3]

template<typename VALUE>
typedef Pool::iterator DataPool< VALUE >::iterator

◆ iterator [3/3]

template<typename VALUE>
typedef Pool::iterator DataPool< VALUE >::iterator

◆ pointer [1/3]

template<typename VALUE>
typedef Pool::pointer DataPool< VALUE >::pointer

◆ pointer [2/3]

template<typename VALUE>
typedef Pool::pointer DataPool< VALUE >::pointer

◆ pointer [3/3]

template<typename VALUE>
typedef Pool::pointer DataPool< VALUE >::pointer

◆ Pool [1/3]

template<typename VALUE>
typedef std::vector<VALUE*> DataPool< VALUE >::Pool

◆ Pool [2/3]

template<typename VALUE>
typedef std::vector<VALUE*> DataPool< VALUE >::Pool

◆ Pool [3/3]

template<typename VALUE>
typedef std::vector<VALUE*> DataPool< VALUE >::Pool

◆ reference [1/3]

template<typename VALUE>
typedef Pool::reference DataPool< VALUE >::reference

◆ reference [2/3]

template<typename VALUE>
typedef Pool::reference DataPool< VALUE >::reference

◆ reference [3/3]

template<typename VALUE>
typedef Pool::reference DataPool< VALUE >::reference

◆ size_type [1/3]

template<typename VALUE>
typedef Pool::size_type DataPool< VALUE >::size_type

◆ size_type [2/3]

template<typename VALUE>
typedef Pool::size_type DataPool< VALUE >::size_type

◆ size_type [3/3]

template<typename VALUE>
typedef Pool::size_type DataPool< VALUE >::size_type

Constructor & Destructor Documentation

◆ DataPool() [1/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( )

Constructors:

default constructor will initialize the pool with m_minRefCount

◆ DataPool() [2/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( size_type n)

◆ DataPool() [3/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( int n)

◆ ~DataPool() [1/3]

template<typename VALUE>
virtual DataPool< VALUE >::~DataPool ( )
virtual

◆ DataPool() [4/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( )

Constructors:

default constructor will initialize the pool with m_minRefCount

◆ DataPool() [5/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( size_type n)

◆ DataPool() [6/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( int n)

◆ ~DataPool() [2/3]

template<typename VALUE>
virtual DataPool< VALUE >::~DataPool ( )
virtual

◆ DataPool() [7/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( )

Constructors:

default constructor will initialize the pool with m_minRefCount

◆ DataPool() [8/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( size_type n)

◆ DataPool() [9/9]

template<typename VALUE>
DataPool< VALUE >::DataPool ( int n)

◆ ~DataPool() [3/3]

template<typename VALUE>
virtual DataPool< VALUE >::~DataPool ( )
virtual

Member Function Documentation

◆ addRef() [1/3]

template<typename VALUE>
virtual unsigned long DataPool< VALUE >::addRef ( )
virtual

methods to adhere to IInterface:

◆ addRef() [2/3]

template<typename VALUE>
virtual unsigned long DataPool< VALUE >::addRef ( )
virtual

methods to adhere to IInterface:

◆ addRef() [3/3]

template<typename VALUE>
virtual unsigned long DataPool< VALUE >::addRef ( )
virtual

methods to adhere to IInterface:

◆ allocated() [1/3]

template<typename VALUE>
unsigned int DataPool< VALUE >::allocated ( )
inline

return size already allocated

Definition at line 66 of file Event/GeneratorObject/include/DataModel/DataPool.h.

66{ return m_refCount; }

◆ allocated() [2/3]

template<typename VALUE>
unsigned int DataPool< VALUE >::allocated ( )
inline

return size already allocated

Definition at line 66 of file InstallArea/x86_64-el9-gcc13-dbg/include/DataModel/DataPool.h.

66{ return m_refCount; }

◆ allocated() [3/3]

template<typename VALUE>
unsigned int DataPool< VALUE >::allocated ( )
inline

return size already allocated

Definition at line 66 of file InstallArea/x86_64-el9-gcc13-opt/include/DataModel/DataPool.h.

66{ return m_refCount; }

◆ begin() [1/6]

template<typename VALUE>
iterator DataPool< VALUE >::begin ( )

begin iterators over pool

◆ begin() [2/6]

template<typename VALUE>
iterator DataPool< VALUE >::begin ( )

begin iterators over pool

◆ begin() [3/6]

template<typename VALUE>
iterator DataPool< VALUE >::begin ( )

begin iterators over pool

◆ begin() [4/6]

template<typename VALUE>
const_iterator DataPool< VALUE >::begin ( ) const

◆ begin() [5/6]

template<typename VALUE>
const_iterator DataPool< VALUE >::begin ( ) const

◆ begin() [6/6]

template<typename VALUE>
const_iterator DataPool< VALUE >::begin ( ) const

◆ capacity() [1/3]

template<typename VALUE>
unsigned int DataPool< VALUE >::capacity ( )
inline

return capacity of pool

Definition at line 63 of file Event/GeneratorObject/include/DataModel/DataPool.h.

63{ return m_pool.capacity(); }

◆ capacity() [2/3]

template<typename VALUE>
unsigned int DataPool< VALUE >::capacity ( )
inline

return capacity of pool

Definition at line 63 of file InstallArea/x86_64-el9-gcc13-dbg/include/DataModel/DataPool.h.

63{ return m_pool.capacity(); }

◆ capacity() [3/3]

template<typename VALUE>
unsigned int DataPool< VALUE >::capacity ( )
inline

return capacity of pool

Definition at line 63 of file InstallArea/x86_64-el9-gcc13-opt/include/DataModel/DataPool.h.

63{ return m_pool.capacity(); }

◆ end() [1/6]

template<typename VALUE>
iterator DataPool< VALUE >::end ( )

the end() method will allow looping over only valid elements and not over ALL elements of the pool

◆ end() [2/6]

template<typename VALUE>
iterator DataPool< VALUE >::end ( )

the end() method will allow looping over only valid elements and not over ALL elements of the pool

◆ end() [3/6]

template<typename VALUE>
iterator DataPool< VALUE >::end ( )

the end() method will allow looping over only valid elements and not over ALL elements of the pool

◆ end() [4/6]

template<typename VALUE>
const_iterator DataPool< VALUE >::end ( ) const

◆ end() [5/6]

template<typename VALUE>
const_iterator DataPool< VALUE >::end ( ) const

◆ end() [6/6]

template<typename VALUE>
const_iterator DataPool< VALUE >::end ( ) const

◆ erase() [1/3]

template<typename VALUE>
void DataPool< VALUE >::erase ( )

erase the pool and initializes m_minRefCount default elements

◆ erase() [2/3]

template<typename VALUE>
void DataPool< VALUE >::erase ( )

erase the pool and initializes m_minRefCount default elements

◆ erase() [3/3]

template<typename VALUE>
void DataPool< VALUE >::erase ( )

erase the pool and initializes m_minRefCount default elements

◆ handle() [1/3]

template<typename VALUE>
void DataPool< VALUE >::handle ( const Incident & )

incident service handle

◆ handle() [2/3]

template<typename VALUE>
void DataPool< VALUE >::handle ( const Incident & )

incident service handle

◆ handle() [3/3]

template<typename VALUE>
void DataPool< VALUE >::handle ( const Incident & )

incident service handle

◆ initialize() [1/3]

template<typename VALUE>
void DataPool< VALUE >::initialize ( )

initialization

◆ initialize() [2/3]

template<typename VALUE>
void DataPool< VALUE >::initialize ( )

initialization

◆ initialize() [3/3]

template<typename VALUE>
void DataPool< VALUE >::initialize ( )

initialization

◆ mem() [1/3]

template<typename VALUE>
void * DataPool< VALUE >::mem ( )

obtain the next available element in pool by pointer return as void* to minimize misuse, client usage is: MyElement* m = new(pool->mem) MyElement(...); // pool is ptr

◆ mem() [2/3]

template<typename VALUE>
void * DataPool< VALUE >::mem ( )

obtain the next available element in pool by pointer return as void* to minimize misuse, client usage is: MyElement* m = new(pool->mem) MyElement(...); // pool is ptr

◆ mem() [3/3]

template<typename VALUE>
void * DataPool< VALUE >::mem ( )

obtain the next available element in pool by pointer return as void* to minimize misuse, client usage is: MyElement* m = new(pool->mem) MyElement(...); // pool is ptr

◆ nextElementRef() [1/3]

template<typename VALUE>
reference DataPool< VALUE >::nextElementRef ( )
protected

should we allow clients to get a reference? obtain the next available element in pool by reference pool is resized if reached its limit

◆ nextElementRef() [2/3]

template<typename VALUE>
reference DataPool< VALUE >::nextElementRef ( )
protected

should we allow clients to get a reference? obtain the next available element in pool by reference pool is resized if reached its limit

◆ nextElementRef() [3/3]

template<typename VALUE>
reference DataPool< VALUE >::nextElementRef ( )
protected

should we allow clients to get a reference? obtain the next available element in pool by reference pool is resized if reached its limit

◆ operator()() [1/3]

template<typename VALUE>
void * DataPool< VALUE >::operator() ( )

can also say: MyElement* m = new ((pool)()) MyElement(...); // pool = pointer MyElement m = new (pool()) MyElement(...); // pool = value

◆ operator()() [2/3]

template<typename VALUE>
void * DataPool< VALUE >::operator() ( )

can also say: MyElement* m = new ((pool)()) MyElement(...); // pool = pointer MyElement m = new (pool()) MyElement(...); // pool = value

◆ operator()() [3/3]

template<typename VALUE>
void * DataPool< VALUE >::operator() ( )

can also say: MyElement* m = new ((pool)()) MyElement(...); // pool = pointer MyElement m = new (pool()) MyElement(...); // pool = value

◆ queryInterface() [1/3]

template<typename VALUE>
virtual StatusCode DataPool< VALUE >::queryInterface ( const InterfaceID & riid,
void ** ppvInterface )
virtual

◆ queryInterface() [2/3]

template<typename VALUE>
virtual StatusCode DataPool< VALUE >::queryInterface ( const InterfaceID & riid,
void ** ppvInterface )
virtual

◆ queryInterface() [3/3]

template<typename VALUE>
virtual StatusCode DataPool< VALUE >::queryInterface ( const InterfaceID & riid,
void ** ppvInterface )
virtual

◆ release() [1/3]

template<typename VALUE>
virtual unsigned long DataPool< VALUE >::release ( )
virtual

◆ release() [2/3]

template<typename VALUE>
virtual unsigned long DataPool< VALUE >::release ( )
virtual

◆ release() [3/3]

template<typename VALUE>
virtual unsigned long DataPool< VALUE >::release ( )
virtual

◆ reset() [1/3]

template<typename VALUE>
void DataPool< VALUE >::reset ( )

reset refCount... but not maxRefCount.

◆ reset() [2/3]

template<typename VALUE>
void DataPool< VALUE >::reset ( )

reset refCount... but not maxRefCount.

◆ reset() [3/3]

template<typename VALUE>
void DataPool< VALUE >::reset ( )

reset refCount... but not maxRefCount.

◆ resizePool() [1/3]

template<typename VALUE>
void DataPool< VALUE >::resizePool ( )
protected

resize pool if usage exceeds capacity:

◆ resizePool() [2/3]

template<typename VALUE>
void DataPool< VALUE >::resizePool ( )
protected

resize pool if usage exceeds capacity:

◆ resizePool() [3/3]

template<typename VALUE>
void DataPool< VALUE >::resizePool ( )
protected

resize pool if usage exceeds capacity:

◆ setSize() [1/3]

template<typename VALUE>
void DataPool< VALUE >::setSize ( unsigned int size)

set size of pool:

◆ setSize() [2/3]

template<typename VALUE>
void DataPool< VALUE >::setSize ( unsigned int size)

set size of pool:

◆ setSize() [3/3]

template<typename VALUE>
void DataPool< VALUE >::setSize ( unsigned int size)

set size of pool:

◆ typeName() [1/3]

template<typename VALUE>
const std::string & DataPool< VALUE >::typeName ( )
static

typename of pool

◆ typeName() [2/3]

template<typename VALUE>
const std::string & DataPool< VALUE >::typeName ( )
static

typename of pool

◆ typeName() [3/3]

template<typename VALUE>
const std::string & DataPool< VALUE >::typeName ( )
static

typename of pool


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