knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
GraphConnective.h
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 #ifndef KNOWROB_GRAPH_CONNECTIVE_H
7 #define KNOWROB_GRAPH_CONNECTIVE_H
8 
9 #include "knowrob/semweb/GraphTerm.h"
10 #include "knowrob/semweb/GraphPattern.h"
11 
12 namespace knowrob {
16  class GraphConnective : public GraphTerm {
17  public:
18  virtual ~GraphConnective() = default;
19 
25  if (pattern) terms_.push_back(std::make_shared<GraphPattern>(pattern));
26  }
27 
32  void addMember(const std::shared_ptr<GraphTerm> &member) {
33  if (member) terms_.push_back(member);
34  }
35 
39  const auto &terms() const { return terms_; }
40 
41  protected:
42  std::vector<std::shared_ptr<GraphTerm>> terms_;
43 
45 
46  explicit GraphConnective(GraphTermType termType, const std::vector<std::shared_ptr<GraphTerm>> &terms)
48  };
49 } // knowrob
50 
51 #endif //KNOWROB_GRAPH_CONNECTIVE_H
virtual ~GraphConnective()=default
void addMember(const std::shared_ptr< GraphTerm > &member)
GraphConnective(GraphTermType termType, const std::vector< std::shared_ptr< GraphTerm >> &terms)
const auto & terms() const
void addPattern(const TriplePatternPtr &pattern)
std::vector< std::shared_ptr< GraphTerm > > terms_
GraphConnective(GraphTermType termType)
auto termType() const
Definition: GraphTerm.h:43
GraphTermRule & pattern()
Definition: graph.cpp:23
std::shared_ptr< TriplePattern > TriplePatternPtr
GraphTermType
Definition: GraphTerm.h:16