This Measure holds the result of some externally-determined computation, and helps to coordinate the validity of that computation with respect to the state variables.
More...
|
| SimTK_MEASURE_HANDLE_PREAMBLE (Result, Measure_< T >) |
|
| Result (Subsystem &sub, Stage dependsOn, Stage invalidated) |
| Create a new Result measure and add it to the indicated subsystem. More...
|
|
Stage | getDependsOnStage () const |
| Get the dependsOn stage for this measure's value. More...
|
|
Stage | getInvalidatedStage () const |
| Get the invalidated stage for this measure's value. More...
|
|
Result & | setDependsOnStage (Stage dependsOn) |
| Change the dependsOn stage for this measure's value, which must be strictly less than the current setting for the invalidated stage. More...
|
|
Result & | setInvalidatedStage (Stage invalidated) |
| Change the invalidated stage for this measure's value, which must be strictly greater than the current setting for the dependsOn stage. More...
|
|
Result & | setIsPresumedValidAtDependsOnStage (bool presume) |
| Normally a Result measure's value is not considered valid unless we are notified explicitly that it is, via a call to markAsValid() or setValue(); this method allows the value to be assumed valid after the dependsOn stage has been realized. More...
|
|
bool | getIsPresumedValidAtDependsOnStage () const |
| Return the value of the "presumed valid at dependsOn stage" flag. More...
|
|
T & | updValue (const State &state) const |
| Obtain write access to the Measure's value in order to modify it. More...
|
|
void | markAsValid (const State &state) const |
| Mark the current value as valid. More...
|
|
bool | isValid (const State &state) const |
| Check whether the value contained in this Measure is currently valid. More...
|
|
void | markAsNotValid (const State &state) const |
| Manually mark the contained value as invalid. More...
|
|
void | setValue (const State &state, const T &value) const |
| Set a new value and mark it as valid. More...
|
|
| SimTK_MEASURE_HANDLE_POSTSCRIPT (Result, Measure_< T >) |
|
| SimTK_MEASURE_HANDLE_PREAMBLE_ABSTRACT (Measure_, AbstractMeasure) |
| This class is still abstract so we don't want it to allocate an Implementation object in its default constructor. More...
|
|
const T & | getValue (const State &s, int derivOrder=0) const |
| Retrieve the Value of this Measure or one of its time derivatives, assuming the supplied State has been realized to at least the required stage for the selected value or derivative, as reported by getDependsOnStage(). More...
|
|
Measure_ & | setDefaultValue (const T &defaultValue) |
| Change the default value associated with this Measure. More...
|
|
const T & | getDefaultValue () const |
| Obtain a reference to the default value associated with this Measure. More...
|
|
| SimTK_MEASURE_HANDLE_POSTSCRIPT (Measure_, AbstractMeasure) |
|
| AbstractMeasure (Implementation *g=0) |
| Provide an Implementation for this AbstractMeasure and bump its reference count. More...
|
|
| AbstractMeasure (Subsystem &, Implementation *g, const SetHandle &) |
| Construct this handle with a given Implementation object (whose reference count will be bumped) and then let the given Subsystem adopt this Measure (which will again bump the Implementation's reference count, leaving us with two new handles). More...
|
|
| AbstractMeasure (const AbstractMeasure &) |
| Shallow copy constructor copies the pointer from the source Implementation object and bumps its reference count. More...
|
|
AbstractMeasure & | operator= (const AbstractMeasure &source) |
| Shallow assignment operator results in this handle referencing the same Implementation object as does the source. More...
|
|
| ~AbstractMeasure () |
| Destructor decrements the Implementation's reference count and deletes the object if the count goes to zero. More...
|
|
AbstractMeasure & | shallowAssign (const AbstractMeasure &) |
| Shallow assignment operator destructs the current Implementation object (meaning its reference count is decremented and the object actually deleted only if the count goes to zero), then copies the Implementation pointer from the source and bumps its reference count. More...
|
|
AbstractMeasure & | deepAssign (const AbstractMeasure &source) |
| Deep assignment clones the Implementation object pointed to by the source handle, so that this handle ends up pointing to a new Measure object similar to the original but not yet contained in any Subsystem. More...
|
|
int | getNumTimeDerivatives () const |
| Every Measure can produce a value, and some can provide one or more total derivatives with respect to time of that value. More...
|
|
Stage | getDependsOnStage (int derivOrder=0) const |
| At what Stage can we expect the value of this AbstractMeasure or one of its time derivatives to be available? Users of Measures will typically impose restrictions on the levels they will accept. More...
|
|
bool | isSameMeasure (const AbstractMeasure &other) const |
| There can be multiple handles on the same Measure. More...
|
|
bool | isEmptyHandle () const |
|
bool | isInSubsystem () const |
| Test whether this Measure object has been adopted by a Subsystem. More...
|
|
const Subsystem & | getSubsystem () const |
| Return a reference to the Subsystem that owns this Measure. More...
|
|
bool | isSameSubsystem (const Subsystem &) const |
| Is getSubsystem() the same as the passed-in Subsystem? More...
|
|
MeasureIndex | getSubsystemMeasureIndex () const |
| Return the MeasureIndex by which this Measure is known to the Subsystem that owns it. More...
|
|
const Implementation & | getImpl () const |
|
Implementation & | updImpl () |
|
bool | hasImpl () const |
|
int | getRefCount () const |
|
template<class T>
class SimTK::Measure_< T >::Result
This Measure holds the result of some externally-determined computation, and helps to coordinate the validity of that computation with respect to the state variables.
The value must be set manually and explicitly marked valid when it is complete. The value will be automatically invalidated after a state change at or below a specified Stage, and changing the value here will automatically invalidate a specified Stage and above.
In constrast to Measure::Variable, Measure::Result is not a state variable; it is a cache variable meaning that it works with a const State. It is expected that the result can be recalculated from the state variables when needed, or contains ephemeral information that can be discarded.
No provision for derivatives is made; there is only the one result.