aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Workflow/Value.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-06-27 18:27:13 -0700
committerrtk0c <[email protected]>2022-06-27 18:27:13 -0700
commit8f0dda5eab181b0f14f2652b4e984aaaae3f258c (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /core/src/Model/Workflow/Value.hpp
parentfad6a88a13ab1f888ab25ad0aae19c1d63aa0623 (diff)
Start from a clean slate
Diffstat (limited to 'core/src/Model/Workflow/Value.hpp')
-rw-r--r--core/src/Model/Workflow/Value.hpp94
1 files changed, 0 insertions, 94 deletions
diff --git a/core/src/Model/Workflow/Value.hpp b/core/src/Model/Workflow/Value.hpp
deleted file mode 100644
index 2198674..0000000
--- a/core/src/Model/Workflow/Value.hpp
+++ /dev/null
@@ -1,94 +0,0 @@
-#pragma once
-
-#include "Utils/Color.hpp"
-#include "cplt_fwd.hpp"
-
-#include <iosfwd>
-#include <memory>
-#include <string>
-#include <vector>
-
-class BaseValue
-{
-public:
- enum Kind
- {
- KD_Numeric,
- KD_Text,
- KD_DateTime,
- KD_DatabaseRowId,
- KD_List,
- KD_Dictionary,
-
- KD_BaseObject,
- KD_SaleDatabaseRow,
- KD_PurchaseDatabaseRow,
- KD_BaseObjectLast = KD_PurchaseDatabaseRow,
-
- /// An unspecified type, otherwise known as "any" in some contexts.
- InvalidKind,
- KindCount = InvalidKind,
- };
-
- struct KindInfo
- {
- ImGui::IconType PinIcon;
- RgbaColor PinColor;
- };
-
-private:
- Kind mKind;
-
-public:
- static const KindInfo& QueryInfo(Kind kind);
- static const char* Format(Kind kind);
- static std::unique_ptr<BaseValue> CreateByKind(Kind kind);
-
- static bool IsInstance(const BaseValue* value);
-
- BaseValue(Kind kind);
- virtual ~BaseValue() = default;
-
- BaseValue(const BaseValue&) = delete;
- BaseValue& operator=(const BaseValue&) = delete;
- BaseValue(BaseValue&&) = default;
- BaseValue& operator=(BaseValue&&) = default;
-
- Kind GetKind() const;
-
- // TODO get constant editor
-
- /// The functions \c ReadFrom, \c WriteTo will only be valid to call if this function returns true.
- virtual bool SupportsConstant() const;
- virtual void ReadFrom(std::istream& stream);
- virtual void WriteTo(std::ostream& stream);
-};
-
-class BaseObjectDescription
-{
-public:
- struct Property
- {
- std::string Name;
- BaseValue::Kind Kind;
- bool Mutatable = true;
- };
-
-public:
- std::vector<Property> Properties;
-};
-
-class BaseObjectValue : public BaseValue
-{
-public:
- /// \param kind A value kind enum, within the range of KD_BaseObject and KD_BaseObjectLast (both inclusive).
- static const BaseObjectDescription& QueryObjectInfo(Kind kind);
-
- static bool IsInstance(const BaseValue* value);
- BaseObjectValue(Kind kind);
-
- const BaseObjectDescription& GetObjectDescription() const;
-
- virtual const BaseValue* GetProperty(int idx) const = 0;
- virtual bool SetProperty(int idx, std::unique_ptr<BaseValue> value) = 0;
-};