Drake
DiagramState< T > Class Template Reference

DiagramState is a State, annotated with pointers to all the mutable substates that it spans. More...

#include <drake/systems/framework/diagram_context.h>

Inheritance diagram for DiagramState< T >:
[legend]
Collaboration diagram for DiagramState< T >:
[legend]

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)
 
const ContinuousState< T > & get_continuous_state () const
 
ContinuousState< T > & get_mutable_continuous_state ()
 
void set_discrete_state (std::unique_ptr< DiscreteValues< T >> xd)
 
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)
 
const AbstractValuesget_abstract_state () const
 
AbstractValuesget_mutable_abstract_state ()
 
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...
 
void CopyFrom (const State< T > &other)
 Copies the values from another State of the same scalar type into this State. More...
 
void SetFrom (const State< double > &other)
 Initializes this state (regardless of scalar type) from a State<double>. More...
 
 State (const State &)=delete
 
Stateoperator= (const State &)=delete
 
 State (State &&)=delete
 
Stateoperator= (State &&)=delete
 

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.

Constructor & Destructor Documentation

DiagramState ( const DiagramState< T > &  )
delete
DiagramState ( DiagramState< T > &&  )
delete
DiagramState ( int  size)
inlineexplicit

Constructs a DiagramState consisting of size substates.

Member Function Documentation

void Finalize ( )
inline

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

State<T>& get_mutable_substate ( int  index)
inline

Returns the substate at index.

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

Returns the substate at index.

DiagramState& operator= ( DiagramState< T > &&  )
delete
DiagramState& operator= ( const DiagramState< T > &  )
delete
void set_and_own_substate ( int  index,
std::unique_ptr< State< T >>  substate 
)
inline

Sets the substate at index to substate, or aborts if index is out of bounds.

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

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.

Here is the caller graph for this function:


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