Originally From https://stackoverflow.com/a/27837534/2042320. More...
#include <SharedPool.h>
Classes | |
struct | ExternalDeleter |
Public Types | |
typedef std::unique_ptr< T, ExternalDeleter > | PtrType |
Public Member Functions | |
SharedPool () | |
virtual | ~SharedPool () |
void | add (std::unique_ptr< T > t) |
template<typename... Args> | |
PtrType | acquire (Args &&... args) |
bool | empty () const |
size_t | size () const |
size_t | num_created () const |
Private Attributes | |
std::shared_ptr< SharedPool< T > * > | _this_ptr |
std::stack< std::unique_ptr< T > > | _pool |
size_t | _num_created = 0 |
Originally From https://stackoverflow.com/a/27837534/2042320.
friedmud added variadic templated perfect forwarding to acquire()
For an object to be resetable it needs to define a reset() function that takes the same arguments as its constructor.
Definition at line 42 of file SharedPool.h.
typedef std::unique_ptr<T, ExternalDeleter> MooseUtils::SharedPool< T >::PtrType |
Definition at line 70 of file SharedPool.h.
|
inline |
Definition at line 72 of file SharedPool.h.
|
inlinevirtual |
Definition at line 73 of file SharedPool.h.
|
inline |
Definition at line 78 of file SharedPool.h.
|
inline |
Definition at line 75 of file SharedPool.h.
Referenced by MooseUtils::SharedPool< T >::ExternalDeleter::operator()().
|
inline |
Definition at line 99 of file SharedPool.h.
|
inline |
Definition at line 103 of file SharedPool.h.
|
inline |
Definition at line 101 of file SharedPool.h.
|
private |
Definition at line 109 of file SharedPool.h.
Referenced by MooseUtils::SharedPool< T >::acquire(), and MooseUtils::SharedPool< T >::num_created().
|
private |
Definition at line 107 of file SharedPool.h.
Referenced by MooseUtils::SharedPool< T >::acquire(), MooseUtils::SharedPool< T >::add(), MooseUtils::SharedPool< T >::empty(), and MooseUtils::SharedPool< T >::size().
|
private |
Definition at line 106 of file SharedPool.h.
Referenced by MooseUtils::SharedPool< T >::acquire().