Drake
FreestandingInputPortValue Class Reference

A FreestandingInputPortValue encapsulates a vector or abstract value for use as an internal value source for one of a System's input ports. More...

#include <systems/framework/input_port_value.h>

Inheritance diagram for FreestandingInputPortValue:
[legend]
Collaboration diagram for FreestandingInputPortValue:
[legend]

Public Member Functions

 FreestandingInputPortValue (std::unique_ptr< AbstractValue > data)
 Constructs an abstract-valued FreestandingInputPortValue from a value of arbitrary type. More...
 
bool requires_evaluation () const override
 A FreestandingInputPortValue does not require evaluation, because it controls its own data. More...
 
AbstractValueGetMutableData ()
 Returns a pointer to the data inside this FreestandingInputPortValue, and updates the version so that Contexts depending on this know to invalidate their caches. More...
 
template<typename T >
BasicVector< T > * GetMutableVectorData ()
 Returns a pointer to the data inside this FreestandingInputPortValue, and updates the version so that Contexts depending on this know to invalidate their caches. More...
 
Does not allow copy, move, or assignment
 FreestandingInputPortValue (const FreestandingInputPortValue &)=delete
 
FreestandingInputPortValueoperator= (const FreestandingInputPortValue &)=delete
 
 FreestandingInputPortValue (FreestandingInputPortValue &&)=delete
 
FreestandingInputPortValueoperator= (FreestandingInputPortValue &&)=delete
 
- Public Member Functions inherited from InputPortValue
virtual ~InputPortValue ()
 
const AbstractValueget_abstract_data () const
 Returns the data on this port, which must be connected to a value source. More...
 
template<typename T >
const BasicVector< T > * get_vector_data () const
 Returns the vector data on this port, which must be connected to a value source. More...
 
 InputPortValue (const InputPortValue &)=delete
 
InputPortValueoperator= (const InputPortValue &)=delete
 
 InputPortValue (InputPortValue &&)=delete
 
InputPortValueoperator= (InputPortValue &&)=delete
 

Protected Member Functions

const OutputPortValueget_output_port_value () const override
 
- Protected Member Functions inherited from InputPortValue
 InputPortValue ()
 

Detailed Description

A FreestandingInputPortValue encapsulates a vector or abstract value for use as an internal value source for one of a System's input ports.

Constructor & Destructor Documentation

FreestandingInputPortValue ( std::unique_ptr< AbstractValue data)
explicit

Constructs an abstract-valued FreestandingInputPortValue from a value of arbitrary type.

Takes ownership of data.

Member Function Documentation

const OutputPortValue* get_output_port_value ( ) const
inlineoverrideprotectedvirtual

Implements InputPortValue.

AbstractValue* GetMutableData ( )
inline

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

To ensure invalidation notifications are delivered, callers should call this method every time they wish to update the stored value. In particular, callers MUST NOT write through the returned pointer if there is any possibility this FreestandingInputPortValue has been accessed since the last time this method was called.

BasicVector<T>* GetMutableVectorData ( )
inline

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

Throws std::bad_cast if the data is not vector data.

To ensure invalidation notifications are delivered, callers should call this method every time they wish to update the stored value. In particular, callers MUST NOT write through the returned pointer if there is any possibility this FreestandingInputPortValue has been accessed since the last time this method was called.

Template Parameters
TElement type of the input port's vector value. Must be a valid Eigen scalar.

Here is the caller graph for this function:

FreestandingInputPortValue& operator= ( const FreestandingInputPortValue )
delete
bool requires_evaluation ( ) const
inlineoverridevirtual

A FreestandingInputPortValue does not require evaluation, because it controls its own data.

Implements InputPortValue.


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