From 80d8ae5a6fef6c9a34e81e240539cb655dd99851 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Wed, 14 Apr 2021 15:09:13 -0700 Subject: Initial work on workflows --- core/src/Model/EvaluatedValue.hpp | 64 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 core/src/Model/EvaluatedValue.hpp (limited to 'core/src/Model/EvaluatedValue.hpp') diff --git a/core/src/Model/EvaluatedValue.hpp b/core/src/Model/EvaluatedValue.hpp new file mode 100644 index 0000000..838fc39 --- /dev/null +++ b/core/src/Model/EvaluatedValue.hpp @@ -0,0 +1,64 @@ +#pragma once + +#include +#include +#include + +class BaseValue { +public: + enum Type { + NumericType, + TextType, + DateTimeType, + + /// An unspecified type, otherwise known as "any" in some contexts. + InvalidType, + TypeCount = InvalidType, + }; + +private: + Type mType; + +public: + BaseValue(Type type); + virtual ~BaseValue() = default; + + BaseValue(const BaseValue&) = delete; + BaseValue& operator=(const BaseValue&) = delete; + BaseValue(BaseValue&&) = default; + BaseValue& operator=(BaseValue&&) = default; + + Type GetType() const; +}; + +class NumericValue : public BaseValue { +private: + double mValue; + +public: + NumericValue(); + + int64_t GetInt() const; + double GetValue() const; + void SetValue(double value); +}; + +class TextValue : public BaseValue { +private: + std::string mValue; + +public: + TextValue(); + const std::string& GetValue() const; + void SetValue(const std::string& value); +}; + +class DateTimeValue : public BaseValue { +private: + std::chrono::time_point mValue; + +public: + DateTimeValue(); + const std::chrono::time_point& GetValue() const; + void SetValue(const std::chrono::time_point& value); +}; -- cgit v1.2.3-70-g09d2