knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
GraphSequence.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #include "knowrob/semweb/GraphSequence.h"
7 #include "knowrob/integration/python/utils.h"
8 
9 using namespace knowrob;
10 
11 void GraphSequence::write(std::ostream &os) const {
12  os << "(";
13  for (std::size_t i = 0; i < terms_.size(); i++) {
14  if (i > 0) {
15  os << ", ";
16  }
17  os << *terms_[i];
18  }
19  os << ")";
20 }
21 
22 namespace knowrob::py {
23  template<>
25  using namespace boost::python;
26 
27  class_<GraphSequence, bases<GraphTerm>, std::shared_ptr<GraphSequence>, boost::noncopyable>
28  ("GraphSequence", init<>())
29  .def(init<const std::vector<std::shared_ptr<GraphTerm>> &>());
30  }
31 }
std::vector< std::shared_ptr< GraphTerm > > terms_
void write(std::ostream &os) const override
void createType< GraphSequence >()