Free Electron
Public Member Functions | List of all members
fe::ext::CountedPool< T > Class Template Reference

Pool of Counted elements. More...

#include <CountedPool.h>

Inheritance diagram for fe::ext::CountedPool< T >:
Inheritance graph
[legend]

Public Member Functions

sp< Countedget (void)
 

Detailed Description

template<class T>
class fe::ext::CountedPool< T >

Pool of Counted elements.

The templated type needs to provide a reset(void) method to facilitate reuse of objects (when they are only referenced by this container).

The class is designed to be declared mutable and as such still be functional as a member of a const object. Objects of this class are non-locking thread-safe by the use of thread specific pointers. Each thread accesses an independant pool.

If thread specific pointers are not deemed available or reliable, this object may devolve to simple new() allocation. For example, boost::thread_specific_ptr can throw thread_resource_error if threading is not in use. This is caught by CountedPool which will degenerate into no pooling.


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