Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
MarmotStateVarVectorManager Class Reference

A convenience auxiliary class for managing multiple statevars with arbitrary length in a single consecutive double array. More...

#include <MarmotStateVarVectorManager.h>

Inheritance diagram for MarmotStateVarVectorManager:
[legend]

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 StateVarVectorLayouttheLayout
 a const reference to the respective layout More...
 

Detailed Description

A convenience auxiliary class for managing multiple statevars with arbitrary length in a single consecutive double array.


Class Documentation

◆ MarmotStateVarVectorManager::StateVarEntryDefinition

struct MarmotStateVarVectorManager::StateVarEntryDefinition

An entry in the statevar vector consists of the name and a certain length.

Class Members
string name
int length

◆ MarmotStateVarVectorManager::StateVarEntryLocation

struct MarmotStateVarVectorManager::StateVarEntryLocation

The location in the statevar vector consists of the index and its certain length.

Class Members
int index
int length

◆ MarmotStateVarVectorManager::StateVarVectorLayout

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

Constructor & Destructor Documentation

◆ MarmotStateVarVectorManager()

MarmotStateVarVectorManager::MarmotStateVarVectorManager ( double *  theStateVars,
const StateVarVectorLayout theLayout_ 
)
inlineprotected

Member Function Documentation

◆ getStateView()

StateView MarmotStateVarVectorManager::getStateView ( const std::string &  name) const
inline

get a StateView for a statevar entry

◆ find()

double& MarmotStateVarVectorManager::find ( const std::string &  name) const
inline

get the reference to the first array element of an entry in the statevar vector

◆ contains()

bool MarmotStateVarVectorManager::contains ( const std::string &  name) const
inline

check if the entry with name is managed

◆ makeLayout()

static StateVarVectorLayout MarmotStateVarVectorManager::makeLayout ( const std::vector< StateVarEntryDefinition > &  theEntries)
inlinestaticprotected

generate the statevar vector layout from a list of entries, defined by name and length

Member Data Documentation

◆ theStateVars

double* MarmotStateVarVectorManager::theStateVars
protected

pointer to the first element in the statevar vector

◆ theLayout

const StateVarVectorLayout& MarmotStateVarVectorManager::theLayout
protected

a const reference to the respective layout


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