knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::TriplePtr Struct Reference

#include <Triple.h>

Collaboration diagram for knowrob::TriplePtr:

Public Member Functions

 TriplePtr ()
 
 TriplePtr (Triple *ptr)
 
 TriplePtr (const TriplePtr &other)
 
 ~TriplePtr ()
 
Tripleoperator* () const
 
Tripleoperator-> () const
 
bool operator== (const TriplePtr &other) const
 
bool operator< (const TriplePtr &other) const
 
Tripleget () const
 
 TriplePtr ()
 
 TriplePtr (Triple *ptr)
 
 TriplePtr (const TriplePtr &other)
 
 ~TriplePtr ()
 
Tripleoperator* () const
 
Tripleoperator-> () const
 
bool operator== (const TriplePtr &other) const
 
bool operator< (const TriplePtr &other) const
 
Tripleget () const
 

Public Attributes

Tripleptr
 
bool owned
 

Detailed Description

A shared pointer to a Triple that can have ownership of the object. Be careful when using this struct as the triple is deleted by the ptr which has the ownership flag set to true. Copies are allowed and have the ownership flag set to false.

Definition at line 589 of file Triple.h.

Constructor & Destructor Documentation

◆ TriplePtr() [1/6]

knowrob::TriplePtr::TriplePtr ( )
inlineexplicit

Definition at line 595 of file Triple.h.

595 : ptr(nullptr), owned(false) {}
Triple * ptr
Definition: Triple.h:590

◆ TriplePtr() [2/6]

knowrob::TriplePtr::TriplePtr ( Triple ptr)
inlineexplicit

Definition at line 597 of file Triple.h.

597 : ptr(ptr), owned(true) {}

◆ TriplePtr() [3/6]

knowrob::TriplePtr::TriplePtr ( const TriplePtr other)
inline

Definition at line 599 of file Triple.h.

599 : ptr(other.ptr), owned(false) {}

◆ ~TriplePtr() [1/2]

knowrob::TriplePtr::~TriplePtr ( )
inline

Definition at line 601 of file Triple.h.

601 { if (owned) delete ptr; }

◆ TriplePtr() [4/6]

knowrob::TriplePtr::TriplePtr ( )
inlineexplicit

Definition at line 595 of file Triple.h.

595 : ptr(nullptr), owned(false) {}

◆ TriplePtr() [5/6]

knowrob::TriplePtr::TriplePtr ( Triple ptr)
inlineexplicit

Definition at line 597 of file Triple.h.

597 : ptr(ptr), owned(true) {}

◆ TriplePtr() [6/6]

knowrob::TriplePtr::TriplePtr ( const TriplePtr other)
inline

Definition at line 599 of file Triple.h.

599 : ptr(other.ptr), owned(false) {}

◆ ~TriplePtr() [2/2]

knowrob::TriplePtr::~TriplePtr ( )
inline

Definition at line 601 of file Triple.h.

601 { if (owned) delete ptr; }

Member Function Documentation

◆ get() [1/2]

Triple& knowrob::TriplePtr::get ( ) const
inline

Definition at line 615 of file Triple.h.

615 { return *ptr; }

◆ get() [2/2]

Triple& knowrob::TriplePtr::get ( ) const
inline

Definition at line 615 of file Triple.h.

615 { return *ptr; }

◆ operator*() [1/2]

Triple& knowrob::TriplePtr::operator* ( ) const
inline

Definition at line 603 of file Triple.h.

603 { return *ptr; }

◆ operator*() [2/2]

Triple& knowrob::TriplePtr::operator* ( ) const
inline

Definition at line 603 of file Triple.h.

603 { return *ptr; }

◆ operator->() [1/2]

Triple* knowrob::TriplePtr::operator-> ( ) const
inline

Definition at line 605 of file Triple.h.

605 { return ptr; }

◆ operator->() [2/2]

Triple* knowrob::TriplePtr::operator-> ( ) const
inline

Definition at line 605 of file Triple.h.

605 { return ptr; }

◆ operator<() [1/2]

bool knowrob::TriplePtr::operator< ( const TriplePtr other) const
inline

Definition at line 611 of file Triple.h.

611  {
612  return (ptr && other.ptr) ? (*ptr < *other.ptr) : (ptr < other.ptr);
613  }

◆ operator<() [2/2]

bool knowrob::TriplePtr::operator< ( const TriplePtr other) const
inline

Definition at line 611 of file Triple.h.

611  {
612  return (ptr && other.ptr) ? (*ptr < *other.ptr) : (ptr < other.ptr);
613  }

◆ operator==() [1/2]

bool knowrob::TriplePtr::operator== ( const TriplePtr other) const
inline

Definition at line 607 of file Triple.h.

607  {
608  return ptr==other.ptr || (ptr && other.ptr && *ptr == *other.ptr);
609  }

◆ operator==() [2/2]

bool knowrob::TriplePtr::operator== ( const TriplePtr other) const
inline

Definition at line 607 of file Triple.h.

607  {
608  return ptr==other.ptr || (ptr && other.ptr && *ptr == *other.ptr);
609  }

Member Data Documentation

◆ owned

bool knowrob::TriplePtr::owned
mutable

Definition at line 593 of file Triple.h.

◆ ptr

Triple * knowrob::TriplePtr::ptr

Definition at line 590 of file Triple.h.


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