Drake
OutputPortValue Class Reference

OutputPortValue contains the value of a single System output port. More...

#include <systems/framework/output_port_value.h>

Public Member Functions

template<template< typename T > class V, typename T >
 OutputPortValue (std::unique_ptr< V< T >> vec)
 Constructs a vector-valued OutputPortValue. More...
 
 OutputPortValue (std::unique_ptr< AbstractValue > data)
 Constructs an abstract-valued OutputPortValue. More...
 
template<typename T >
 OutputPortValue (std::unique_ptr< Value< T >> data)
 Constructs an abstract-valued OutputPortValue. More...
 
virtual ~OutputPortValue ()
 
const AbstractValueget_abstract_data () const
 Returns the abstract value in this port. More...
 
template<typename T >
const BasicVector< T > * get_vector_data () const
 Returns the vector of data in this output port. More...
 
int64_t get_version () const
 Returns a positive and monotonically increasing number that is guaranteed to change whenever GetMutableVectorData is called. More...
 
void add_dependent (detail::OutputPortListenerInterface *dependent)
 Registers dependent to receive invalidation notifications whenever this port's version number is incremented. More...
 
void remove_dependent (detail::OutputPortListenerInterface *dependent)
 Unregisters dependent from invalidation notifications. More...
 
AbstractValueGetMutableData ()
 Returns a pointer to the data inside this OutputPortValue, and updates the version so that Contexts depending on this OutputPortValue know to invalidate their caches. More...
 
template<typename T >
BasicVector< T > * GetMutableVectorData ()
 Returns a pointer to the data inside this OutputPortValue, and updates the version so that Contexts depending on this OutputPortValue know to invalidate their caches. More...
 
std::unique_ptr< OutputPortValueClone () const
 Returns a clone of this OutputPortValue containing a clone of the data, but without any dependents. More...
 
Does not allow copy, move, or assignment
 OutputPortValue (const OutputPortValue &)=delete
 
OutputPortValueoperator= (const OutputPortValue &)=delete
 
 OutputPortValue (OutputPortValue &&)=delete
 
OutputPortValueoperator= (OutputPortValue &&)=delete
 

Detailed Description

OutputPortValue contains the value of a single System output port.

Input ports of other Systems may depend on an OutputPortValue. When an OutputPortValue is deleted, it will automatically notify the listeners that depend on it to disconnect, meaning those ports will resolve to nullptr.

Constructor & Destructor Documentation

OutputPortValue ( const OutputPortValue )
delete
OutputPortValue ( std::unique_ptr< V< T >>  vec)
inlineexplicit

Constructs a vector-valued OutputPortValue.

Takes ownership of vec.

Template Parameters
TThe type of the vector data. Must be a valid Eigen scalar.
VThe type of vec itself. Must implement BasicVector<T>.
OutputPortValue ( std::unique_ptr< AbstractValue data)
inlineexplicit

Constructs an abstract-valued OutputPortValue.

Takes ownership of data.

OutputPortValue ( std::unique_ptr< Value< T >>  data)
inlineexplicit

Constructs an abstract-valued OutputPortValue.

Takes ownership of data.

Template Parameters
TThe type of the data.

Here is the call graph for this function:

~OutputPortValue ( )
virtual

Here is the caller graph for this function:

Member Function Documentation

void add_dependent ( detail::OutputPortListenerInterface dependent)
inline

Registers dependent to receive invalidation notifications whenever this port's version number is incremented.

Here is the caller graph for this function:

std::unique_ptr< OutputPortValue > Clone ( ) const

Returns a clone of this OutputPortValue containing a clone of the data, but without any dependents.

Here is the caller graph for this function:

const AbstractValue* get_abstract_data ( ) const
inline

Returns the abstract value in this port.

Here is the caller graph for this function:

const BasicVector<T>* get_vector_data ( ) const
inline

Returns the vector of data in this output port.

Throws std::bad_cast if this is not a vector-valued port.

Here is the caller graph for this function:

int64_t get_version ( ) const
inline

Returns a positive and monotonically increasing number that is guaranteed to change whenever GetMutableVectorData is called.

AbstractValue* GetMutableData ( )
inline

Returns a pointer to the data inside this OutputPortValue, and updates the version so that Contexts depending on this OutputPortValue know to invalidate their caches.

Callers MUST NOT write on the returned pointer if there is any possibility this OutputPortValue has been accessed since the last time GetMutableData() was called.

BasicVector<T>* GetMutableVectorData ( )
inline

Returns a pointer to the data inside this OutputPortValue, and updates the version so that Contexts depending on this OutputPortValue know to invalidate their caches.

Callers MUST NOT write on the returned pointer if there is any possibility this OutputPortValue has been accessed since the last time GetMutableVectorData() was called.

Throws std::bad_cast if this is not a vector-valued port.

Here is the call graph for this function:

OutputPortValue& operator= ( const OutputPortValue )
delete
OutputPortValue& operator= ( OutputPortValue &&  )
delete
void remove_dependent ( detail::OutputPortListenerInterface dependent)
inline

Unregisters dependent from invalidation notifications.

Here is the caller graph for this function:


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