Simbody
Public Types | Public Member Functions | Static Public Attributes | Friends

SimTK::Stage Class Reference

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

#include <Stage.h>

Inheritance diagram for SimTK::Stage:

List of all members.

Public Types

enum  Num {
  EmptyIndex = 0, TopologyIndex = 1, ModelIndex = 2, InstanceIndex = 3,
  TimeIndex = 4, PositionIndex = 5, VelocityIndex = 6, DynamicsIndex = 7,
  AccelerationIndex = 8, ReportIndex = 9, InfinityIndex = 10
}

Public Member Functions

Stage next () const
Stage prev () const
void invalidate (Stage tooHigh)
bool isInRuntimeRange () const

Static Public Attributes

static const Stage Empty
static const Stage Topology
static const Stage Model
static const Stage Instance
static const Stage Time
static const Stage Position
static const Stage Velocity
static const Stage Dynamics
static const Stage Acceleration
static const Stage Report
static const Stage Infinity
static const Stage LowestValid
static const Stage HighestValid
static const int NValid = InfinityIndex-EmptyIndex+1
static const Stage LowestRuntime
static const Stage HighestRuntime
static const int NRuntime = ReportIndex-ModelIndex+1

Friends

class Enumeration< Stage >

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 for(Stage s = Stage::LowestValid; s <= Stage::HighestValid; ++s) ... Stage constants (of type Stage::Num) are implicitly converted to type Stage when necessary. If you want to use a Stage in a switch statement you have to use the Stage::Num indices rather than a Stage constant as case labels.

There is no default construction -- all Stage variables must be initialized explicitly. (I would like them to initialize to Stage::Empty but the Enumeration<> template doesn't allow that.)


Member Enumeration Documentation

Enumerator:
EmptyIndex 
TopologyIndex 
ModelIndex 
InstanceIndex 
TimeIndex 
PositionIndex 
VelocityIndex 
DynamicsIndex 
AccelerationIndex 
ReportIndex 
InfinityIndex 

Member Function Documentation

Stage SimTK::Stage::next ( ) const [inline]
Stage SimTK::Stage::prev ( ) const [inline]
void SimTK::Stage::invalidate ( Stage  tooHigh) [inline]
bool SimTK::Stage::isInRuntimeRange ( ) const [inline]

Friends And Related Function Documentation

friend class Enumeration< Stage > [friend]

Member Data Documentation

const Stage SimTK::Stage::Empty [static]
const Stage SimTK::Stage::Topology [static]
const Stage SimTK::Stage::Model [static]
const Stage SimTK::Stage::Instance [static]
const Stage SimTK::Stage::Time [static]
const Stage SimTK::Stage::Position [static]
const Stage SimTK::Stage::Velocity [static]
const Stage SimTK::Stage::Dynamics [static]
const Stage SimTK::Stage::Report [static]
const Stage SimTK::Stage::Infinity [static]
const int SimTK::Stage::NValid = InfinityIndex-EmptyIndex+1 [static]
const int SimTK::Stage::NRuntime = ReportIndex-ModelIndex+1 [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines