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.
T | The 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 AbstractValue * | get_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... | |
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. 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 | |
SystemOutput & | operator= (const SystemOutput &)=default |
SystemOutput (SystemOutput &&)=default | |
SystemOutput & | operator= (SystemOutput &&)=default |
Friends | |
class | System< T > |
class | SystemOutputTest |
|
default |
|
default |
|
default |
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.
internal::SystemId get_system_id | ( | ) | const |
(Internal) Gets the id of the System that created this output.
See System Compatibility.
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.
std::exception | if the port is not vector-valued. |
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.
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.
std::exception | if the port is not vector-valued. |
int num_ports | ( | ) | const |
Returns the number of output ports specified for this SystemOutput during allocation.
|
default |
|
default |
|
friend |
|
friend |