FOSSredder 0.5.0
Loading...
Searching...
No Matches
IStorageManager.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <functional>
9#include <memory>
10#include <optional>
11#include <string>
12
15
16namespace core::ports::storage {
17
19public:
23 using AtomicStoreSave = std::function<core::domain::DeletionImpact(const std::string& dbPath, const core::application::workspace::WorkspaceSessionState& document)>;
24 using AtomicStoreLoad = std::function<core::application::workspace::WorkspaceSessionState(const std::string& dbPath)>;
25 using DeletionImpactCallback = std::function<void(const core::domain::DeletionImpact&)>;
26
27 virtual ~IStorageManager() = default;
28
33 virtual void setAtomicStoreSave(AtomicStoreSave saveFn) = 0;
34
39 virtual void setAtomicStoreLoad(AtomicStoreLoad loadFn) = 0;
40
46
51 virtual std::optional<std::string> loadLatestPath() const = 0;
52
58 virtual core::application::workspace::WorkspaceSessionState loadFrom(const std::string& filePath) = 0;
59
65
71 virtual void saveAs(const std::string& filePath, const core::application::workspace::WorkspaceSessionState& document) = 0;
72
77 virtual void createNew(const std::string& filePath) = 0;
78
83 virtual const std::string& currentPath() const noexcept = 0;
84};
85
86} // namespace core::ports::storage
Declares deleted-id summaries reported after workspace mutations.
Internal mutable workspace session state for application services.
std::function< void(const core::domain::DeletionImpact &)> DeletionImpactCallback
virtual void setAtomicStoreLoad(AtomicStoreLoad loadFn)=0
Configure the atomic load callback.
virtual void saveAs(const std::string &filePath, const core::application::workspace::WorkspaceSessionState &document)=0
Save the current application state to a specific file path.
virtual std::optional< std::string > loadLatestPath() const =0
Load the latest known path.
virtual void createNew(const std::string &filePath)=0
Create a new storage target.
virtual core::application::workspace::WorkspaceSessionState loadFrom(const std::string &filePath)=0
Load an application state from a file path.
std::function< core::application::workspace::WorkspaceSessionState(const std::string &dbPath)> AtomicStoreLoad
virtual const std::string & currentPath() const noexcept=0
Get the current storage path.
virtual void save(const core::application::workspace::WorkspaceSessionState &document)=0
Save the current application state.
std::function< core::domain::DeletionImpact(const std::string &dbPath, const core::application::workspace::WorkspaceSessionState &document)> AtomicStoreSave
Destroy the storage manager port.
virtual void setAtomicStoreSave(AtomicStoreSave saveFn)=0
Configure the atomic save callback.
virtual void setDeletionImpactCallback(DeletionImpactCallback cb)=0
Configure the deletion impact callback.
Lists entity identifiers removed by cascading workspace operations.