knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::GraphConnective Class Reference

#include <GraphConnective.h>

Inheritance diagram for knowrob::GraphConnective:
Collaboration diagram for knowrob::GraphConnective:

Public Member Functions

virtual ~GraphConnective ()=default
 
void addPattern (const TriplePatternPtr &pattern)
 
void addMember (const std::shared_ptr< GraphTerm > &member)
 
const auto & terms () const
 
virtual ~GraphConnective ()=default
 
void addPattern (const TriplePatternPtr &pattern)
 
void addMember (const std::shared_ptr< GraphTerm > &member)
 
const auto & terms () const
 
- Public Member Functions inherited from knowrob::GraphTerm
virtual ~GraphTerm ()=default
 
bool isPattern () const
 
bool isBuiltin () const
 
auto termType () const
 
virtual void write (std::ostream &os) const =0
 
virtual ~GraphTerm ()=default
 
bool isPattern () const
 
bool isBuiltin () const
 
auto termType () const
 
virtual void write (std::ostream &os) const =0
 
- Public Member Functions inherited from knowrob::Printable
virtual ~Printable ()=default
 
virtual std::string format () const
 
virtual ~Printable ()=default
 
virtual std::string format () const
 

Protected Member Functions

 GraphConnective (GraphTermType termType)
 
 GraphConnective (GraphTermType termType, const std::vector< std::shared_ptr< GraphTerm >> &terms)
 
 GraphConnective (GraphTermType termType)
 
 GraphConnective (GraphTermType termType, const std::vector< std::shared_ptr< GraphTerm >> &terms)
 
- Protected Member Functions inherited from knowrob::GraphTerm
 GraphTerm (GraphTermType termType)
 
 GraphTerm (GraphTermType termType)
 

Protected Attributes

std::vector< std::shared_ptr< GraphTerm > > terms_
 
- Protected Attributes inherited from knowrob::GraphTerm
GraphTermType termType_
 

Detailed Description

A connective graph term with has as arguments a variadic number of other terms.

Definition at line 16 of file GraphConnective.h.

Constructor & Destructor Documentation

◆ ~GraphConnective() [1/2]

virtual knowrob::GraphConnective::~GraphConnective ( )
virtualdefault

◆ GraphConnective() [1/4]

knowrob::GraphConnective::GraphConnective ( GraphTermType  termType)
inlineexplicitprotected

Definition at line 44 of file GraphConnective.h.

44 : GraphTerm(termType) {}
GraphTerm(GraphTermType termType)
Definition: GraphTerm.h:50
auto termType() const
Definition: GraphTerm.h:43

◆ GraphConnective() [2/4]

knowrob::GraphConnective::GraphConnective ( GraphTermType  termType,
const std::vector< std::shared_ptr< GraphTerm >> &  terms 
)
inlineexplicitprotected

Definition at line 46 of file GraphConnective.h.

const auto & terms() const
std::vector< std::shared_ptr< GraphTerm > > terms_

◆ ~GraphConnective() [2/2]

virtual knowrob::GraphConnective::~GraphConnective ( )
virtualdefault

◆ GraphConnective() [3/4]

knowrob::GraphConnective::GraphConnective ( GraphTermType  termType)
inlineexplicitprotected

Definition at line 44 of file GraphConnective.h.

44 : GraphTerm(termType) {}

◆ GraphConnective() [4/4]

knowrob::GraphConnective::GraphConnective ( GraphTermType  termType,
const std::vector< std::shared_ptr< GraphTerm >> &  terms 
)
inlineexplicitprotected

Definition at line 46 of file GraphConnective.h.

Member Function Documentation

◆ addMember() [1/2]

void knowrob::GraphConnective::addMember ( const std::shared_ptr< GraphTerm > &  member)
inline

Add a term to the graph connective.

Parameters
memberthe term to add.

Definition at line 32 of file GraphConnective.h.

32  {
33  if (member) terms_.push_back(member);
34  }

◆ addMember() [2/2]

void knowrob::GraphConnective::addMember ( const std::shared_ptr< GraphTerm > &  member)
inline

Add a term to the graph connective.

Parameters
memberthe term to add.

Definition at line 32 of file GraphConnective.h.

32  {
33  if (member) terms_.push_back(member);
34  }

◆ addPattern() [1/2]

void knowrob::GraphConnective::addPattern ( const TriplePatternPtr pattern)
inline

Add a pattern to the graph connective.

Parameters
patternthe pattern to add.

Definition at line 24 of file GraphConnective.h.

24  {
25  if (pattern) terms_.push_back(std::make_shared<GraphPattern>(pattern));
26  }
GraphTermRule & pattern()
Definition: graph.cpp:23

◆ addPattern() [2/2]

void knowrob::GraphConnective::addPattern ( const TriplePatternPtr pattern)
inline

Add a pattern to the graph connective.

Parameters
patternthe pattern to add.

Definition at line 24 of file GraphConnective.h.

24  {
25  if (pattern) terms_.push_back(std::make_shared<GraphPattern>(pattern));
26  }

◆ terms() [1/2]

const auto& knowrob::GraphConnective::terms ( ) const
inline
Returns
the union of graph terms.

Definition at line 39 of file GraphConnective.h.

39 { return terms_; }

◆ terms() [2/2]

const auto& knowrob::GraphConnective::terms ( ) const
inline
Returns
the union of graph terms.

Definition at line 39 of file GraphConnective.h.

39 { return terms_; }

Member Data Documentation

◆ terms_

std::vector< std::shared_ptr< GraphTerm > > knowrob::GraphConnective::terms_
protected

Definition at line 42 of file GraphConnective.h.


The documentation for this class was generated from the following file: