mCRL2
Loading...
Searching...
No Matches
mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE > Class Template Reference

#include <liblts_bisim_dnj.h>

Classes

class  pool_block_t
 

Public Member Functions

 my_pool ()
 constructor
 
 ~my_pool ()
 destructor
 
template<class U , class... Args>
U * construct (Args &&... args)
 allocate and construct a new element (of any type)
 
template<class U >
void destroy (U *const old_el)
 destroy and delete some element
 

Private Member Functions

template<class U , class... Args>
U * construct_samesize (Args &&... args)
 allocate and construct a new element of the same size as the free list
 
template<class U , class... Args>
U * construct_othersize (Args &&... args)
 allocate and construct a new element of a size that doesn't fit the free list
 

Static Private Member Functions

static void *& deref_void (void *addr)
 

Private Attributes

pool_block_tfirst_block
 first chunk in list of chunks
 
void * begin_used_in_first_block
 start of part in the first chunk that is already in use
 
void * first_free_T
 first freed element
 

Detailed Description

template<class T, size_t BLOCKSIZE = 1000>
class mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >

Definition at line 216 of file liblts_bisim_dnj.h.

Constructor & Destructor Documentation

◆ my_pool()

template<class T , size_t BLOCKSIZE = 1000>
mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::my_pool ( )
inline

constructor

Definition at line 246 of file liblts_bisim_dnj.h.

◆ ~my_pool()

template<class T , size_t BLOCKSIZE = 1000>
mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::~my_pool ( )
inline

destructor

Definition at line 255 of file liblts_bisim_dnj.h.

Member Function Documentation

◆ construct()

template<class T , size_t BLOCKSIZE = 1000>
template<class U , class... Args>
U * mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::construct ( Args &&...  args)
inline

allocate and construct a new element (of any type)

Definition at line 347 of file liblts_bisim_dnj.h.

◆ construct_othersize()

template<class T , size_t BLOCKSIZE = 1000>
template<class U , class... Args>
U * mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::construct_othersize ( Args &&...  args)
inlineprivate

allocate and construct a new element of a size that doesn't fit the free list

Definition at line 302 of file liblts_bisim_dnj.h.

◆ construct_samesize()

template<class T , size_t BLOCKSIZE = 1000>
template<class U , class... Args>
U * mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::construct_samesize ( Args &&...  args)
inlineprivate

allocate and construct a new element of the same size as the free list

Definition at line 272 of file liblts_bisim_dnj.h.

◆ deref_void()

template<class T , size_t BLOCKSIZE = 1000>
static void *& mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::deref_void ( void *  addr)
inlinestaticprivate

Definition at line 240 of file liblts_bisim_dnj.h.

◆ destroy()

template<class T , size_t BLOCKSIZE = 1000>
template<class U >
void mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::destroy ( U *const  old_el)
inline

destroy and delete some element

destroy() is only allowed if the destructor of U is trivial. This ensures that in my_pool::~my_pool() we do not have to test whether some element has been freed before we destroy it. Also, the size of U has to be the same size as the size of T, so each entry in the free list has the same size.

Definition at line 367 of file liblts_bisim_dnj.h.

Member Data Documentation

◆ begin_used_in_first_block

template<class T , size_t BLOCKSIZE = 1000>
void* mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::begin_used_in_first_block
private

start of part in the first chunk that is already in use

Definition at line 235 of file liblts_bisim_dnj.h.

◆ first_block

template<class T , size_t BLOCKSIZE = 1000>
pool_block_t* mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::first_block
private

first chunk in list of chunks

All chunks except the first one are completely in use.

Definition at line 232 of file liblts_bisim_dnj.h.

◆ first_free_T

template<class T , size_t BLOCKSIZE = 1000>
void* mcrl2::lts::detail::bisim_dnj::my_pool< T, BLOCKSIZE >::first_free_T
private

first freed element

Definition at line 238 of file liblts_bisim_dnj.h.


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