Drake
Drake C++ Documentation
SystemOutput< T > Class Template Reference

Detailed Description

template<typename T>
class drake::systems::SystemOutput< T >

Conveniently stores a snapshot of the values of every output port of a System.

There is framework support for allocating the right types and filling them in but otherwise this is not used internally. Note that there is never any live connection between a SystemOutput object and the System whose output values it has captured.

A SystemOutput<T> object can only be obtained using System<T>::AllocateOutput() or by copying an existing SystemOutput object.

Template Parameters
TThe scalar type, which must be one of the default scalars.

#include <drake/systems/framework/system_output.h>

Public Member Functions

 ~SystemOutput ()=default
 
int num_ports () const
 Returns the number of output ports specified for this SystemOutput during allocation. More...
 
const AbstractValueget_data (int index) const
 Returns the last-saved value of output port index as an AbstractValue. More...
 
const BasicVector< T > * get_vector_data (int index) const
 Returns the last-saved value of output port index as a BasicVector<T>, although the actual concrete type is preserved from the actual output port. More...
 
AbstractValueGetMutableData (int index)
 (Advanced) Returns mutable access to an AbstractValue object that is suitable for holding the value of output port index of the allocating System. More...
 
BasicVector< T > * GetMutableVectorData (int index)
 (Advanced) Returns mutable access to a BasicVector<T> object that is suitable for holding the value of output port index of the allocating System. More...
 
internal::SystemId get_system_id () const
 (Internal) Gets the id of the System that created this output. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 SystemOutput (const SystemOutput &)=default
 
SystemOutputoperator= (const SystemOutput &)=default
 
 SystemOutput (SystemOutput &&)=default
 
SystemOutputoperator= (SystemOutput &&)=default
 

Friends

class System< T >
 
class SystemOutputTest
 

Constructor & Destructor Documentation

◆ SystemOutput() [1/2]

SystemOutput ( const SystemOutput< T > &  )
default

◆ SystemOutput() [2/2]

SystemOutput ( SystemOutput< T > &&  )
default

◆ ~SystemOutput()

~SystemOutput ( )
default

Member Function Documentation

◆ get_data()

const AbstractValue* get_data ( int  index) const

Returns the last-saved value of output port index as an AbstractValue.

This works for any output port regardless of it actual type.

◆ get_system_id()

internal::SystemId get_system_id ( ) const

(Internal) Gets the id of the System that created this output.

See System Compatibility.

◆ get_vector_data()

const BasicVector<T>* get_vector_data ( int  index) const

Returns the last-saved value of output port index as a BasicVector<T>, although the actual concrete type is preserved from the actual output port.

Exceptions
std::exceptionif the port is not vector-valued.

◆ GetMutableData()

AbstractValue* GetMutableData ( int  index)

(Advanced) Returns mutable access to an AbstractValue object that is suitable for holding the value of output port index of the allocating System.

This works for any output port regardless of it actual type. Most users should just call System<T>::CalcOutputs() to get all the output port values at once.

◆ GetMutableVectorData()

BasicVector<T>* GetMutableVectorData ( int  index)

(Advanced) Returns mutable access to a BasicVector<T> object that is suitable for holding the value of output port index of the allocating System.

The object's concrete type is preserved from the output port. Most users should just call System<T>::CalcOutputs() to get all the output port values at once.

Exceptions
std::exceptionif the port is not vector-valued.

◆ num_ports()

int num_ports ( ) const

Returns the number of output ports specified for this SystemOutput during allocation.

◆ operator=() [1/2]

SystemOutput& operator= ( const SystemOutput< T > &  )
default

◆ operator=() [2/2]

SystemOutput& operator= ( SystemOutput< T > &&  )
default

Friends And Related Function Documentation

◆ System< T >

friend class System< T >
friend

◆ SystemOutputTest

friend class SystemOutputTest
friend

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