1 #include "knowrob/storage/Storage.h"
2 #include "knowrob/integration/python/utils.h"
3 #include "knowrob/storage/QueryableStorage.h"
4 #include "knowrob/storage/Observer.h"
9 return static_cast<StorageFeature>(
static_cast<std::uint8_t
>(a) |
static_cast<std::uint8_t
>(b));
13 return static_cast<std::uint8_t
>(a) &
static_cast<std::uint8_t
>(b);
17 struct StorageWrap :
public Storage, boost::python::wrapper<Storage> {
18 explicit StorageWrap(PyObject *p) :
Storage(), self(p) {}
20 bool initializeBackend(
const PropertyTree &config)
override {
21 return call_method<bool>(
self,
"initializeBackend", config);
24 bool insertOne(
const Triple &triple)
override {
25 return call_method<bool>(
self,
"insertOne", &triple);
29 return call_method<bool>(
self,
"insertAll", triples);
32 bool removeOne(
const Triple &triple)
override {
33 return call_method<bool>(
self,
"removeOne", &triple);
37 return call_method<bool>(
self,
"removeAll", triples);
40 bool removeAllWithOrigin(std::string_view origin)
override {
41 return call_method<bool>(
self,
"removeAllWithOrigin", origin.data());
51 enum_<StorageFeature>(
"StorageFeature")
56 class_<Storage, std::shared_ptr<StorageWrap>, bases<DataSourceHandler>, boost::noncopyable>
69 register_ptr_to_python< std::shared_ptr< Storage > >();
bool supports(StorageFeature feature) const
void setVersionOfOrigin(std::string_view origin, std::optional< std::string_view > version)
std::optional< std::string > getVersionOfOrigin(std::string_view origin) const
const auto & vocabulary() const
virtual bool initializeBackend(const PropertyTree &config)=0
virtual bool insertAll(const TripleContainerPtr &triples)=0
virtual bool removeAll(const TripleContainerPtr &triples)=0
virtual bool removeAllWithOrigin(std::string_view origin)=0
virtual bool removeOne(const Triple &triple)=0
virtual bool insertOne(const Triple &triple)=0
void createType< Storage >()
void createType< QueryableStorage >()
void createType< Observer >()
FormulaPtr operator|(const FormulaPtr &phi, const FormulaPtr &psi)
std::shared_ptr< TripleContainer > TripleContainerPtr
FormulaPtr operator&(const FormulaPtr &phi, const FormulaPtr &psi)