tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
storage_proxy.hpp
Go to the documentation of this file.
1
7#if !defined(TETENGO_PROPERTY_STORAGEPROXY_HPP)
8#define TETENGO_PROPERTY_STORAGEPROXY_HPP
9
10#include <cstdint>
11#include <filesystem>
12#include <memory>
13#include <optional>
14#include <string>
15
17
18
19namespace tetengo::property
20{
24 class storage_proxy : public storage
25 {
26 public:
27 // constructors and destructor
28
32 virtual ~storage_proxy();
33
34
35 private:
36 // types
37
38 class impl;
39
40 friend class storage_loader_proxy;
41
42
43 // variables
44
45 const std::unique_ptr<impl> m_p_impl;
46
47
48 // constructors
49
50 storage_proxy(std::shared_ptr<storage_loader> p_real_storage_loader, const std::filesystem::path& path);
51
52
53 // virtual functions
54
55 virtual std::optional<bool> get_bool_impl(const std::filesystem::path& key) const override;
56
57 virtual void set_bool_impl(const std::filesystem::path& key, bool value) override;
58
59 virtual std::optional<std::uint32_t> get_uint32_impl(const std::filesystem::path& key) const override;
60
61 virtual void set_uint32_impl(const std::filesystem::path& key, std::uint32_t value) override;
62
63 virtual std::optional<std::string> get_string_impl(const std::filesystem::path& key) const override;
64
65 virtual void set_string_impl(const std::filesystem::path& key, const std::string& value) override;
66
67 virtual void save_impl() const override;
68 };
69
70
75 {
76 public:
77 // constructors and destructor
78
86 explicit storage_loader_proxy(std::unique_ptr<storage_loader>&& p_real_storage_loader);
87
92
93
94 private:
95 // types
96
97 class impl;
98
99
100 // variables
101
102 const std::unique_ptr<impl> m_p_impl;
103
104
105 // virtual functions
106
107 virtual std::unique_ptr<storage> load_impl(const std::filesystem::path&) const override;
108 };
109
110
111}
112
113
114#endif
A storage loader proxy.
Definition storage_proxy.hpp:75
virtual ~storage_loader_proxy()
Destroys the storage loader proxy.
storage_loader_proxy(std::unique_ptr< storage_loader > &&p_real_storage_loader)
Creates a storage loader proxy.
A storage loader.
Definition storage.hpp:156
A storage proxy.
Definition storage_proxy.hpp:25
virtual ~storage_proxy()
Destroys the storage proxy.
A storage.
Definition storage.hpp:27
A property set library.
A storage.