xo-expression2/xo-process/include/xo/process/RealizationState.hpp
Roland Conybeare 2450ab4ed9 Add 'xo-process/' from commit '7cfc560f02'
git-subtree-dir: xo-process
git-subtree-mainline: abd08e3491
git-subtree-split: 7cfc560f02
2025-05-11 16:10:34 -05:00

42 lines
1.1 KiB
C++

/* file RealizationState.hpp
*
* author: Roland Conybeare, Nov 2022
*/
#pragma once
#include <utility>
/* opaque type representing state of an unfolding
* realization, for a StochasticProcess.
* Needs runtime polymorphism here so we can stack states
* e.g. to represent realization state for a process
* defined by transformation of another process.
* For example see ExpProcess.
* For now we don't refcount these; expect each process-realization
* to create its own stack, managed with unique_ptr<>
*
* See also:
* - ProcessRealization2
* - Realizable2Process
*/
class AbstractRealizationState {
public:
AbstractRealizationState() = default;
virtual ~AbstractRealizationState() = default;
}; /*RealizationState*/
template<typename Rstate>
class RealizationState : public AbstractRealizationState {
public:
RealizationState(Rstate const & rs) : rstate_{rs} {}
RealizationState(Rstate && rs) : rstate_{std::move(rs)} {}
Rstate * p_rstate() { return &rstate_; }
private:
Rstate rstate_;
}; /*RealizationState*/
/* end RealizationState.hpp */