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 AbstractValue & | get_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... | |
AbstractValue * | GetMutableData () |
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 ContextBase & | get_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 | |
FixedInputPortValue & | operator= (const FixedInputPortValue &)=delete |
FixedInputPortValue & | operator= (FixedInputPortValue &&)=delete |
Friends | |
class | internal::ContextBaseFixedInputAttorney |
class | copyable_unique_ptr< FixedInputPortValue > |
|
delete |
|
default |
const ContextBase& get_owning_context | ( | ) | const |
Returns a const reference to the context that owns this object.
const AbstractValue& get_value | ( | ) | const |
Returns a reference to the contained abstract 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.
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.
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.
std::exception | 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 FixedInputPortValue has been accessed since the last time this method was called.
T | Scalar type of the input port's vector value. Must match the type associated with this port. |
|
delete |
|
delete |
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.
DependencyTicket ticket | ( | ) | const |
Returns the ticket used to find the associated DependencyTracker.
|
friend |
|
friend |