diff options
author | rtk0c <[email protected]> | 2021-08-15 09:17:02 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-08-15 09:17:02 -0700 |
commit | 64a6dbcfdb89a5f57d93d47a2be0c741dda4662d (patch) | |
tree | 241eaba2351f3a7e6343ce93532e19a4b93757d3 /core/src/Model/Workflow/Workflow.hpp | |
parent | f0326e5c5deca0fb719d8522b45c59364b566300 (diff) |
Fix issues and cleanup
- Fix compile error on MSVC where <vector> is not included properly
- Fix creating a workflow actually saves to the templates/ directory
- Fix renaming assets are not saved to disk
- TODO ser/deser still not working
- Cleanup AssetList::* pure virtual setup (fewer splits)
Diffstat (limited to 'core/src/Model/Workflow/Workflow.hpp')
-rw-r--r-- | core/src/Model/Workflow/Workflow.hpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/core/src/Model/Workflow/Workflow.hpp b/core/src/Model/Workflow/Workflow.hpp index cba0d72..c156582 100644 --- a/core/src/Model/Workflow/Workflow.hpp +++ b/core/src/Model/Workflow/Workflow.hpp @@ -7,13 +7,13 @@ #include <imgui_node_editor.h> #include <cstddef> -#include <span> #include <cstdint> #include <filesystem> #include <functional> #include <iosfwd> #include <limits> #include <memory> +#include <span> #include <string> #include <variant> #include <vector> @@ -41,7 +41,7 @@ public: void DrawDebugInfo() const; void ReadFrom(std::istream& stream); - void WriteTo(std::ostream& stream); + void WriteTo(std::ostream& stream) const; }; class WorkflowNode @@ -285,7 +285,7 @@ public: RR_InvalidVersion, }; ReadResult ReadFrom(std::istream& stream); - void WriteTo(std::ostream& stream); + void WriteTo(std::ostream& stream) const; private: std::pair<WorkflowConnection&, uint32_t> AllocWorkflowConnection(); @@ -303,21 +303,18 @@ public: // Inherit constructors using AssetListTyped::AssetListTyped; -public: - virtual void DiscoverFiles(const std::function<void(SavedAsset)>& callback) const override; - - virtual std::string RetrieveNameFromFile(const std::filesystem::path& file) const override; - virtual uuids::uuid RetrieveUuidFromFile(const std::filesystem::path& file) const override; - virtual std::filesystem::path RetrievePathFromAsset(const SavedAsset& asset) const override; - - virtual void SaveEmptyInstance(const SavedAsset& asset) const override; - virtual Workflow* CreateEmptyInstance(const SavedAsset& diskForm) const override; +protected: + void DiscoverFiles(const std::function<void(SavedAsset)>& callback) const override; - virtual Workflow* LoadImpl(const SavedAsset& diskForm) const override; + std::string RetrieveNameFromFile(const std::filesystem::path& file) const override; + uuids::uuid RetrieveUuidFromFile(const std::filesystem::path& file) const override; + std::filesystem::path RetrievePathFromAsset(const SavedAsset& asset) const override; - virtual void DisplayAssetCreator(ListState& state) override; + bool SaveInstance(const SavedAsset& assetInfo, const Asset* asset) const override; + Workflow* LoadInstance(const SavedAsset& assetInfo) const override; + Workflow* CreateInstance(const SavedAsset& assetInfo) const override; + bool RenameInstanceOnDisk(const SavedAsset& assetInfo, std::string_view oldName) const override; - virtual void SetupDetailsTable(const char* tableId) const override; - virtual void DrawBigIcon(ListState& state, const SavedAsset& asset) const override; - virtual void DrawDetailsTableRow(ListState& state, const SavedAsset& asset) const override; + void DisplayAssetCreator(ListState& state) override; + void DisplayDetailsTable(ListState& state) const override; }; |