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

#include <ModalOperator.h>

Public Member Functions

 ModalIteration ()=default
 
bool operator== (const ModalIteration &other) const
 
void operator+= (const ModalOperatorPtr &modalOperator)
 
ModalIteration operator+ (const ModalOperatorPtr &modalOperator) const
 
auto numOperators () const
 
auto begin () const
 
auto end () const
 
 ModalIteration ()=default
 
bool operator== (const ModalIteration &other) const
 
void operator+= (const ModalOperatorPtr &modalOperator)
 
ModalIteration operator+ (const ModalOperatorPtr &modalOperator) const
 
auto numOperators () const
 
auto begin () const
 
auto end () const
 

Static Public Member Functions

static const ModalIterationemptyIteration ()
 
static const ModalIterationemptyIteration ()
 

Protected Attributes

std::list< ModalOperatorPtrmodalitySequence_
 

Detailed Description

An iteration over modalities. Each iteration corresponds to applying the accessibility relation once.

Definition at line 142 of file ModalOperator.h.

Constructor & Destructor Documentation

◆ ModalIteration() [1/2]

knowrob::ModalIteration::ModalIteration ( )
default

◆ ModalIteration() [2/2]

knowrob::ModalIteration::ModalIteration ( )
default

Member Function Documentation

◆ begin() [1/2]

auto knowrob::ModalIteration::begin ( ) const
inline
Returns
begin iterator of modal operators.

Definition at line 167 of file ModalOperator.h.

167 { return modalitySequence_.begin(); }
std::list< ModalOperatorPtr > modalitySequence_

◆ begin() [2/2]

auto knowrob::ModalIteration::begin ( ) const
inline
Returns
begin iterator of modal operators.

Definition at line 167 of file ModalOperator.h.

167 { return modalitySequence_.begin(); }

◆ emptyIteration() [1/2]

const ModalIteration & ModalIteration::emptyIteration ( )
static
Returns
an empty iteration.

Definition at line 146 of file ModalOperator.cpp.

146  {
147  static ModalIteration empty;
148  return empty;
149 }

◆ emptyIteration() [2/2]

static const ModalIteration& knowrob::ModalIteration::emptyIteration ( )
static
Returns
an empty iteration.

◆ end() [1/2]

auto knowrob::ModalIteration::end ( ) const
inline
Returns
end iterator of modal operators.

Definition at line 172 of file ModalOperator.h.

172 { return modalitySequence_.end(); }

◆ end() [2/2]

auto knowrob::ModalIteration::end ( ) const
inline
Returns
end iterator of modal operators.

Definition at line 172 of file ModalOperator.h.

172 { return modalitySequence_.end(); }

◆ numOperators() [1/2]

auto knowrob::ModalIteration::numOperators ( ) const
inline
Returns
number of operators in this sequence.

Definition at line 162 of file ModalOperator.h.

162 { return modalitySequence_.size(); }

◆ numOperators() [2/2]

auto knowrob::ModalIteration::numOperators ( ) const
inline
Returns
number of operators in this sequence.

Definition at line 162 of file ModalOperator.h.

162 { return modalitySequence_.size(); }

◆ operator+() [1/2]

ModalIteration ModalIteration::operator+ ( const ModalOperatorPtr modalOperator) const

Definition at line 167 of file ModalOperator.cpp.

167  {
168  ModalIteration it(*this);
169  it += modalOperator;
170  return it;
171 }

◆ operator+() [2/2]

ModalIteration knowrob::ModalIteration::operator+ ( const ModalOperatorPtr modalOperator) const

◆ operator+=() [1/2]

void ModalIteration::operator+= ( const ModalOperatorPtr modalOperator)
Parameters
modalOperatoradd an operator to this iteration.

Definition at line 173 of file ModalOperator.cpp.

173  {
174  modalitySequence_.push_back(next);
175 }

◆ operator+=() [2/2]

void knowrob::ModalIteration::operator+= ( const ModalOperatorPtr modalOperator)
Parameters
modalOperatoradd an operator to this iteration.

◆ operator==() [1/2]

bool ModalIteration::operator== ( const ModalIteration other) const
Parameters
otheranother iteration.
Returns
true if this and other are the same iterations.

Definition at line 151 of file ModalOperator.cpp.

151  {
152  if (modalitySequence_.size() != other.modalitySequence_.size()) {
153  return false;
154  }
155  auto it = modalitySequence_.begin();
156  auto jt = other.modalitySequence_.begin();
157  while (it != modalitySequence_.end()) {
158  if (!(*it == *jt)) {
159  return false;
160  }
161  ++it;
162  ++jt;
163  }
164  return true;
165 }

◆ operator==() [2/2]

bool knowrob::ModalIteration::operator== ( const ModalIteration other) const
Parameters
otheranother iteration.
Returns
true if this and other are the same iterations.

Member Data Documentation

◆ modalitySequence_

std::list< ModalOperatorPtr > knowrob::ModalIteration::modalitySequence_
protected

Definition at line 180 of file ModalOperator.h.


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