aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/EvaluatedValue.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-04-14 15:09:13 -0700
committerrtk0c <[email protected]>2021-04-14 15:09:13 -0700
commit80d8ae5a6fef6c9a34e81e240539cb655dd99851 (patch)
tree062bb1590eaf030b75aae75acecc5706e16d9b0c /core/src/Model/EvaluatedValue.hpp
parent568fcc1dfe40c37b57b7baa2dea93b291d3fa956 (diff)
Initial work on workflows
Diffstat (limited to 'core/src/Model/EvaluatedValue.hpp')
-rw-r--r--core/src/Model/EvaluatedValue.hpp64
1 files changed, 64 insertions, 0 deletions
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 <chrono>
+#include <cstdint>
+#include <string>
+
+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<std::chrono::system_clock> mValue;
+
+public:
+ DateTimeValue();
+ const std::chrono::time_point<std::chrono::system_clock>& GetValue() const;
+ void SetValue(const std::chrono::time_point<std::chrono::system_clock>& value);
+};