API  4.2
For MATLAB, Python, Java, and C++ users
OpenSim::Output< T > Class Template Reference
+ Inheritance diagram for OpenSim::Output< T >:

Public Member Functions

 Output ()
 
 Output (const std::string &name, const std::function< void(const Component *comp, const SimTK::State &, const std::string &channel, T &)> &outputFunction, const SimTK::Stage &dependsOnStage, bool isList)
 Convenience constructor Create a Component::Output bound to a specific method of the Component and valid at a given realization Stage. More...
 
 Output (const Output &source)
 Custom copy constructor is for setting the Channel's pointer back to this Output. More...
 
Outputoperator= (const Output &source)
 Custom copy assignment operator is for setting the Channel's pointer back to this Output. More...
 
virtual ~Output ()
 
 Output (Output &&)=delete
 
Outputoperator= (Output &&)=delete
 
bool isCompatible (const AbstractOutput &o) const override
 
void compatibleAssign (const AbstractOutput &o) override
 
void clearChannels () override
 Output Interface. More...
 
void addChannel (const std::string &channelName) override
 Add a channel to this Output. More...
 
const AbstractChannelgetChannel (const std::string &name) const override
 For a single-value output, name must be empty or must be the output's name. More...
 
const ChannelMapgetChannels () const
 Use this to iterate through this Output's channels (even for single-value Channels). More...
 
const T & getValue (const SimTK::State &state) const
 Return the Value of this output if the state is appropriately realized
to a stage at or beyond the dependsOnStage, otherwise expect an Exception. More...
 
std::string getTypeName () const override
 The name of the value type (e.g., double) produced by this output. More...
 
std::string getValueAsString (const SimTK::State &state) const override
 
Output< T > * clone () const override
 
 SimTK_DOWNCAST (Output, AbstractOutput)
 
- Public Member Functions inherited from OpenSim::AbstractOutput
 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 ComponentgetOwner () const
 Output's owning Component. More...
 
std::string getPathName () const
 This returns <absolute-path-to-component>|<output-name>. More...
 
AbstractOutputoperator= (const AbstractOutput &o)
 
unsigned int getNumberOfSignificantDigits () const
 Specification for number of significant figures in string value. More...
 
void setNumberOfSignificantDigits (unsigned int numSigFigs)
 

Static Public Member Functions

static Output< T > * safeDownCast (AbstractOutput *parent)
 For use in python/java/MATLAB bindings. More...
 

Constructor & Destructor Documentation

◆ Output() [1/4]

template<class T >
OpenSim::Output< T >::Output ( )
inline

◆ Output() [2/4]

template<class T >
OpenSim::Output< T >::Output ( const std::string &  name,
const std::function< void(const Component *comp, const SimTK::State &, const std::string &channel, T &)> &  outputFunction,
const SimTK::Stage &  dependsOnStage,
bool  isList 
)
inlineexplicit

Convenience constructor Create a Component::Output bound to a specific method of the Component and valid at a given realization Stage.

Parameters
nameThe name of the output.
outputFunctionThe output function to be invoked (returns Output T)
dependsOnStageStage at which Output can be evaluated.
isListCan this Output have more than one channel?

◆ Output() [3/4]

template<class T >
OpenSim::Output< T >::Output ( const Output< T > &  source)
inline

Custom copy constructor is for setting the Channel's pointer back to this Output.

◆ ~Output()

template<class T >
virtual OpenSim::Output< T >::~Output ( )
inlinevirtual

◆ Output() [4/4]

template<class T >
OpenSim::Output< T >::Output ( Output< T > &&  )
delete

Member Typedef Documentation

◆ ChannelMap

template<class T >
typedef std::map<std::string, Channel> OpenSim::Output< T >::ChannelMap

The container type that holds onto all of Channels in an Output.

Member Function Documentation

◆ addChannel()

template<class T >
void OpenSim::Output< T >::addChannel ( const std::string &  channelName)
inlineoverridevirtual

Add a channel to this Output.

This should be called within the component's extendFinalizeFromProperties() .

Implements OpenSim::AbstractOutput.

References OpenSim::AbstractOutput::isListOutput().

◆ clearChannels()

template<class T >
void OpenSim::Output< T >::clearChannels ( )
inlineoverridevirtual

Output Interface.

Remove all channels from this Output (for list Outputs).

Implements OpenSim::AbstractOutput.

References OpenSim::AbstractOutput::isListOutput().

◆ clone()

template<class T >
Output<T>* OpenSim::Output< T >::clone ( ) const
inlineoverridevirtual

◆ compatibleAssign()

template<class T >
void OpenSim::Output< T >::compatibleAssign ( const AbstractOutput< T > &  o)
inlineoverridevirtual

◆ getChannel()

template<class T >
const AbstractChannel& OpenSim::Output< T >::getChannel ( const std::string &  name) const
inlineoverridevirtual

For a single-value output, name must be empty or must be the output's name.

Implements OpenSim::AbstractOutput.

References OpenSim::AbstractOutput::getName(), and OpenSim::AbstractOutput::isListOutput().

Referenced by OpenSim::Input< T >::finalizeConnection().

◆ getChannels()

template<class T >
const ChannelMap& OpenSim::Output< T >::getChannels ( ) const
inline

Use this to iterate through this Output's channels (even for single-value Channels).

for (const auto& chan : getChannels()) {
std::cout << chan.second->getName() << std::endl;
}
const ChannelMap & getChannels() const
Use this to iterate through this Output's channels (even for single-value Channels).
Definition: ComponentOutput.h:273

◆ getTypeName()

template<class T >
std::string OpenSim::Output< T >::getTypeName ( ) const
inlineoverridevirtual

The name of the value type (e.g., double) produced by this output.

Implements OpenSim::AbstractOutput.

References OpenSim::Object_GetClassName< T >::name().

Referenced by OpenSim::Output< T >::compatibleAssign().

◆ getValue()

template<class T >
const T& OpenSim::Output< T >::getValue ( const SimTK::State &  state) const
inline

Return the Value of this output if the state is appropriately realized
to a stage at or beyond the dependsOnStage, otherwise expect an Exception.

References OpenSim::AbstractOutput::_owner, OpenSim::AbstractOutput::getDependsOnStage(), and OpenSim::AbstractOutput::isListOutput().

Referenced by OpenSim::Output< T >::getValueAsString().

◆ getValueAsString()

template<class T >
std::string OpenSim::Output< T >::getValueAsString ( const SimTK::State &  state) const
inlineoverridevirtual

◆ isCompatible()

template<class T >
bool OpenSim::Output< T >::isCompatible ( const AbstractOutput< T > &  o) const
inlineoverridevirtual

◆ operator=() [1/2]

template<class T >
Output& OpenSim::Output< T >::operator= ( const Output< T > &  source)
inline

Custom copy assignment operator is for setting the Channel's pointer back to this Output.

References OpenSim::AbstractOutput::operator=().

◆ operator=() [2/2]

template<class T >
Output& OpenSim::Output< T >::operator= ( Output< T > &&  )
delete

◆ safeDownCast()

template<class T >
static Output<T>* OpenSim::Output< T >::safeDownCast ( AbstractOutput< T > *  parent)
inlinestatic

For use in python/java/MATLAB bindings.

◆ SimTK_DOWNCAST()

template<class T >
OpenSim::Output< T >::SimTK_DOWNCAST ( Output< T >  ,
AbstractOutput< T >   
)

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