diff --git a/schedulers/tetrisched/include/tetrisched/Expression.hpp b/schedulers/tetrisched/include/tetrisched/Expression.hpp index 038f19b8..dc1212c8 100644 --- a/schedulers/tetrisched/include/tetrisched/Expression.hpp +++ b/schedulers/tetrisched/include/tetrisched/Expression.hpp @@ -34,11 +34,32 @@ enum ParseResultType { /// the relevant start and finish times. EXPRESSION_UTILITY = 2, }; +using ParseResultType = enum ParseResultType; +using SolutionResultType = enum ParseResultType; + +template +class XOrVariableT { + private: + std::variant value; + + public: + /// Constructors and operators. + XOrVariableT() = default; + XOrVariableT(const X& newValue); + XOrVariableT(const VariablePtr& newValue); + XOrVariableT(const XOrVariableT& newValue) = default; + XOrVariableT(XOrVariableT&& newValue) = default; + XOrVariableT& operator=(const X& newValue); + XOrVariableT& operator=(const VariablePtr& newValue); + + /// Resolves the value inside this class. + X resolve() const; +}; /// A `ParseResult` class represents the result of parsing an expression. struct ParseResult { - using TimeOrVariableT = std::variant; - using IndicatorT = std::variant; + using TimeOrVariableT = XOrVariableT