souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Protected Attributes
souffle::Relation::iterator_base Class Referenceabstract

Abstract iterator class. More...

#include <SouffleInterface.h>

Inheritance diagram for souffle::Relation::iterator_base:
Inheritance graph
Collaboration diagram for souffle::Relation::iterator_base:
Collaboration graph

Public Member Functions

virtual iterator_baseclone () const =0
 Clone the iterator_base. More...
 
virtual uint32_t getId () const
 Get the ID of the iterator_base object. More...
 
 iterator_base (uint32_t arg_id)
 Constructor. More...
 
virtual tupleoperator* ()=0
 Overload the "*" operator. More...
 
virtual void operator++ ()=0
 Overload the "++" operator. More...
 
bool operator== (const iterator_base &o) const
 Overload the "==" operator. More...
 
virtual ~iterator_base ()=default
 Destructor. More...
 

Protected Member Functions

virtual bool equal (const iterator_base &o) const =0
 Check if the passed-in object of o is the the same as the current iterator_base. More...
 

Protected Attributes

uint32_t id
 Required for identifying type of iterator (NB: LLVM has no typeinfo). More...
 

Detailed Description

Abstract iterator class.

When tuples are inserted into a relation, they will be stored contiguously. Intially, the iterator_base of a relation will point to the first tuple inserted. iterator_base can be moved to point to the next tuple until the end. The tuple iterator_base is pointing to can be accessed. However, users can not use this to access tuples since iterator class is protected. Instead, they should use the public class - iterator which interacts with iterator_base.

Definition at line 64 of file SouffleInterface.h.

Constructor & Destructor Documentation

◆ iterator_base()

souffle::Relation::iterator_base::iterator_base ( uint32_t  arg_id)
inline

Constructor.

Create an instance of iterator_base and set its ID to be arg_id.

Parameters
arg_idID of an iterator object (unit32_t)

Definition at line 91 of file SouffleInterface.h.

117 {

References equal(), getId(), and o.

Here is the call graph for this function:

◆ ~iterator_base()

virtual souffle::Relation::iterator_base::~iterator_base ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual iterator_base* souffle::Relation::iterator_base::clone ( ) const
pure virtual

Clone the iterator_base.

The definition of clone has to be defined by the child class of iterator_base.

Returns
An iterator_base pointer

Implemented in souffle::interpreter::RelInterface::iterator_base.

◆ equal()

virtual bool souffle::Relation::iterator_base::equal ( const iterator_base o) const
protectedpure virtual

Check if the passed-in object of o is the the same as the current iterator_base.

TODO (Honghyw) : Provide a clear documentation of what equal function does.

Parameters
oReference to an object of the iterator_base class
Returns
A boolean value. If two iterator_base are the same return true. Otherwise return false

Implemented in souffle::interpreter::RelInterface::iterator_base.

Referenced by iterator_base().

◆ getId()

virtual uint32_t souffle::Relation::iterator_base::getId ( ) const
inlinevirtual

Get the ID of the iterator_base object.

Returns
ID of the iterator_base object (unit32_t)

Definition at line 80 of file SouffleInterface.h.

85  : id(arg_id) {}

Referenced by iterator_base().

◆ operator*()

virtual tuple& souffle::Relation::iterator_base::operator* ( )
pure virtual

Overload the "*" operator.

Return the tuple that is pointed to by the iterator_base. The definition of this overloading has to be defined by the child class of iterator_base.

Returns
tuple Reference to a tuple object

Implemented in souffle::interpreter::RelInterface::iterator_base.

◆ operator++()

virtual void souffle::Relation::iterator_base::operator++ ( )
pure virtual

Overload the "++" operator.

Increment the iterator_base so that the iterator_base will now point to the next tuple. The definition of this overloading has to be defined by the child class of iterator_base.

Implemented in souffle::interpreter::RelInterface::iterator_base.

◆ operator==()

bool souffle::Relation::iterator_base::operator== ( const iterator_base o) const
inline

Overload the "==" operator.

Parameters
oReference to an object of the iterator_base class
Returns
A boolean value, if the ID of o is the same as the ID of the current object and equal(o) returns true. Otherwise return false

Definition at line 123 of file SouffleInterface.h.

129  :
130  /**

Field Documentation

◆ id

uint32_t souffle::Relation::iterator_base::id
protected

Required for identifying type of iterator (NB: LLVM has no typeinfo).

TODO (Honghyw) : Provide a clear documentation of what id is used for.

Definition at line 72 of file SouffleInterface.h.


The documentation for this class was generated from the following file:
souffle::Relation::iterator_base::id
uint32_t id
Required for identifying type of iterator (NB: LLVM has no typeinfo).
Definition: SouffleInterface.h:72