From b7d5b514e7bffd3149a99bc7f1424f8251876d85 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Mon, 26 Apr 2021 14:07:28 -0700 Subject: Serialization for workflow stuff --- core/src/Model/Workflow/Value.hpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'core/src/Model/Workflow/Value.hpp') diff --git a/core/src/Model/Workflow/Value.hpp b/core/src/Model/Workflow/Value.hpp index eb99c14..2748e16 100644 --- a/core/src/Model/Workflow/Value.hpp +++ b/core/src/Model/Workflow/Value.hpp @@ -1,5 +1,8 @@ #pragma once +#include +#include + class BaseValue { public: enum Kind { @@ -8,14 +11,17 @@ public: KD_DateTime, /// An unspecified type, otherwise known as "any" in some contexts. - KindInvalid, - KindCount = KindInvalid, + InvalidKind, + KindCount = InvalidKind, }; private: Kind mKind; public: + static const char* FormatKind(Kind kind); + static std::unique_ptr CreateByKind(Kind kind); + BaseValue(Kind kind); virtual ~BaseValue() = default; @@ -25,4 +31,11 @@ public: 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); }; -- cgit v1.2.3-70-g09d2