|
Drake
|
A container class for an arbitrary type T. More...
#include <drake/systems/framework/value.h>


Public Member Functions | |
| Value (const T &v) | |
| Value (const Value< T > &other)=default | |
| Value & | operator= (const Value< T > &other)=default |
| Value (Value< T > &&other)=delete | |
| Value & | operator= (Value< T > &&other)=delete |
| std::unique_ptr< AbstractValue > | Clone () const override |
| Returns a copy of this AbstractValue. More... | |
| const T & | get_value () const |
| Returns a const reference to the stored value. More... | |
| T * | get_mutable_value () |
| Returns a mutable pointer to the stored value (never null). More... | |
| void | set_value (const T &v) |
| Replaces the stored value with a new one. More... | |
Public Member Functions inherited from AbstractValue | |
| AbstractValue () | |
| virtual | ~AbstractValue () |
| template<typename T > | |
| const T & | GetValue () const |
| Returns the value wrapped in this AbstractValue, which must be of exactly type T. More... | |
| template<typename T > | |
| T * | GetMutableValue () |
| Returns the value wrapped in this AbstractValue, which must be of exactly type T. More... | |
| template<typename T > | |
| void | SetValue (const T &value_to_set) |
| Sets the value wrapped in this AbstractValue, which must be of exactly type T. More... | |
A container class for an arbitrary type T.
User-defined classes that require additional type-erased features should subclass Value<T>, taking care to define the copy constructors and override Clone().
| T | Must be copy-constructible, and therefore not abstract. |
|
inlineexplicit |
|
inlineoverridevirtual |
Returns a copy of this AbstractValue.
Implements AbstractValue.
|
inline |
Returns a mutable pointer to the stored value (never null).
|
inline |
Returns a const reference to the stored value.
|
inline |
Replaces the stored value with a new one.