From 7a325e1b3be04bc54941431458903022da1643ac Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 3 Jun 2021 10:06:55 -0700 Subject: Create template inheritance hierarchy, object value RTTI system --- core/src/Model/Workflow/Values/Database.hpp | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 core/src/Model/Workflow/Values/Database.hpp (limited to 'core/src/Model/Workflow/Values/Database.hpp') diff --git a/core/src/Model/Workflow/Values/Database.hpp b/core/src/Model/Workflow/Values/Database.hpp new file mode 100644 index 0000000..e8a4f83 --- /dev/null +++ b/core/src/Model/Workflow/Values/Database.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include "Model/Workflow/Value.hpp" +#include "Model/Workflow/Values/Basic.hpp" +#include "cplt_fwd.hpp" + +class DatabaseRowIdValue : public BaseValue +{ +private: + TableKind mTable; + int64_t mRowId; + +public: + static bool IsInstance(const BaseValue* value); + DatabaseRowIdValue(); + + TableKind GetTable() const; + int64_t GetRowId() const; +}; + +class SaleDatabaseRowValue : public BaseObjectValue +{ +private: + int mCustomerId; + TextValue mCustomerName; + DateTimeValue mDeadline; + DateTimeValue mDeliveryTime; + +public: + static bool IsInstance(const BaseValue* value); + SaleDatabaseRowValue(); + + virtual const BaseValue* GetProperty(int idx) const; + virtual bool SetProperty(int idx, std::unique_ptr value); +}; + +class PurchaseDatabaseRowValue : public BaseObjectValue +{ +private: + int mFactoryId; + TextValue mFactoryName; + DateTimeValue mOrderTime; + DateTimeValue mDeliveryTime; + +public: + static bool IsInstance(const BaseValue* value); + PurchaseDatabaseRowValue(); + + virtual const BaseValue* GetProperty(int idx) const; + virtual bool SetProperty(int idx, std::unique_ptr value); +}; -- cgit v1.2.3-70-g09d2