A convenience auxiliary class for managing multiple statevars with arbitrary length in a single consecutive double array. More...
#include <MarmotStateVarVectorManager.h>
Classes | |
struct | StateVarEntryDefinition |
An entry in the statevar vector consists of the name and a certain length. More... | |
struct | StateVarEntryLocation |
The location in the statevar vector consists of the index and its certain length. More... | |
struct | StateVarVectorLayout |
Public Member Functions | |
StateView | getStateView (const std::string &name) const |
get a StateView for a statevar entry More... | |
double & | find (const std::string &name) const |
get the reference to the first array element of an entry in the statevar vector More... | |
bool | contains (const std::string &name) const |
check if the entry with name is managed More... | |
Protected Member Functions | |
MarmotStateVarVectorManager (double *theStateVars, const StateVarVectorLayout &theLayout_) | |
Static Protected Member Functions | |
static StateVarVectorLayout | makeLayout (const std::vector< StateVarEntryDefinition > &theEntries) |
generate the statevar vector layout from a list of entries, defined by name and length More... | |
Protected Attributes | |
double * | theStateVars |
pointer to the first element in the statevar vector More... | |
const StateVarVectorLayout & | theLayout |
a const reference to the respective layout More... | |
A convenience auxiliary class for managing multiple statevars with arbitrary length in a single consecutive double array.
struct MarmotStateVarVectorManager::StateVarEntryDefinition |
struct MarmotStateVarVectorManager::StateVarEntryLocation |
struct MarmotStateVarVectorManager::StateVarVectorLayout |
The layout is defined by a map of names to Locations, and the resulting required total length of the statevar vector
Class Members | ||
---|---|---|
unordered_map< string, StateVarEntryLocation > | entries | |
int | nRequiredStateVars |
|
inlineprotected |
|
inline |
get a StateView for a statevar entry
|
inline |
get the reference to the first array element of an entry in the statevar vector
|
inline |
check if the entry with name is managed
|
inlinestaticprotected |
generate the statevar vector layout from a list of entries, defined by name and length
|
protected |
pointer to the first element in the statevar vector
|
protected |
a const reference to the respective layout