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

Public Types

enum ReferenceType

List of state reference types.

Values:

enumerator TIME

Time.

enumerator FREQUENCY

Frequency.

enumerator LOADCASE

Load case.

enumerator OTHER

Any other reference type.

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(const StateInfo &other)

Constructs a new StateInfo that is a copy of other.

StateInfo &operator=(const StateInfo &rhs)

Assigns rhs to this state info and returns a reference to this state info.

bool operator==(const StateInfo &rhs) const

Returns true if the object is equal to rhs.

bool operator!=(const StateInfo &rhs) const

Returns true if the object is not equal to rhs.

int id() const

Returns the state id.

Returns -1 if this state info object is invalid.

Str name() const

Returns the state name.

double referenceValue() const

Returns the state reference value.

ReferenceType referenceType() const

Returns the state reference type (time, frequency, load case, none)