Loading...
Searching...
No Matches
Public Member Functions | List of all members
bitpit::DiscreteStencilWeightPool< weight_t > Class Template Reference

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)
 

Detailed Description

template<typename weight_t>
class bitpit::DiscreteStencilWeightPool< weight_t >

Definition at line 37 of file stencil_weight.hpp.

Constructor & Destructor Documentation

◆ DiscreteStencilWeightPool()

template<typename weight_t >
bitpit::DiscreteStencilWeightPool< weight_t >::DiscreteStencilWeightPool ( std::size_t capacity = 128)

Constructor.

Parameters
capacityis the maximum number of weights that can be stored in the pool

Definition at line 37 of file stencil_weight.tpp.

Member Function Documentation

◆ capacity()

template<typename weight_t >
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.

Parameters
sizeThe capacity of the pool.

Definition at line 64 of file stencil_weight.tpp.

◆ clear()

template<typename weight_t >
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.

Parameters
releaseif 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.

◆ retrieve()

template<typename weight_t >
weight_t bitpit::DiscreteStencilWeightPool< weight_t >::retrieve ( )

Retrieve a weight from the pool.

If the pool is empty, an exception is thrown.

Returns
The weight retrieved from the pool.

Definition at line 96 of file stencil_weight.tpp.

◆ size()

template<typename weight_t >
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.

Parameters
sizeThe size of the pool.

Definition at line 50 of file stencil_weight.tpp.

◆ store() [1/2]

template<typename weight_t >
void bitpit::DiscreteStencilWeightPool< weight_t >::store ( std::vector< weight_t > * weights)

Store the given weights in the pool.

Parameters
weightsare the weight that will be stored in the pool

Definition at line 129 of file stencil_weight.tpp.

◆ store() [2/2]

template<typename weight_t >
void bitpit::DiscreteStencilWeightPool< weight_t >::store ( weight_t && weight)

Store the given weight in the pool.

Parameters
weightis the weight that will be stored in the pool

Definition at line 114 of file stencil_weight.tpp.


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