Drake
Drake C++ Documentation
FixedInputPortValue Class Reference

Detailed Description

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

The semantics are identical to a Parameter. We assign a DependencyTracker to this object and subscribe the InputPort to it when that port is fixed. Any modification to the value here issues a notification to its dependent, and increments a serial number kept here.

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

Public Member Functions

 ~FixedInputPortValue ()=default
 
const AbstractValueget_value () const
 Returns a reference to the contained abstract value. More...
 
template<typename T >
const BasicVector< T > & get_vector_value () const
 Returns a reference to the contained BasicVector<T> or throws an exception if this doesn't contain an object of that type. More...
 
AbstractValueGetMutableData ()
 Returns a pointer to the data inside this FixedInputPortValue, and notifies the dependent input port that the value has changed. More...
 
template<typename T >
BasicVector< T > * GetMutableVectorData ()
 Returns a pointer to the data inside this FixedInputPortValue, and notifies the dependent input port that the value has changed, invalidating downstream computations. More...
 
int64_t serial_number () const
 Returns the serial number of the contained value. More...
 
DependencyTicket ticket () const
 Returns the ticket used to find the associated DependencyTracker. More...
 
const ContextBaseget_owning_context () const
 Returns a const reference to the context that owns this object. More...
 
Does not allow move or assignment; copy is private.
 FixedInputPortValue (FixedInputPortValue &&)=delete
 
FixedInputPortValueoperator= (const FixedInputPortValue &)=delete
 
FixedInputPortValueoperator= (FixedInputPortValue &&)=delete
 

Friends

class internal::ContextBaseFixedInputAttorney
 
class copyable_unique_ptr< FixedInputPortValue >
 

Constructor & Destructor Documentation

◆ FixedInputPortValue()

◆ ~FixedInputPortValue()

~FixedInputPortValue ( )
default

Member Function Documentation

◆ get_owning_context()

const ContextBase& get_owning_context ( ) const

Returns a const reference to the context that owns this object.

◆ get_value()

const AbstractValue& get_value ( ) const

Returns a reference to the contained abstract value.

◆ get_vector_value()

const BasicVector<T>& get_vector_value ( ) const

Returns a reference to the contained BasicVector<T> or throws an exception if this doesn't contain an object of that type.

◆ GetMutableData()

AbstractValue* GetMutableData ( )

Returns a pointer to the data inside this FixedInputPortValue, and notifies the dependent input port that the value has changed.

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 FixedInputPortValue has been accessed since the last time this method was called.

◆ GetMutableVectorData()

BasicVector<T>* GetMutableVectorData ( )

Returns a pointer to the data inside this FixedInputPortValue, and notifies the dependent input port that the value has changed, invalidating downstream computations.

Exceptions
std::exceptionif 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 FixedInputPortValue has been accessed since the last time this method was called.

Template Parameters
TScalar type of the input port's vector value. Must match the type associated with this port.

◆ operator=() [1/2]

FixedInputPortValue& operator= ( const FixedInputPortValue )
delete

◆ operator=() [2/2]

FixedInputPortValue& operator= ( FixedInputPortValue &&  )
delete

◆ serial_number()

int64_t serial_number ( ) const

Returns the serial number of the contained value.

This counts up every time the contained value changes, or when mutable access is granted.

◆ ticket()

DependencyTicket ticket ( ) const

Returns the ticket used to find the associated DependencyTracker.

Friends And Related Function Documentation

◆ copyable_unique_ptr< FixedInputPortValue >

friend class copyable_unique_ptr< FixedInputPortValue >
friend

◆ internal::ContextBaseFixedInputAttorney

friend class internal::ContextBaseFixedInputAttorney
friend

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