6 #ifndef KNOWROB_STORAGE_MANAGER_H_
7 #define KNOWROB_STORAGE_MANAGER_H_
10 #include "knowrob/semweb/Vocabulary.h"
11 #include "knowrob/plugins/PluginManager.h"
18 class StorageManager :
public PluginManager<Storage> {
40 const auto &
queryable()
const {
return queryable_; }
46 void addPlugin(
const std::shared_ptr<NamedBackend> &backend);
49 std::shared_ptr<NamedBackend>
loadPlugin(
const boost::property_tree::ptree &config)
override;
55 std::shared_ptr<Vocabulary> vocabulary_;
56 std::map<std::string_view, QueryableBackendPtr> persistent_;
57 std::map<std::string_view, QueryableBackendPtr> queryable_;
59 void initBackend(
const std::shared_ptr<NamedBackend> &definedKG);
66 #define KNOWROB_BUILTIN_STORAGE(Name, Type) class Type ## _Registration{ static bool isRegistered; }; \
67 bool Type ## _Registration::isRegistered = knowrob::PluginManager<knowrob::Storage>::addFactory<Type>(Name);
const auto & queryable() const
std::shared_ptr< NamedBackend > addPlugin(std::string_view reasonerID, PluginLanguage language, const StoragePtr &backend) override
const auto & persistent() const
~StorageManager() override=default
void addPlugin(const std::shared_ptr< NamedBackend > &backend)
std::shared_ptr< NamedBackend > loadPlugin(const boost::property_tree::ptree &config) override
StorageManager(const std::shared_ptr< Vocabulary > &vocabulary)
auto & vocabulary() const
std::shared_ptr< Storage > StoragePtr