A fully type-erased container class.
More...
#include <drake/systems/framework/value.h>
A fully type-erased container class.
Only Value<T> should inherit directly from AbstractValue. User-defined classes that define additional type-erased features should inherit from Value<T>.
Returns the value wrapped in this AbstractValue, which must be of exactly type T.
T cannot be a superclass, abstract or otherwise. In Debug builds, if the types don't match, std::bad_cast will be thrown. In Release builds, this is not guaranteed. Intentionally not const: holders of const references to the AbstractValue should not be able to mutate the value it contains.
const T& GetValue |
( |
| ) |
const |
|
inline |
Returns the value wrapped in this AbstractValue, which must be of exactly type T.
T cannot be a superclass, abstract or otherwise. In Debug builds, if the types don't match, std::bad_cast will be thrown. In Release builds, this is not guaranteed.
void SetValue |
( |
const T & |
value_to_set | ) |
|
|
inline |
Sets the value wrapped in this AbstractValue, which must be of exactly type T.
T cannot be a superclass, abstract or otherwise.
- Parameters
-
value_to_set | The value to be copied into this AbstractValue. In Debug builds, if the types don't match, std::bad_cast will be thrown. In Release builds, this is not guaranteed. |
The documentation for this class was generated from the following file: