6 #include "knowrob/semweb/TripleContainer.h"
7 #include "knowrob/integration/python/utils.h"
16 : triples_(&triplesData_), triplesData_(triples) {
18 for (uint32_t i = 0; i < triples.size(); ++i) {
19 if (triples[i].owned) {
21 triples[i].owned =
false;
39 : data_(batchSize), batchSize_(batchSize), actualSize_(0) {
45 if (entry.owned && entry.ptr) {
49 entry.ptr = triple.
ptr;
60 return [
this, i = std::size_t(0)]()
mutable ->
const TriplePtr * {
67 return [
this, i = std::size_t(0)]()
mutable ->
TriplePtr * {
77 class_<TripleContainer, std::shared_ptr<TripleContainer>, boost::noncopyable>
78 (
"TripleContainer", no_init)
80 boost::python::iterator<
TripleContainer, boost::python::return_value_policy<boost::python::copy_const_reference>>{});
std::function< TriplePtr *()> MutableGenerator
ProxyTripleContainer(const std::vector< TriplePtr > *triples)
const std::vector< TriplePtr > * triples_
const std::vector< TriplePtr > triplesData_
ConstGenerator cgenerator() const override
std::function< const TriplePtr *()> ConstGenerator
void add(const TriplePtr &triple)
std::vector< TriplePtr > data_
MutableGenerator generator() override
TripleViewBatch(uint32_t batchSize)
ConstGenerator cgenerator() const override
void createType< TripleContainer >()
TripleTemplate< std::string > TripleCopy