Drake
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LeafStateVector< T > Class Template Referenceabstract

LeafStateVector is an abstract class template that implements StateVector for leaf Systems, i.e. More...

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

Inheritance diagram for LeafStateVector< T >:
Collaboration diagram for LeafStateVector< T >:

Public Member Functions

std::unique_ptr< LeafStateVector< T > > Clone () const
 Copies the entire state to a new LeafStateVector. More...
 
- Public Member Functions inherited from StateVector< T >
virtual ~StateVector ()
 
virtual int size () const =0
 Returns the number of elements in the vector. More...
 
virtual const T GetAtIndex (int index) const =0
 Returns the element at the given index in the vector. More...
 
virtual void SetAtIndex (int index, const T &value)=0
 Replaces the state at the given index with the value. More...
 
virtual void SetFromVector (const Eigen::Ref< const VectorX< T >> &value)=0
 Replaces the entire state with the contents of value. More...
 
virtual VectorX< T > CopyToVector () const =0
 Copies the entire state to a vector with no semantics. More...
 
virtual void ScaleAndAddToVector (const T &scale, Eigen::Ref< VectorX< T >> vec) const
 Adds a scaled version of this state vector to Eigen vector vec, which must be the same size. More...
 
virtual StateVectorPlusEqScaled (const T &scale, const StateVector< T > &rhs)
 Add in scaled state vector rhs to this state vector. More...
 
StateVectoroperator+= (const StateVector< T > &rhs)
 Add in state vector rhs to this state vector. More...
 
StateVectoroperator-= (const StateVector< T > &rhs)
 Subtract in state vector rhs to this state vector. More...
 

Protected Member Functions

 LeafStateVector ()
 
virtual LeafStateVector< T > * DoClone () const =0
 Returns a new LeafStateVector containing a copy of the entire state. More...
 
- Protected Member Functions inherited from StateVector< T >
 StateVector ()
 

Detailed Description

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

LeafStateVector is an abstract class template that implements StateVector for leaf Systems, i.e.

Systems that are not Diagrams.

It introduces the additional Non-Virtual Interface method Clone(), with corresponding virtual implementation DoClone(). Children of LeafStateVector should override DoClone to return their concrete type.

Constructor & Destructor Documentation

LeafStateVector ( )
inlineprotected

Here is the call graph for this function:

Member Function Documentation

std::unique_ptr<LeafStateVector<T> > Clone ( ) const
inline

Copies the entire state to a new LeafStateVector.

Uses the Non-Virtual Interface idiom because smart pointers do not have type covariance.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual LeafStateVector<T>* DoClone ( ) const
protectedpure virtual

Returns a new LeafStateVector containing a copy of the entire state.

Caller must take ownership.

Implementations should ensure this operation is O(N) in the size of the value and allocates only the O(N) memory that it returns.

Here is the caller graph for this function:


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