Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
DiagramState< T > Class Template Reference

Detailed Description

template<typename T>
class drake::systems::DiagramState< T >

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.
void set_substate (int index, State< T > *substate)
 Sets the substate at index to substate, or aborts if index is out of bounds.
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.
const State< T > & get_substate (int index) const
 Returns the substate at index.
State< T > & get_mutable_substate (int index)
 Returns the substate at index.
void Finalize ()
 Finalizes this state as a span of all the constituent substates.
Does not allow copy, move, or assignment
 DiagramState (const DiagramState &)=delete
DiagramStateoperator= (const DiagramState &)=delete
 DiagramState (DiagramState &&)=delete
DiagramStateoperator= (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.
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.
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.
const AbstractValuesget_abstract_state () const
AbstractValuesget_mutable_abstract_state ()
 Returns a mutable reference to the abstract component of the state, which may be of size zero.
template<typename U>
const U & get_abstract_state (int index) const
 Returns a const pointer to the abstract component of the state at index.
template<typename U>
U & get_mutable_abstract_state (int index)
 Returns a mutable pointer to element index of the abstract state.
template<typename U>
void SetFrom (const State< U > &other)
 Initializes this state from a State.
 State (const State &)=delete
Stateoperator= (const State &)=delete
 State (State &&)=delete
Stateoperator= (State &&)=delete
internal::SystemId get_system_id () const
 (Internal use only) Gets the id of the subsystem that created this state.
void set_system_id (internal::SystemId id)
 (Internal use only) Records the id of the subsystem that created this state.

Constructor & Destructor Documentation

◆ DiagramState() [1/3]

template<typename T>
DiagramState ( const DiagramState< T > & )
delete

◆ DiagramState() [2/3]

template<typename T>
DiagramState ( DiagramState< T > && )
delete

◆ DiagramState() [3/3]

template<typename T>
DiagramState ( int size)
explicit

Constructs a DiagramState consisting of size substates.

Member Function Documentation

◆ Finalize()

template<typename T>
void Finalize ( )

Finalizes this state as a span of all the constituent substates.

◆ get_mutable_substate()

template<typename T>
State< T > & get_mutable_substate ( int index)

Returns the substate at index.

◆ get_substate()

template<typename T>
const State< T > & get_substate ( int index) const

Returns the substate at index.

◆ operator=() [1/2]

template<typename T>
DiagramState & operator= ( const DiagramState< T > & )
delete

◆ operator=() [2/2]

template<typename T>
DiagramState & operator= ( DiagramState< T > && )
delete

◆ set_and_own_substate()

template<typename T>
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.

◆ set_substate()

template<typename T>
void set_substate ( int index,
State< T > * substate )

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.


The documentation for this class was generated from the following file: