Drake
Drake C++ Documentation
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. 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
 
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. 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 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. 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
 
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. More...
 
void set_system_id (internal::SystemId id)
 (Internal use only) Records the id of the subsystem that created this state. More...
 

Constructor & Destructor Documentation

◆ DiagramState() [1/3]

DiagramState ( const DiagramState< T > &  )
delete

◆ DiagramState() [2/3]

DiagramState ( DiagramState< T > &&  )
delete

◆ DiagramState() [3/3]

DiagramState ( int  size)
explicit

Constructs a DiagramState consisting of size substates.

Member Function Documentation

◆ Finalize()

void Finalize ( )

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

◆ get_mutable_substate()

State<T>& get_mutable_substate ( int  index)

Returns the substate at index.

◆ get_substate()

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

Returns the substate at index.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ set_and_own_substate()

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()

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: