carl  24.04
Computer ARithmetic Library
carl::pool::Pool< Content > Class Template Reference

#include <Pool.h>

Inheritance diagram for carl::pool::Pool< Content >:
Collaboration diagram for carl::pool::Pool< Content >:

Data Structures

struct  content_equal
 
struct  content_hash
 

Public Member Functions

 ~Pool ()
 
template<typename Key >
std::shared_ptr< PoolElementWrapper< Content > > add (Key &&c)
 

Static Public Member Functions

static Pool< Content > & getInstance ()
 Returns the single instance of this class by reference. More...
 

Protected Member Functions

 Pool (std::size_t _capacity=1000)
 
void free (const PoolElementWrapper< Content > *c)
 

Private Types

using UnderlyingSet = boost::intrusive::unordered_set< PoolElementWrapper< Content > >
 

Private Member Functions

void check_rehash ()
 

Private Attributes

friend Singleton< Pool< Content > >
 
friend PoolElementWrapper< Content >
 
IDPool m_ids
 id allocator More...
 
pool::RehashPolicy m_rehash_policy
 
std::unique_ptr< typename UnderlyingSet::bucket_type[]> m_pool_buckets
 
UnderlyingSet m_pool
 The pool. More...
 

Detailed Description

template<class Content>
class carl::pool::Pool< Content >

Definition at line 51 of file Pool.h.

Member Typedef Documentation

◆ UnderlyingSet

template<class Content >
using carl::pool::Pool< Content >::UnderlyingSet = boost::intrusive::unordered_set<PoolElementWrapper<Content> >
private

Definition at line 78 of file Pool.h.

Constructor & Destructor Documentation

◆ Pool()

template<class Content >
carl::pool::Pool< Content >::Pool ( std::size_t  _capacity = 1000)
inlineexplicitprotected

Definition at line 106 of file Pool.h.

Here is the call graph for this function:

◆ ~Pool()

template<class Content >
carl::pool::Pool< Content >::~Pool ( )
inline

Definition at line 115 of file Pool.h.

Member Function Documentation

◆ add()

template<class Content >
template<typename Key >
std::shared_ptr<PoolElementWrapper<Content> > carl::pool::Pool< Content >::add ( Key &&  c)
inline

Definition at line 118 of file Pool.h.

Here is the call graph for this function:

◆ check_rehash()

template<class Content >
void carl::pool::Pool< Content >::check_rehash ( )
inlineprivate

Definition at line 95 of file Pool.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

template<class Content >
void carl::pool::Pool< Content >::free ( const PoolElementWrapper< Content > *  c)
inlineprotected

Definition at line 137 of file Pool.h.

Here is the call graph for this function:

◆ getInstance()

static Pool< Content > & carl::Singleton< Pool< Content > >::getInstance ( )
inlinestaticinherited

Returns the single instance of this class by reference.

If there is no instance yet, a new one is created.

Definition at line 45 of file Singleton.h.

Field Documentation

◆ m_ids

template<class Content >
IDPool carl::pool::Pool< Content >::m_ids
private

id allocator

Definition at line 75 of file Pool.h.

◆ m_pool

template<class Content >
UnderlyingSet carl::pool::Pool< Content >::m_pool
private

The pool.

Definition at line 81 of file Pool.h.

◆ m_pool_buckets

template<class Content >
std::unique_ptr<typename UnderlyingSet::bucket_type[]> carl::pool::Pool< Content >::m_pool_buckets
private

Definition at line 79 of file Pool.h.

◆ m_rehash_policy

template<class Content >
pool::RehashPolicy carl::pool::Pool< Content >::m_rehash_policy
private

Definition at line 77 of file Pool.h.

◆ PoolElementWrapper< Content >

template<class Content >
friend carl::pool::Pool< Content >::PoolElementWrapper< Content >
private

Definition at line 53 of file Pool.h.

◆ Singleton< Pool< Content > >

template<class Content >
friend carl::pool::Pool< Content >::Singleton< Pool< Content > >
private

Definition at line 52 of file Pool.h.


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