Public Member Functions | |
DiscreteStencilWeightPool (std::size_t capacity=128) | |
std::size_t | capacity () const |
void | clear (bool release) |
weight_t | retrieve () |
std::size_t | size () const |
void | store (std::vector< weight_t > *weights) |
void | store (weight_t &&weight) |
Definition at line 37 of file stencil_weight.hpp.
bitpit::DiscreteStencilWeightPool< weight_t >::DiscreteStencilWeightPool | ( | std::size_t | capacity = 128 | ) |
Constructor.
capacity | is the maximum number of weights that can be stored in the pool |
Definition at line 37 of file stencil_weight.tpp.
std::size_t bitpit::DiscreteStencilWeightPool< weight_t >::capacity | ( | ) | const |
Get the capacity of the pool.
The capacity represents the maximum number of weights that can be stored in the pool.
size | The capacity of the pool. |
Definition at line 64 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightPool< weight_t >::clear | ( | bool | release | ) |
Clear the pool.
Removes all weights from the pool (which are destroyed), leaving it with a size of 0.
release | if it's true the memory hold by the pool will be released, otherwise the pool will be cleared but its memory will not be relased |
Definition at line 80 of file stencil_weight.tpp.
weight_t bitpit::DiscreteStencilWeightPool< weight_t >::retrieve | ( | ) |
Retrieve a weight from the pool.
If the pool is empty, an exception is thrown.
Definition at line 96 of file stencil_weight.tpp.
std::size_t bitpit::DiscreteStencilWeightPool< weight_t >::size | ( | ) | const |
Get the size of the pool.
The size represents the number of weights currently stored in the pool.
size | The size of the pool. |
Definition at line 50 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightPool< weight_t >::store | ( | std::vector< weight_t > * | weights | ) |
Store the given weights in the pool.
weights | are the weight that will be stored in the pool |
Definition at line 129 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightPool< weight_t >::store | ( | weight_t && | weight | ) |
Store the given weight in the pool.
weight | is the weight that will be stored in the pool |
Definition at line 114 of file stencil_weight.tpp.