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 <drake/systems/framework/input_port_value.h>

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

Public Member Functions

template<template< typename T > class V, typename T >
 FreestandingInputPortValue (std::unique_ptr< V< T >> vec)
 Constructs a vector-valued FreestandingInputPortValue. More...
 
 FreestandingInputPortValue (std::unique_ptr< AbstractValue > data)
 Constructs an abstract-valued FreestandingInputPortValue from a value of unknown type. More...
 
template<typename T >
 FreestandingInputPortValue (std::unique_ptr< Value< T >> data)
 Constructs an abstract-valued FreestandingInputPortValue from a value of currently-known type. More...
 
 ~FreestandingInputPortValue () override
 
int64_t get_version () const override
 Returns a positive and monotonically increasing number that is guaranteed to change whenever GetMutableVectorData is called. 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...
 
void Disconnect () override
 Does nothing. 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
 ~InputPortValue () override
 
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...
 
void set_invalidation_callback (std::function< void()> callback)
 Registers callback to be called whenever the value source on which this InputPortValue depends. More...
 
void Invalidate () override
 Receives notification that the value source on which this InputPortValue depends has changed, and calls the invalidation callback. More...
 
 InputPortValue (const InputPortValue &)=delete
 
InputPortValueoperator= (const InputPortValue &)=delete
 
 InputPortValue (InputPortValue &&)=delete
 
InputPortValueoperator= (InputPortValue &&)=delete
 
- Public Member Functions inherited from OutputPortListenerInterface
 OutputPortListenerInterface ()
 
virtual ~OutputPortListenerInterface ()
 
 OutputPortListenerInterface (const OutputPortListenerInterface &)=delete
 
OutputPortListenerInterfaceoperator= (const OutputPortListenerInterface &)=delete
 
 OutputPortListenerInterface (OutputPortListenerInterface &&)=delete
 
OutputPortListenerInterfaceoperator= (OutputPortListenerInterface &&)=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< V< T >>  vec)
inlineexplicit

Constructs a vector-valued FreestandingInputPortValue.

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>.
FreestandingInputPortValue ( std::unique_ptr< AbstractValue data)
explicit

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

Takes ownership of data.

Here is the call graph for this function:

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

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

This will become a type-erased AbstractValue here but a knowledgeable caller can recover the original typed object using dynamic_cast. Takes ownership of data.

Template Parameters
TThe type of the data.

Here is the call graph for this function:

Member Function Documentation

void Disconnect ( )
inlineoverridevirtual

Does nothing.

A FreestandingInputPortValue wraps its own OutputPortValue, so there is no need to handle destruction of an output port.

Implements OutputPortListenerInterface.

const OutputPortValue* get_output_port_value ( ) const
inlineoverrideprotectedvirtual

Implements InputPortValue.

int64_t get_version ( ) const
inlineoverridevirtual

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

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: