template<typename T>
class drake::systems::DiagramDiscreteValues< T >
DiagramDiscreteValues is a DiscreteValues container comprised recursively of a sequence of child DiscreteValues objects.
The API allows this to be treated as though it were a single DiscreteValues object whose groups are the concatenation of the groups in each child.
The child objects may be owned or not. When this is used to aggregate LeafSystem discrete values in a Diagram, the child objects are not owned. When this is cloned, deep copies are made that are owned here.
|
| DiagramDiscreteValues (std::vector< DiscreteValues< T > * > subdiscretes) |
| Constructs a DiagramDiscreteValues object that is composed of other DiscreteValues, which are not owned by this object and must outlive it. More...
|
|
| DiagramDiscreteValues (std::vector< std::unique_ptr< DiscreteValues< T >>> owned_subdiscretes) |
| Constructs a DiagramDiscreteValues object that is composed (recursively) of other DiscreteValues objects, ownership of which is transferred here. More...
|
|
| ~DiagramDiscreteValues () override |
| Destructor deletes any owned DiscreteValues objects but does nothing if the referenced DiscreteValues objects are unowned. More...
|
|
std::unique_ptr< DiagramDiscreteValues > | Clone () const |
| Creates a deep copy of this DiagramDiscreteValues object, with the same substructure but with new, owned data. More...
|
|
int | num_subdiscretes () const |
| Returns the number of DiscreteValues objects referenced by this DiagramDiscreteValues object, necessarily the same as the number of subcontexts in the containing DiagramContext. More...
|
|
const DiscreteValues< T > & | get_subdiscrete (SubsystemIndex index) const |
| Returns a const reference to one of the referenced DiscreteValues objects which may or may not be owned locally. More...
|
|
DiscreteValues< T > & | get_mutable_subdiscrete (SubsystemIndex index) |
| Returns a mutable reference to one of the referenced DiscreteValues objects which may or may not be owned locally. More...
|
|
|
| DiagramDiscreteValues (const DiagramDiscreteValues &)=delete |
|
DiagramDiscreteValues & | operator= (const DiagramDiscreteValues &)=delete |
|
| DiagramDiscreteValues (DiagramDiscreteValues &&)=delete |
|
DiagramDiscreteValues & | operator= (DiagramDiscreteValues &&)=delete |
|
| DiscreteValues () |
| Constructs an empty DiscreteValues object containing no groups. More...
|
|
| DiscreteValues (const std::vector< BasicVector< T > * > &data) |
| Constructs a DiscreteValues that does not own the underlying data . More...
|
|
| DiscreteValues (std::vector< std::unique_ptr< BasicVector< T >>> &&data) |
| Constructs a DiscreteValues that owns the underlying data . More...
|
|
| DiscreteValues (std::unique_ptr< BasicVector< T >> datum) |
| Constructs a one-group DiscreteValues object that owns a single datum vector which may not be null. More...
|
|
int | AppendGroup (std::unique_ptr< BasicVector< T >> datum) |
| Adds an additional group that owns the given datum , which must be non-null. More...
|
|
virtual | ~DiscreteValues () |
|
int | num_groups () const |
|
const std::vector< BasicVector< T > * > & | get_data () const |
|
template<typename U > |
void | SetFrom (const DiscreteValues< U > &other) |
| Resets the values in this DiscreteValues from the values in other , possibly writing through to unowned data. More...
|
|
std::unique_ptr< DiscreteValues< T > > | Clone () const |
| Creates a deep copy of this object with the same substructure but with all data owned by the copy. More...
|
|
| DiscreteValues (const DiscreteValues &)=delete |
|
DiscreteValues & | operator= (const DiscreteValues &)=delete |
|
| DiscreteValues (DiscreteValues &&)=delete |
|
DiscreteValues & | operator= (DiscreteValues &&)=delete |
|
int | size () const |
| Returns the number of elements in the only DiscreteValues group. More...
|
|
T & | operator[] (std::size_t idx) |
| Returns a mutable reference to an element in the only group. More...
|
|
const T & | operator[] (std::size_t idx) const |
| Returns a const reference to an element in the only group. More...
|
|
const VectorX< T > & | value () const |
| Returns a const reference to the underlying VectorX containing the values for the only group. More...
|
|
void | set_value (const Eigen::Ref< const VectorX< T >> &value) |
| Sets the vector to the given value for the only group. More...
|
|
Eigen::VectorBlock< VectorX< T > > | get_mutable_value () |
| Returns the entire vector for the only group as a mutable Eigen::VectorBlock, which allows mutation of the values, but does not allow resize() to be called on the vector. More...
|
|
const BasicVector< T > & | get_vector () const |
| (Advanced) Returns a const reference to the BasicVector containing the values for the only group. More...
|
|
BasicVector< T > & | get_mutable_vector () |
| (Advanced) Returns a mutable reference to the BasicVector containing the values for the only group. More...
|
|
Eigen::VectorBlock< const VectorX< T > > | get_value () const |
| (Don't use this in new code) Returns the entire vector as a const Eigen::VectorBlock for the only group. More...
|
|
const VectorX< T > & | value (int index) const |
| Returns a const reference to the underlying VectorX containing the values for the indicated group. More...
|
|
Eigen::VectorBlock< VectorX< T > > | get_mutable_value (int index) |
| Returns the entire vector for the indicated group as a mutable Eigen::VectorBlock, which allows mutation of the values, but does not allow resize() to be called on the vector. More...
|
|
void | set_value (int index, const Eigen::Ref< const VectorX< T >> &value) |
| Sets the vector to the given value for the indicated group. More...
|
|
const BasicVector< T > & | get_vector (int index) const |
| (Advanced) Returns a const reference to the BasicVector holding data for the indicated group. More...
|
|
BasicVector< T > & | get_mutable_vector (int index) |
| (Advanced) Returns a mutable reference to the BasicVector holding data for the indicated group. More...
|
|
Eigen::VectorBlock< const VectorX< T > > | get_value (int index) const |
| (Don't use this in new code) Returns the entire vector as a const Eigen::VectorBlock for the indicated group. More...
|
|
internal::SystemId | get_system_id () const |
| (Internal use only) Gets the id of the subsystem that created this object. More...
|
|
void | set_system_id (internal::SystemId id) |
| (Internal use only) Records the id of the subsystem that created this object. More...
|
|