SheafSystem  0.0.0.0
sheaf::list_pool< T > Class Template Reference

A reallocated pool of objects of type T. Objects in the pool are either allocated or stored in a free list. The object allocated by the pool are tracked. Intended to support efficient allocation and deallocation for small numbers of objects. More...

#include <list_pool.h>

Friends

size_t deep_size (const list_pool< T > &xpool, bool xinclude_shallow)
 The deep size of the referenced object of type list_pool. More...
 

LIST_POOL FACET

typedef unsigned long int size_type
 An unsigned integral type used to represent sizes and capacities. More...
 
 list_pool ()
 Default constructor. More...
 
virtual ~list_pool ()
 Destructor. More...
 
T & get ()
 Allocates an object of type T from this pool. More...
 
void release (T &xobj)
 Return the object xobj to the free list of this pool. More...
 
bool allocated (const T &xobj) const
 True if and only if this pool allocated object xobj. More...
 
size_type ct () const
 

Detailed Description

template<typename T>
class sheaf::list_pool< T >

A reallocated pool of objects of type T. Objects in the pool are either allocated or stored in a free list. The object allocated by the pool are tracked. Intended to support efficient allocation and deallocation for small numbers of objects.

Definition at line 42 of file list_pool.h.

Member Typedef Documentation

◆ size_type

template<typename T>
typedef unsigned long int sheaf::list_pool< T >::size_type

An unsigned integral type used to represent sizes and capacities.

Definition at line 94 of file list_pool.h.

Constructor & Destructor Documentation

◆ list_pool()

template<typename T >
sheaf::list_pool< T >::list_pool ( )

Default constructor.

Definition at line 47 of file list_pool.impl.h.

◆ ~list_pool()

template<typename T >
sheaf::list_pool< T >::~list_pool ( )
virtual

Destructor.

Postcondition
  • -unexecutable( "All allocated objects have been deleted." )

Definition at line 62 of file list_pool.impl.h.

Referenced by sheaf::list_pool< fiber_bundle::ijk_adjacency_implicit_index_space_iterator >::list_pool().

Member Function Documentation

◆ allocated()

template<typename T>
bool sheaf::list_pool< T >::allocated ( const T &  xobj) const

True if and only if this pool allocated object xobj.

Postcondition
  • is_basic_query

Definition at line 157 of file list_pool.impl.h.

Referenced by sheaf::list_pool< fiber_bundle::ijk_adjacency_implicit_index_space_iterator >::release().

◆ ct()

template<typename T >
list_pool< T >::size_type sheaf::list_pool< T >::ct ( ) const
Postcondition
  • result >= 0

Definition at line 179 of file list_pool.impl.h.

Referenced by sheaf::list_pool< fiber_bundle::ijk_adjacency_implicit_index_space_iterator >::allocated().

◆ get()

template<typename T >
T & sheaf::list_pool< T >::get ( )

Allocates an object of type T from this pool.

Postcondition
  • allocated(*result)

Definition at line 97 of file list_pool.impl.h.

Referenced by sheaf::list_pool< fiber_bundle::ijk_adjacency_implicit_index_space_iterator >::~list_pool().

◆ release()

template<typename T>
void sheaf::list_pool< T >::release ( T &  xobj)

Return the object xobj to the free list of this pool.

Precondition
  • allocated(xobj)
Postcondition
  • is_basic_query

Definition at line 135 of file list_pool.impl.h.

Referenced by sheaf::list_pool< fiber_bundle::ijk_adjacency_implicit_index_space_iterator >::get().

Friends And Related Function Documentation

◆ deep_size

template<typename T>
size_t deep_size ( const list_pool< T > &  xpool,
bool  xinclude_shallow 
)
friend

The deep size of the referenced object of type list_pool.

Definition at line 206 of file list_pool.impl.h.


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