cee::ug::StateInfo
-
class StateInfo
Simple class containing metadata info for a state.
A state info contains:
State id
State name
State reference type. Frequency, time step or load case or other.
State reference value.
Default state id is -1 which indicates an invalid id.
Metadata for a model is accessed from the data source directory.
Example
Example on getting the state id for the last state using the metadata directory.
std::vector<cee::ug::StateInfo> stateInfos = source->directory()->stateInfos(); if (stateInfos.size() > 0) { int lastStateId = stateInfos[stateInfos.size() - 1].id(); }
See the complete source code at: UnstructGrid: Load Model from File and Set Up Model Specification
See also
Public Types
Public Functions
-
StateInfo()
Constructs an empty object.
Default id is -1 (invalid)
-
StateInfo(int stateId, const Str &stateName, ReferenceType refType, double stateRefVal)
Constructs a new object with the given state id, state name, reference type and state reference value.
-
StateInfo(int stateId, const Str &stateName, double stateRefVal)
Constructs a new object with the given state id, state name and state reference value.
-
StateInfo &operator=(const StateInfo &rhs)
Assigns rhs to this state info and returns a reference to this state info.
-
int id() const
Returns the state id.
Returns -1 if this state info object is invalid.
-
double referenceValue() const
Returns the state reference value.
-
ReferenceType referenceType() const
Returns the state reference type (time, frequency, load case, none)