knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
GraphUnion.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/GraphUnion.h"
7 #include "knowrob/integration/python/utils.h"
8 
9 using namespace knowrob;
10 
11 void GraphUnion::write(std::ostream &os) const {
12  os << "Union(";
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_<GraphUnion, bases<GraphTerm>, std::shared_ptr<GraphUnion>, boost::noncopyable>
28  ("GraphUnion", 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
Definition: GraphUnion.cpp:11
void createType< GraphUnion >()
Definition: GraphUnion.cpp:24