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

#include <ReasonerEvent.h>

Inheritance diagram for knowrob::reasoner::TripleEvent:
Collaboration diagram for knowrob::reasoner::TripleEvent:

Public Member Functions

 TripleEvent (Type eventType, uint32_t tripleCount, bool copy=true)
 
auto & triples () const
 
auto & triple (uint32_t index)
 
 TripleEvent (Type eventType, uint32_t tripleCount, bool copy=true)
 
auto & triples () const
 
auto & triple (uint32_t index)
 
- Public Member Functions inherited from knowrob::reasoner::Event
 Event (Type eventType)
 
Type eventType () const
 
 Event (Type eventType)
 
Type eventType () const
 

Protected Attributes

std::vector< TriplePtrtriples_
 
- Protected Attributes inherited from knowrob::reasoner::Event
const Type eventType_
 

Additional Inherited Members

- Public Types inherited from knowrob::reasoner::Event
enum  Type {
  Assertion , Retraction , Replacement , Invalidation ,
  Assertion , Retraction , Replacement , Invalidation
}
 
enum  Type {
  Assertion , Retraction , Replacement , Invalidation ,
  Assertion , Retraction , Replacement , Invalidation
}
 

Detailed Description

An event that contains a set of triples.

Definition at line 56 of file ReasonerEvent.h.

Constructor & Destructor Documentation

◆ TripleEvent() [1/2]

TripleEvent::TripleEvent ( Type  eventType,
uint32_t  tripleCount,
bool  copy = true 
)
Parameters
eventTypethe type of the event.
tripleCountthe number of triples in this event.
copywhether to use std::string (true) or std::string_view (false) for triples.

Definition at line 20 of file ReasonerEvent.cpp.

21  : Event(eventType), triples_(tripleCount) {
22  if (copy) {
23  createTriples<TripleCopy>(triples_);
24  } else {
25  createTriples<TripleView>(triples_);
26  }
27 }
Event(Type eventType)
Definition: ReasonerEvent.h:42
std::vector< TriplePtr > triples_
Definition: ReasonerEvent.h:76

◆ TripleEvent() [2/2]

knowrob::reasoner::TripleEvent::TripleEvent ( Type  eventType,
uint32_t  tripleCount,
bool  copy = true 
)
Parameters
eventTypethe type of the event.
tripleCountthe number of triples in this event.
copywhether to use std::string (true) or std::string_view (false) for triples.

Member Function Documentation

◆ triple() [1/2]

auto& knowrob::reasoner::TripleEvent::triple ( uint32_t  index)
inline
Returns
the triple at the given index.

Definition at line 73 of file ReasonerEvent.h.

73 { return *triples_[index].ptr; }

◆ triple() [2/2]

auto& knowrob::reasoner::TripleEvent::triple ( uint32_t  index)
inline
Returns
the triple at the given index.

Definition at line 73 of file ReasonerEvent.h.

73 { return *triples_[index].ptr; }

◆ triples() [1/2]

auto& knowrob::reasoner::TripleEvent::triples ( ) const
inline
Returns
the triples of this event.

Definition at line 68 of file ReasonerEvent.h.

68 { return triples_; }

◆ triples() [2/2]

auto& knowrob::reasoner::TripleEvent::triples ( ) const
inline
Returns
the triples of this event.

Definition at line 68 of file ReasonerEvent.h.

68 { return triples_; }

Member Data Documentation

◆ triples_

std::vector< TriplePtr > knowrob::reasoner::TripleEvent::triples_
protected

Definition at line 76 of file ReasonerEvent.h.


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