6 #ifndef KNOWROB_STORAGE_H
7 #define KNOWROB_STORAGE_H
9 #include <boost/property_tree/ptree.hpp>
10 #include "knowrob/semweb/TriplePattern.h"
11 #include "knowrob/semweb/Triple.h"
12 #include "knowrob/semweb/TripleContainer.h"
13 #include "knowrob/semweb/Vocabulary.h"
14 #include "knowrob/PropertyTree.h"
15 #include "knowrob/ThreadPool.h"
16 #include "knowrob/DataSourceHandler.h"
17 #include "knowrob/plugins/PluginFactory.h"
18 #include "knowrob/plugins/TypedPluginFactory.h"
59 class Storage :
public DataSourceHandler {
171 #define KNOWROB_STORAGE_PLUGIN(classType, pluginName) extern "C" { \
172 std::shared_ptr<knowrob::DataBackend> knowrob_createPlugin(const std::string &pluginID) \
173 { return std::make_shared<classType>(); } \
174 const char* knowrob_getPluginName() { return pluginName; } }
bool supports(StorageFeature feature) const
void setVersionOfOrigin(std::string_view origin, std::optional< std::string_view > version)
void enableFeature(StorageFeature feature)
std::optional< std::string > getVersionOfOrigin(std::string_view origin) const
const auto & vocabulary() const
std::shared_ptr< Vocabulary > vocabulary_
PluginLanguage storageLanguage_
void setVocabulary(std::shared_ptr< Vocabulary > vocabulary)
virtual bool initializeBackend(const PropertyTree &config)=0
virtual bool insertAll(const TripleContainerPtr &triples)=0
virtual ~Storage()=default
virtual bool removeAll(const TripleContainerPtr &triples)=0
virtual bool removeAllWithOrigin(std::string_view origin)=0
Storage(StorageFeatures features=StorageFeature::NothingSpecial)
std::map< std::string, std::string > originVersions_
void setStorageLanguage(PluginLanguage storageLanguage)
StorageFeatures features_
PluginLanguage storageLanguage() const
virtual bool removeOne(const Triple &triple)=0
virtual bool insertOne(const Triple &triple)=0
FormulaPtr operator|(const FormulaPtr &phi, const FormulaPtr &psi)
std::shared_ptr< TripleContainer > TripleContainerPtr
NamedPlugin< Storage > NamedBackend
StorageFeature StorageFeatures
std::shared_ptr< Storage > StoragePtr
PluginFactory< Storage > BackendFactory
FormulaPtr operator&(const FormulaPtr &phi, const FormulaPtr &psi)