Simbody  3.7
SimTK::Stage Class Reference

This class is basically a glorified enumerated type, type-safe and range checked but permitting convenient (if limited) arithmetic. More...

Public Types

enum  Level {
  Empty = 0,
  Topology = 1,
  Model = 2,
  Instance = 3,
  Time = 4,
  Position = 5,
  Velocity = 6,
  Dynamics = 7,
  Acceleration = 8,
  Report = 9,
  Infinity = 10,
  LowestValid = Empty,
  HighestValid = Infinity,
  LowestRuntime = Model,
  HighestRuntime = Report
}
 
enum  {
  NValid = HighestValid-LowestValid+1,
  NRuntime = HighestRuntime-LowestRuntime+1
}
 

Public Member Functions

 Stage ()
 Default construction gives Stage::Empty. More...
 
 Stage (Level l)
 This is an implicit conversion from Stage::Level to Stage. More...
 
 Stage (int l)
 You can explicitly create a Stage from an int if it is in range. More...
 
 operator int () const
 Stage will implicitly convert to int so you can use it as an index. More...
 
bool operator== (Level other) const
 
bool operator!= (Level other) const
 
bool operator< (Level other) const
 
bool operator<= (Level other) const
 
bool operator> (Level other) const
 
bool operator>= (Level other) const
 
bool operator== (Stage other) const
 
bool operator!= (Stage other) const
 
bool operator< (Stage other) const
 
bool operator<= (Stage other) const
 
bool operator> (Stage other) const
 
bool operator>= (Stage other) const
 
const Stageoperator++ ()
 
const Stageoperator-- ()
 
Stage operator++ (int)
 
Stage operator-- (int)
 
Stage next () const
 Return the Stage following this one, with Stage::Infinity returned if this Stage is already at its highest value, Stage::Report. More...
 
Stage prev () const
 Return the Stage before this one, with Stage::Empty returned if this Stage is already at its lowest value, Stage::Topology. More...
 
String getName () const
 Return a printable name corresponding to the stage level currently stored in this Stage. More...
 
void invalidate (Stage tooHigh)
 Set this Stage=min(stageNow, tooHigh-1). More...
 
bool isInRuntimeRange () const
 Return true if this Stage has one of the meaningful values between Stage::Topology and Stage::Report, rather than one of the end markers Stage::Empty or Stage::Infinity. More...
 

Detailed Description

This class is basically a glorified enumerated type, type-safe and range checked but permitting convenient (if limited) arithmetic.

Constants look like Stage::Position, and loops can be written like

// ...
}

Stage constants (of type Stage::Level) are implicitly converted to type Stage when necessary.

Default construction gives Stage::Empty which really means "invalid".

Member Enumeration Documentation

◆ Level

Enumerator
Empty 

Lower than any legitimate Stage.

Topology 

System topology realized.

Model 

Modeling choices made.

Instance 

Physical parameters set.

Time 

A new time has been realized.

Position 

Spatial configuration available.

Velocity 

Spatial velocities available.

Dynamics 

Forces calculated.

Acceleration 

Accelerations and multipliers calculated.

Report 

Report-only quantities evaluated.

Infinity 

Higher than any legitimate Stage.

LowestValid 

For iterating over all stage values.

HighestValid 
LowestRuntime 

For iterating over meaningful stage values.

HighestRuntime 

◆ anonymous enum

anonymous enum
Enumerator
NValid 
NRuntime 

Constructor & Destructor Documentation

◆ Stage() [1/3]

SimTK::Stage::Stage ( )
inline

Default construction gives Stage::Empty.

◆ Stage() [2/3]

SimTK::Stage::Stage ( Level  l)
inline

This is an implicit conversion from Stage::Level to Stage.

◆ Stage() [3/3]

SimTK::Stage::Stage ( int  l)
inlineexplicit

You can explicitly create a Stage from an int if it is in range.

Member Function Documentation

◆ operator int()

SimTK::Stage::operator int ( ) const
inline

Stage will implicitly convert to int so you can use it as an index.

◆ operator==() [1/2]

bool SimTK::Stage::operator== ( Level  other) const
inline

◆ operator!=() [1/2]

bool SimTK::Stage::operator!= ( Level  other) const
inline

◆ operator<() [1/2]

bool SimTK::Stage::operator< ( Level  other) const
inline

◆ operator<=() [1/2]

bool SimTK::Stage::operator<= ( Level  other) const
inline

◆ operator>() [1/2]

bool SimTK::Stage::operator> ( Level  other) const
inline

◆ operator>=() [1/2]

bool SimTK::Stage::operator>= ( Level  other) const
inline

◆ operator==() [2/2]

bool SimTK::Stage::operator== ( Stage  other) const
inline

◆ operator!=() [2/2]

bool SimTK::Stage::operator!= ( Stage  other) const
inline

◆ operator<() [2/2]

bool SimTK::Stage::operator< ( Stage  other) const
inline

◆ operator<=() [2/2]

bool SimTK::Stage::operator<= ( Stage  other) const
inline

◆ operator>() [2/2]

bool SimTK::Stage::operator> ( Stage  other) const
inline

◆ operator>=() [2/2]

bool SimTK::Stage::operator>= ( Stage  other) const
inline

◆ operator++() [1/2]

const Stage& SimTK::Stage::operator++ ( )
inline

◆ operator--() [1/2]

const Stage& SimTK::Stage::operator-- ( )
inline

◆ operator++() [2/2]

Stage SimTK::Stage::operator++ ( int  )
inline

◆ operator--() [2/2]

Stage SimTK::Stage::operator-- ( int  )
inline

◆ next()

Stage SimTK::Stage::next ( ) const
inline

Return the Stage following this one, with Stage::Infinity returned if this Stage is already at its highest value, Stage::Report.

An exception is thrown if this Stage is already Stage::Infinity.

◆ prev()

Stage SimTK::Stage::prev ( ) const
inline

Return the Stage before this one, with Stage::Empty returned if this Stage is already at its lowest value, Stage::Topology.

An exception is thrown if this Stage is already Stage::Empty.

◆ getName()

String SimTK::Stage::getName ( ) const
inline

Return a printable name corresponding to the stage level currently stored in this Stage.

◆ invalidate()

void SimTK::Stage::invalidate ( Stage  tooHigh)
inline

Set this Stage=min(stageNow, tooHigh-1).

◆ isInRuntimeRange()

bool SimTK::Stage::isInRuntimeRange ( ) const
inline

Return true if this Stage has one of the meaningful values between Stage::Topology and Stage::Report, rather than one of the end markers Stage::Empty or Stage::Infinity.


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