Simbody  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

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
Enumerator
NValid 
NRuntime 

Constructor & Destructor Documentation

SimTK::Stage::Stage ( )
inline

Default construction gives Stage::Empty.

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

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

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

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

Member Function Documentation

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

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

bool SimTK::Stage::operator== ( Level  other) const
inline
bool SimTK::Stage::operator!= ( Level  other) const
inline
bool SimTK::Stage::operator< ( Level  other) const
inline
bool SimTK::Stage::operator<= ( Level  other) const
inline
bool SimTK::Stage::operator> ( Level  other) const
inline
bool SimTK::Stage::operator>= ( Level  other) const
inline
bool SimTK::Stage::operator== ( Stage  other) const
inline
bool SimTK::Stage::operator!= ( Stage  other) const
inline
bool SimTK::Stage::operator< ( Stage  other) const
inline
bool SimTK::Stage::operator<= ( Stage  other) const
inline
bool SimTK::Stage::operator> ( Stage  other) const
inline
bool SimTK::Stage::operator>= ( Stage  other) const
inline
const Stage& SimTK::Stage::operator++ ( )
inline
const Stage& SimTK::Stage::operator-- ( )
inline
Stage SimTK::Stage::operator++ ( int  )
inline
Stage SimTK::Stage::operator-- ( int  )
inline
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.

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.

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

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

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

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

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: