DiagramState is a State, annotated with pointers to all the mutable substates that it spans.
#include <drake/systems/framework/diagram_state.h>
Public Member Functions | |
DiagramState (int size) | |
Constructs a DiagramState consisting of size substates. More... | |
void | set_substate (int index, State< T > *substate) |
Sets the substate at index to substate , or aborts if index is out of bounds. More... | |
void | set_and_own_substate (int index, std::unique_ptr< State< T >> substate) |
Sets the substate at index to substate , or aborts if index is out of bounds. More... | |
const State< T > & | get_substate (int index) const |
Returns the substate at index . More... | |
State< T > & | get_mutable_substate (int index) |
Returns the substate at index . More... | |
void | Finalize () |
Finalizes this state as a span of all the constituent substates. More... | |
Does not allow copy, move, or assignment | |
DiagramState (const DiagramState &)=delete | |
DiagramState & | operator= (const DiagramState &)=delete |
DiagramState (DiagramState &&)=delete | |
DiagramState & | operator= (DiagramState &&)=delete |
Public Member Functions inherited from State< T > | |
State () | |
virtual | ~State () |
void | set_continuous_state (std::unique_ptr< ContinuousState< T >> xc) |
(Advanced) Defines the continuous state variables for this State. More... | |
const ContinuousState< T > & | get_continuous_state () const |
ContinuousState< T > & | get_mutable_continuous_state () |
void | set_discrete_state (std::unique_ptr< DiscreteValues< T >> xd) |
(Advanced) Defines the discrete state variables for this State. More... | |
const DiscreteValues< T > & | get_discrete_state () const |
DiscreteValues< T > & | get_mutable_discrete_state () |
const BasicVector< T > & | get_discrete_state (int index) const |
BasicVector< T > & | get_mutable_discrete_state (int index) |
void | set_abstract_state (std::unique_ptr< AbstractValues > xa) |
(Advanced) Defines the abstract state variables for this State. More... | |
const AbstractValues & | get_abstract_state () const |
AbstractValues & | get_mutable_abstract_state () |
Returns a mutable reference to the abstract component of the state, which may be of size zero. More... | |
template<typename U > | |
const U & | get_abstract_state (int index) const |
Returns a const pointer to the abstract component of the state at index . More... | |
template<typename U > | |
U & | get_mutable_abstract_state (int index) |
Returns a mutable pointer to element index of the abstract state. More... | |
template<typename U > | |
void | SetFrom (const State< U > &other) |
Initializes this state from a State. More... | |
State (const State &)=delete | |
State & | operator= (const State &)=delete |
State (State &&)=delete | |
State & | operator= (State &&)=delete |
internal::SystemId | get_system_id () const |
(Internal use only) Gets the id of the subsystem that created this state. More... | |
void | set_system_id (internal::SystemId id) |
(Internal use only) Records the id of the subsystem that created this state. More... | |
|
delete |
|
delete |
|
explicit |
Constructs a DiagramState consisting of size
substates.
void Finalize | ( | ) |
Finalizes this state as a span of all the constituent substates.
|
delete |
|
delete |
Sets the substate at index
to substate
, or aborts if index
is out of bounds.
Sets the substate at index
to substate
, or aborts if index
is out of bounds.
Does not take ownership of substate
, which must live as long as this object.