DART  6.7.3
dart::common::Aspect::State Class Referenceabstract

If your Aspect has a State, then that State class should inherit this Aspect::State class. More...

#include <Aspect.hpp>

Inheritance diagram for dart::common::Aspect::State:
dart::common::Cloneable< State >

Public Member Functions

virtual std::unique_ptr< Stateclone () const=0
 Implement this function to allow your Cloneable type to be copied safely. More...
 
virtual void copy (const State &anotherCloneable)=0
 Copy the contents of anotherCloneable into this one. More...
 

Detailed Description

If your Aspect has a State, then that State class should inherit this Aspect::State class.

This allows us to safely serialize, store, and clone the states of arbitrary Aspect extensions. If your Aspect is stateless, then you do not have to worry about extending this class, because Aspect::getState() will simply return a nullptr by default, which is taken to indicate that it is stateless.

The distinction between the State class and the Properties class is that State will get stored in Composite::State whereas Properties will get stored in Composite::Properties. Typically Properties are values that only change rarely if ever, whereas State contains values that might change as often as every time step.

Member Function Documentation

◆ clone()

virtual std::unique_ptr<State > dart::common::Cloneable< State >::clone ( ) const
pure virtualinherited

Implement this function to allow your Cloneable type to be copied safely.

◆ copy()

virtual void dart::common::Cloneable< State >::copy ( const State &  anotherCloneable)
pure virtualinherited

Copy the contents of anotherCloneable into this one.