AbstractValues is a container for non-numerical state and parameters.
It may or may not own the underlying data, and therefore is suitable for both leaf Systems and diagrams.
#include <drake/systems/framework/abstract_values.h>
Public Member Functions | |
AbstractValues () | |
Constructs an empty AbstractValues. More... | |
AbstractValues (std::vector< std::unique_ptr< AbstractValue >> &&data) | |
Constructs an AbstractValues that owns the underlying data. More... | |
AbstractValues (const std::vector< AbstractValue * > &data) | |
Constructs an AbstractValues that does not own the underlying data. More... | |
AbstractValues (std::unique_ptr< AbstractValue > datum) | |
Constructs an AbstractValues that owns a single datum . More... | |
virtual | ~AbstractValues () |
int | size () const |
Returns the number of elements of AbstractValues. More... | |
const AbstractValue & | get_value (int index) const |
Returns the element of AbstractValues at the given index , or aborts if the index is out-of-bounds. More... | |
AbstractValue & | get_mutable_value (int index) |
Returns the element of AbstractValues at the given index , or aborts if the index is out-of-bounds. More... | |
void | SetFrom (const AbstractValues &other) |
Copies all of the AbstractValues in other into this. More... | |
std::unique_ptr< AbstractValues > | Clone () const |
Returns a deep copy of all the data in this AbstractValues. More... | |
Does not allow copy, move, or assignment | |
AbstractValues (const AbstractValues &)=delete | |
AbstractValues & | operator= (const AbstractValues &)=delete |
AbstractValues (AbstractValues &&)=delete | |
AbstractValues & | operator= (AbstractValues &&)=delete |
|
delete |
|
delete |
AbstractValues | ( | ) |
Constructs an empty AbstractValues.
|
explicit |
Constructs an AbstractValues that owns the underlying data.
|
explicit |
Constructs an AbstractValues that does not own the underlying data.
|
explicit |
Constructs an AbstractValues that owns a single datum
.
|
virtual |
std::unique_ptr<AbstractValues> Clone | ( | ) | const |
Returns a deep copy of all the data in this AbstractValues.
The clone will own its own data. This is true regardless of whether the data being cloned had ownership of its data or not.
AbstractValue& get_mutable_value | ( | int | index | ) |
Returns the element of AbstractValues at the given index
, or aborts if the index is out-of-bounds.
const AbstractValue& get_value | ( | int | index | ) | const |
Returns the element of AbstractValues at the given index
, or aborts if the index is out-of-bounds.
|
delete |
|
delete |
void SetFrom | ( | const AbstractValues & | other | ) |
Copies all of the AbstractValues in other
into this.
Asserts if the two are not equal in size.
std::exception | if any of the elements are of incompatible type. |
int size | ( | ) | const |
Returns the number of elements of AbstractValues.