diff options
author | rtk0c <[email protected]> | 2021-04-26 14:07:28 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-04-26 14:07:28 -0700 |
commit | b7d5b514e7bffd3149a99bc7f1424f8251876d85 (patch) | |
tree | 42f2867875c0b367fab2a6db7be395f8c777eb41 /core/src/Model/Workflow/Value.hpp | |
parent | e7afe82857ac3ccc3e10b40cee60ea94cc59232b (diff) |
Serialization for workflow stuff
Diffstat (limited to 'core/src/Model/Workflow/Value.hpp')
-rw-r--r-- | core/src/Model/Workflow/Value.hpp | 17 |
1 files changed, 15 insertions, 2 deletions
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 <iosfwd> +#include <memory> + 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<BaseValue> 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); }; |