API
4.5.1
For C++ developers
|
Output formalizes the access to a value of interest computed by the owning Component. More...
Public Member Functions | |
AbstractOutput () | |
AbstractOutput (const std::string &name, SimTK::Stage dependsOnStage, bool isList) | |
AbstractOutput (const AbstractOutput &other)=default | |
virtual | ~AbstractOutput ()=default |
const std::string & | getName () const |
Output's name. More... | |
const SimTK::Stage & | getDependsOnStage () const |
Output's dependence on System being realized to at least this System::Stage. More... | |
bool | isListOutput () const |
Can this Output have more than one channel? More... | |
const Component & | getOwner () const |
Output's owning Component. More... | |
std::string | getPathName () const |
This returns <absolute-path-to-component>|<output-name>. More... | |
virtual void | clearChannels ()=0 |
Output Interface. More... | |
virtual void | addChannel (const std::string &channelName)=0 |
Add a channel to this Output. More... | |
virtual const AbstractChannel & | getChannel (const std::string &name) const =0 |
virtual std::string | getTypeName () const =0 |
The name of the value type (e.g., double ) produced by this output. More... | |
virtual std::string | getValueAsString (const SimTK::State &state) const =0 |
virtual bool | isCompatible (const AbstractOutput &) const =0 |
virtual void | compatibleAssign (const AbstractOutput &)=0 |
AbstractOutput & | operator= (const AbstractOutput &o) |
virtual AbstractOutput * | clone () const =0 |
unsigned int | getNumberOfSignificantDigits () const |
Specification for number of significant figures in string value. More... | |
void | setNumberOfSignificantDigits (unsigned int numSigFigs) |
Protected Member Functions | |
void | setOwner (const Component &owner) |
Protected Attributes | |
SimTK::ReferencePtr< const Component > | _owner |
Output formalizes the access to a value of interest computed by the owning Component.
The value is then exposed and easily accessible for use by other components (e.g. to satisfy an Input). The purpose of an Output is to bind a value of interest to a component's member function (generator), and provide a generic interface to the value, its type and label so it can be easily identified. It also specifies the realization (computational) stage at which the value is valid, so that a caller can provide adequate error handling.
For example, a Body can have its position transformation with respect to
ground as an Output, which is only accessible when the model has been realized to the Position stage or beyond, in which case it depends on the Position stage. The validity of data flow can be checked prior to initiating a simulation.
An Output is intended to lightweight and adds no computational overhead if the output goes unused. When an Output's value is called upon, the overhead is a single redirect to the corresponding member function for the value.
An Output can either be a single-value Output or a list Output. A list Output is one that can have multiple Channels. The Channels are what get connected to Inputs.
|
inline |
|
inline |
|
default |
|
virtualdefault |
|
pure virtual |
Add a channel to this Output.
This should be called within the component's extendFinalizeFromProperties() .
Implemented in OpenSim::Output< T >.
|
pure virtual |
Output Interface.
Remove all channels from this Output (for list Outputs).
Implemented in OpenSim::Output< T >.
|
pure virtual |
Implemented in OpenSim::Output< T >.
|
pure virtual |
Implemented in OpenSim::Output< T >.
|
pure virtual |
Implemented in OpenSim::Output< T >.
Referenced by OpenSim::Input< T >::finalizeConnection().
|
inline |
Output's dependence on System being realized to at least this System::Stage.
Referenced by OpenSim::Output< T >::getValue().
|
inline |
Output's name.
Referenced by OpenSim::Output< T >::getChannel(), and OpenSim::Output< T >::Channel::getPathName().
|
inline |
Specification for number of significant figures in string value.
Referenced by OpenSim::Output< T >::getValueAsString().
std::string OpenSim::AbstractOutput::getPathName | ( | ) | const |
This returns <absolute-path-to-component>|<output-name>.
Referenced by OpenSim::Input< T >::connect().
|
pure virtual |
The name of the value type (e.g., double
) produced by this output.
Implemented in OpenSim::Output< T >.
Referenced by OpenSim::Output< T >::compatibleAssign(), and OpenSim::Input< T >::connect().
|
pure virtual |
Implemented in OpenSim::Output< T >.
|
pure virtual |
Implemented in OpenSim::Output< T >.
|
inline |
Can this Output have more than one channel?
Referenced by OpenSim::Output< T >::addChannel(), OpenSim::Output< T >::clearChannels(), OpenSim::Output< T >::getChannel(), OpenSim::Output< T >::getValue(), and OpenSim::Output< T >::getValueAsString().
|
inline |
Referenced by OpenSim::Output< T >::operator=().
|
inline |
|
inlineprotected |
|
protected |
Referenced by OpenSim::Output< T >::getValue().