knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
ReificationContainer.cpp File Reference
#include <utility>
#include "knowrob/storage/ReificationContainer.h"
#include "knowrob/storage/ReifiedTriple.h"
Include dependency graph for ReificationContainer.cpp:

Go to the source code of this file.

Namespaces

 knowrob
 
 knowrob::reification
 

Functions

TripleContainer::ConstGenerator getReifiedGenerator (const Triple &triple, const VocabularyPtr &vocabulary, const ReifiedNames &reifiedNames, uint32_t tripleIndex)
 

Function Documentation

◆ getReifiedGenerator()

TripleContainer::ConstGenerator getReifiedGenerator ( const Triple triple,
const VocabularyPtr vocabulary,
const ReifiedNames reifiedNames,
uint32_t  tripleIndex 
)

Definition at line 22 of file ReificationContainer.cpp.

25  {
26  std::shared_ptr<ReifiedTriple> reified;
27  if (reifiedNames && !reifiedNames->empty()) {
28  reified = std::make_shared<ReifiedTriple>(triple, vocabulary, (*reifiedNames)[tripleIndex - 1]);
29  } else {
30  reified = std::make_shared<ReifiedTriple>(triple, vocabulary);
31  }
32  return [reified, it = reified->begin()]() mutable -> const TriplePtr * {
33  if (it == reified->end()) return nullptr;
34  return &*it++;
35  };
36 }