knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::TripleContainer Class Referenceabstract

#include <TripleContainer.h>

Inheritance diagram for knowrob::TripleContainer:

Classes

struct  iterator
 

Public Types

using ConstGenerator = std::function< const TriplePtr *()>
 
using ConstGenerator = std::function< const TriplePtr *()>
 

Public Member Functions

virtual ~TripleContainer ()=default
 
iterator begin () const
 
bool empty () const
 
virtual bool isMutable () const
 
virtual ConstGenerator cgenerator () const =0
 
virtual ~TripleContainer ()=default
 
iterator begin () const
 
bool empty () const
 
virtual bool isMutable () const
 
virtual ConstGenerator cgenerator () const =0
 

Static Public Member Functions

static iterator end ()
 
static iterator end ()
 

Detailed Description

A container of triples that can be created from a generator function. The baseclass has immutable triples, but MutableTripleContainer is a subclass that allows to modify triples in the container.

Definition at line 22 of file TripleContainer.h.

Member Typedef Documentation

◆ ConstGenerator [1/2]

using knowrob::TripleContainer::ConstGenerator = std::function<const TriplePtr *()>

A generator function that returns a const pointer to a triple.

Definition at line 27 of file TripleContainer.h.

◆ ConstGenerator [2/2]

using knowrob::TripleContainer::ConstGenerator = std::function<const TriplePtr *()>

A generator function that returns a const pointer to a triple.

Definition at line 27 of file TripleContainer.h.

Constructor & Destructor Documentation

◆ ~TripleContainer() [1/2]

virtual knowrob::TripleContainer::~TripleContainer ( )
virtualdefault

◆ ~TripleContainer() [2/2]

virtual knowrob::TripleContainer::~TripleContainer ( )
virtualdefault

Member Function Documentation

◆ begin() [1/2]

iterator knowrob::TripleContainer::begin ( ) const
inline
Returns
an iterator that points to the first const triple in the container.

Definition at line 54 of file TripleContainer.h.

54  {
55  return iterator(cgenerator());
56  }
virtual ConstGenerator cgenerator() const =0

◆ begin() [2/2]

iterator knowrob::TripleContainer::begin ( ) const
inline
Returns
an iterator that points to the first const triple in the container.

Definition at line 54 of file TripleContainer.h.

54  {
55  return iterator(cgenerator());
56  }

◆ cgenerator() [1/2]

◆ cgenerator() [2/2]

◆ empty() [1/2]

bool knowrob::TripleContainer::empty ( ) const
inline
Returns
true if the container is empty.

Definition at line 68 of file TripleContainer.h.

68  {
69  return begin().equal(end());
70  }
static iterator end()
iterator begin() const
bool equal(iterator const &other) const

◆ empty() [2/2]

bool knowrob::TripleContainer::empty ( ) const
inline
Returns
true if the container is empty.

Definition at line 68 of file TripleContainer.h.

68  {
69  return begin().equal(end());
70  }

◆ end() [1/2]

static iterator knowrob::TripleContainer::end ( )
inlinestatic
Returns
an iterator that points to the end of the container.

Definition at line 61 of file TripleContainer.h.

61  {
62  return iterator([] { return nullptr; });
63  }

◆ end() [2/2]

static iterator knowrob::TripleContainer::end ( )
inlinestatic
Returns
an iterator that points to the end of the container.

Definition at line 61 of file TripleContainer.h.

61  {
62  return iterator([] { return nullptr; });
63  }

◆ isMutable() [1/2]

virtual bool knowrob::TripleContainer::isMutable ( ) const
inlinevirtual
Returns
true if the container is mutable.

Reimplemented in knowrob::MutableTripleContainer, and knowrob::MutableTripleContainer.

Definition at line 75 of file TripleContainer.h.

75 { return false; }

◆ isMutable() [2/2]

virtual bool knowrob::TripleContainer::isMutable ( ) const
inlinevirtual
Returns
true if the container is mutable.

Reimplemented in knowrob::MutableTripleContainer, and knowrob::MutableTripleContainer.

Definition at line 75 of file TripleContainer.h.

75 { return false; }

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