API 4.4.1-2022-10-19-2c4045e59
For MATLAB, Python, Java, and C++ users
|
An Input<Y> must be connected by an Output<Y> More...
Public Member Functions | |
Input< T > * | clone () const override |
Create a dynamically-allocated copy. More... | |
void | connect (const AbstractOutput &output, const std::string &alias="") override |
Connect this Input to the provided (Abstract)Output. More... | |
void | connect (const AbstractChannel &channel, const std::string &alias="") override |
Connect this Input to a single output channel. More... | |
void | finalizeConnection (const Component &root) override |
Connect this Input given a root Component to search for the Output according to the connectee path of this Input More... | |
void | disconnect () override |
Clear references to connectees. More... | |
bool | isConnected () const override |
Derived classes must satisfy this Interface. More... | |
const T & | getValue (const SimTK::State &state) const |
Get the value of this Input when it is connected. More... | |
const T & | getValue (const SimTK::State &state, unsigned index) const |
Get the value of this Input when it is connected. More... | |
const Channel & | getChannel () const |
Get the Channel associated with this Input. More... | |
const Channel & | getChannel (unsigned index) const |
Get the Channel associated with this Input. More... | |
const std::string & | getAlias () const override |
Get the alias for a Channel. More... | |
const std::string & | getAlias (unsigned index) const override |
Get the alias for the Channel indicated by the provided index. More... | |
void | setAlias (const std::string &alias) override |
Set the alias for a Channel. More... | |
void | setAlias (unsigned index, const std::string &alias) override |
Set the alias for the Channel indicated by the provided index. More... | |
std::string | getLabel () const override |
Get the label for this Channel. More... | |
std::string | getLabel (unsigned index) const override |
Get the label for the Channel indicated by the provided index. More... | |
SimTK::Vector_< T > | getVector (const SimTK::State &state) const |
Access the values of all the channels connected to this Input as a SimTK::Vector_<T>. More... | |
const ChannelList & | getChannels () const |
Get const access to the channels connected to this input. More... | |
std::string | getConnecteeTypeName () const override |
Return the typename of the Output value, T, that satisfies this Input<T>. More... | |
SimTK_DOWNCAST (Input, AbstractInput) | |
Public Member Functions inherited from OpenSim::AbstractInput | |
virtual | ~AbstractInput () |
void | connect (const Object &object) override |
Connect this Socket to the provided connectee object. More... | |
Public Member Functions inherited from OpenSim::AbstractSocket | |
virtual | ~AbstractSocket () |
const std::string & | getName () const |
SimTK::Stage | getConnectAtStage () const |
Get the system Stage when the connection should be made. More... | |
bool | isListSocket () const |
Can this Socket have more than one connectee? More... | |
unsigned | getNumConnectees () const |
The number of slots to fill in order to satisfy this socket. More... | |
virtual const Object & | getConnecteeAsObject () const |
Generic access to the connectee. More... | |
virtual void | findAndConnect (const ComponentPath &connectee) |
Find the connectee using a search with a partial path. More... | |
void | findAndConnect (const std::string &connectee) |
Same as findAndConnect(const ComponentPath&), but using a string argument. More... | |
void | setConnecteePath (const std::string &name) |
Set connectee path. More... | |
void | setConnecteePath (const std::string &name, unsigned ix) |
Set connectee path of a connectee among a list of connectees. More... | |
const std::string & | getConnecteePath () const |
Get connectee path. More... | |
const std::string & | getConnecteePath (unsigned ix) const |
Get connectee path of a connectee among a list of connectees. More... | |
void | appendConnecteePath (const std::string &name) |
void | clearConnecteePath () |
Clear all connectee paths in the connectee path property. More... | |
const Component & | getOwner () const |
Get owner component of this socket. More... | |
Static Public Member Functions | |
static Input< T > * | safeDownCast (AbstractInput *base) |
For use in python/java/MATLAB bindings. More... | |
Static Public Member Functions inherited from OpenSim::AbstractInput | |
static bool | parseConnecteePath (const std::string &connecteePath, std::string &componentPath, std::string &outputName, std::string &channelName, std::string &alias) |
Break up a connectee path into its output path, channel name (empty for single-value outputs), and alias. More... | |
static std::string | composeConnecteePath (const std::string &componentPath, const std::string &outputName, const std::string &channelName, const std::string &alias) |
Compose the connectee path from its constituents. More... | |
An Input<Y> must be connected by an Output<Y>
|
inlineprotected |
Create an Input<T> (Socket) that can only connect to an Output<T> name and stage at which it should be connected.
typedef std::vector<std::string> OpenSim::Input< T >::AliasList |
typedef Output<T>::Channel OpenSim::Input< T >::Channel |
typedef std::vector<SimTK::ReferencePtr<const Channel> > OpenSim::Input< T >::ChannelList |
|
inlineoverridevirtual |
Create a dynamically-allocated copy.
You must manage the memory for the returned pointer. This function exists to facilitate the use of SimTK::ClonePtr<AbstractSocket>.
Implements OpenSim::AbstractInput.
|
overridevirtual |
Connect this Input to a single output channel.
This method can be used with both single-valued and list Inputs. You can optionally provide an alias that will be used by the Component owning this Input to refer to the Channel.
Implements OpenSim::AbstractInput.
|
overridevirtual |
Connect this Input to the provided (Abstract)Output.
Implements OpenSim::AbstractInput.
References OpenSim::AbstractOutput::getPathName(), and OpenSim::AbstractOutput::getTypeName().
|
inlineoverridevirtual |
Clear references to connectees.
The connectee path property is not affected. Calling finalizeConnection() will use the connectee path property to satisfy the socket.
Implements OpenSim::AbstractSocket.
|
overridevirtual |
Connect this Input given a root Component to search for the Output according to the connectee path of this Input
Reimplemented from OpenSim::AbstractSocket.
References OpenSim::AbstractOutput::getChannel(), OpenSim::Output< T >::getChannel(), OpenSim::ComponentPath::getNumPathLevels(), OpenSim::ComponentPath::getSubcomponentNameAtLevel(), OpenSim::ComponentPath::isAbsolute(), and OpenSim::ComponentPath::toString().
|
inlineoverridevirtual |
Get the alias for a Channel.
An alias is a description for a Channel that is specific to how the Input will use the Channel. For example, the Component that owns this Input might expect the aliases to be the names of markers in the model. This method can be used only for non-list Inputs; for list Inputs, use the overload that takes an index. You must finalize connections (Component::finalizeConnections()) first.
Implements OpenSim::AbstractInput.
References OpenSim::Input< T >::getAlias(), and OpenSim::AbstractSocket::isListSocket().
Referenced by OpenSim::Input< T >::getAlias(), and OpenSim::Input< T >::getLabel().
|
inlineoverridevirtual |
Get the alias for the Channel indicated by the provided index.
An alias is a description for a Channel that is specific to how the Input will use the Channel. For example, the Component that owns this Input might expect the aliases to be the names of markers in the model. You must finalize connections (Component::finalizeConnections()) first.
Implements OpenSim::AbstractInput.
References OpenSim::AbstractSocket::getName(), OpenSim::AbstractSocket::getNumConnectees(), and OpenSim::Input< T >::isConnected().
|
inline |
Get the Channel associated with this Input.
This method can only be used for non-list Input(s). For list Input(s), use the other overload.
References OpenSim::Input< T >::getChannel(), and OpenSim::AbstractSocket::isListSocket().
Referenced by OpenSim::Input< T >::getChannel(), and OpenSim::Input< T >::getLabel().
|
inline |
Get the Channel associated with this Input.
Specify the index of the channel desired.
References OpenSim::AbstractSocket::getName(), OpenSim::AbstractSocket::getNumConnectees(), and OpenSim::Input< T >::isConnected().
|
inline |
Get const access to the channels connected to this input.
You can use this to iterate through the channels.
|
inlineoverridevirtual |
Return the typename of the Output value, T, that satisfies this Input<T>.
No reason to return Output<T> since it is a given that only an Output can satisfy an Input.
Implements OpenSim::AbstractSocket.
|
inlineoverridevirtual |
Get the label for this Channel.
If an alias has been set, the label is the alias; otherwise, the label is the full path of the Output that has been connected to this Input. This method can be used only for non-list Inputs; for list Inputs, use the single-argument overload. You must finalize connections (Component::finalizeConnections()) first.
Implements OpenSim::AbstractInput.
References OpenSim::Input< T >::getLabel(), OpenSim::AbstractSocket::getName(), OpenSim::Input< T >::isConnected(), and OpenSim::AbstractSocket::isListSocket().
Referenced by OpenSim::Input< T >::getLabel().
|
inlineoverridevirtual |
Get the label for the Channel indicated by the provided index.
If an alias has been set, the label is the alias; otherwise, the label is the full path of the Channel that has been connected to this Input. You must finalize connections (Component::finalizeConnections()) first.
Implements OpenSim::AbstractInput.
References OpenSim::Input< T >::getAlias(), OpenSim::Input< T >::getChannel(), OpenSim::AbstractSocket::getName(), OpenSim::AbstractSocket::getNumConnectees(), OpenSim::Output< T >::Channel::getPathName(), and OpenSim::Input< T >::isConnected().
|
inline |
Get the value of this Input when it is connected.
Redirects to connected Output<T>'s getValue() with minimal overhead. This method can be used only for non-list Input(s). For list Input(s), use the other overload.
References OpenSim::Input< T >::getValue(), and OpenSim::AbstractSocket::isListSocket().
Referenced by OpenSim::Input< T >::getValue().
|
inline |
Get the value of this Input when it is connected.
Redirects to connected Output<T>'s getValue() with minimal overhead. Specify the index of the Channel whose value is desired.
References OpenSim::AbstractSocket::getName(), OpenSim::AbstractSocket::getNumConnectees(), and OpenSim::Input< T >::isConnected().
|
inline |
Access the values of all the channels connected to this Input as a SimTK::Vector_<T>.
The elements are in the same order as the channels.
|
inlineoverridevirtual |
Derived classes must satisfy this Interface.
Is the Socket connected to its connectee(s)? For a list socket, this is only true if this socket is connected to all its connectees.
Implements OpenSim::AbstractSocket.
References OpenSim::AbstractSocket::getNumConnectees().
Referenced by OpenSim::Input< T >::getAlias(), OpenSim::Input< T >::getChannel(), OpenSim::Input< T >::getLabel(), OpenSim::Input< T >::getValue(), and OpenSim::Input< T >::setAlias().
|
inlinestatic |
For use in python/java/MATLAB bindings.
|
inlineoverridevirtual |
Set the alias for a Channel.
If this is a list Input, the aliases of all Channels will be set to the provided string. If you wish to set the alias of only one Channel, use the two-argument overload. You must finalize connections (Component::finalizeConnections()) first.
Implements OpenSim::AbstractInput.
References OpenSim::AbstractSocket::getNumConnectees(), and OpenSim::Input< T >::setAlias().
Referenced by OpenSim::Input< T >::setAlias().
|
inlineoverridevirtual |
Set the alias for the Channel indicated by the provided index.
You must finalize connections (Component::finalizeConnections()) first.
Implements OpenSim::AbstractInput.
References OpenSim::AbstractInput::composeConnecteePath(), OpenSim::AbstractSocket::getConnecteePath(), OpenSim::AbstractSocket::getName(), OpenSim::AbstractSocket::getNumConnectees(), OpenSim::Input< T >::isConnected(), OpenSim::AbstractInput::parseConnecteePath(), and OpenSim::AbstractSocket::updConnecteePathProp().
OpenSim::Input< T >::SimTK_DOWNCAST | ( | Input< T > | , |
AbstractInput< T > | |||
) |