cee::ug::StateInfo Class Reference

Simple class containing metadata info for a state. More...

Public Types

enum  ReferenceType { TIME, FREQUENCY, LOADCASE, OTHER }
 List of state reference types. More...
 

Public Member Functions

 StateInfo ()
 Constructs an empty object. More...
 
 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. More...
 
 StateInfo (int stateId, const Str &stateName, double stateRefVal)
 Constructs a new object with the given state id, state name and state reference value. More...
 
 StateInfo (const StateInfo &other)
 Constructs a new StateInfo that is a copy of other. More...
 
StateInfooperator= (const StateInfo &rhs)
 Assigns rhs to this state info and returns a reference to this state info. More...
 
bool operator== (const StateInfo &rhs) const
 Returns true if the object is equal to rhs. More...
 
bool operator!= (const StateInfo &rhs) const
 Returns true if the object is not equal to rhs. More...
 
int id () const
 Returns the state id. More...
 
Str name () const
 Returns the state name. More...
 
double referenceValue () const
 Returns the state reference value. More...
 
ReferenceType referenceType () const
 Returns the state reference type (time, frequency, load case, none) More...
 

Detailed Description

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
DataSourceDirectory
DataState

Member Enumeration Documentation

List of state reference types.

Enumerator
TIME 

Time.

FREQUENCY 

Frequency.

LOADCASE 

Load case.

OTHER 

Any other reference type.

Constructor & Destructor Documentation

cee::ug::StateInfo::StateInfo ( )

Constructs an empty object.

Default id is -1 (invalid)

cee::ug::StateInfo::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.

cee::ug::StateInfo::StateInfo ( int  stateId,
const Str stateName,
double  stateRefVal 
)

Constructs a new object with the given state id, state name and state reference value.

cee::ug::StateInfo::StateInfo ( const StateInfo other)

Constructs a new StateInfo that is a copy of other.

Member Function Documentation

int cee::ug::StateInfo::id ( ) const

Returns the state id.

Returns -1 if this state info object is invalid.

Str cee::ug::StateInfo::name ( ) const

Returns the state name.

bool cee::ug::StateInfo::operator!= ( const StateInfo rhs) const

Returns true if the object is not equal to rhs.

StateInfo & cee::ug::StateInfo::operator= ( const StateInfo rhs)

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

bool cee::ug::StateInfo::operator== ( const StateInfo rhs) const

Returns true if the object is equal to rhs.

StateInfo::ReferenceType cee::ug::StateInfo::referenceType ( ) const

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

double cee::ug::StateInfo::referenceValue ( ) const

Returns the state reference value.