Class Scine::Core::StateHandableObject

class StateHandableObject

An interface for all objects that should have a handable state.

All objects that have a state or a configuration that should be extractable and loadable should inherit from this interface.

The state of such an object is to be encoded into a class derived from State. A state should represent a momentary snapshot of a given object

Each such object must then implement the loadState() and getState() functions which are hooks for further utilities. These utilities, such as a StatesHandler can be found in the Scine::Utils namespace/repository.

Subclassed by Scine::Core::Calculator, Scine::Core::WavefunctionOutputGenerator

Public Functions

StateHandableObject()

Default constructor.

virtual ~StateHandableObject()

Default destrucor.

virtual void loadState(std::shared_ptr<State> state) = 0

Loads a given state into the object.

Note that the loaded state may be mutated by the object. It is not necessarily copied into the object, even though this is likely the default behaviour. Please read the documentation of the specific implementation for further details.

Parameters
  • state: The state to be loaded into the object.

virtual std::shared_ptr<State> getState() const = 0

Get the current state of the object.

Note that the state is possibly a mutable representation of the current state of the object.It is not necessarily a deepcopy, eventhough this is likely the default behaviour. Please read the documentation of the specific implementation for further details.

Return

std::shared_ptr<State> The current state of the object.