souffle
2.0.2-371-g6315b36
|
Abstract iterator class. More...
#include <SouffleInterface.h>
Public Member Functions | |
virtual iterator_base * | clone () 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 tuple & | operator* ()=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... | |
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.
|
inline |
Constructor.
Create an instance of iterator_base and set its ID to be arg_id.
arg_id | ID of an iterator object (unit32_t) |
Definition at line 91 of file SouffleInterface.h.
References equal(), getId(), and o.
|
virtualdefault |
Destructor.
Reimplemented in souffle::interpreter::RelInterface::iterator_base.
|
pure virtual |
Clone the iterator_base.
The definition of clone has to be defined by the child class of iterator_base.
Implemented in souffle::interpreter::RelInterface::iterator_base.
|
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.
o | Reference to an object of the iterator_base class |
Implemented in souffle::interpreter::RelInterface::iterator_base.
Referenced by iterator_base().
|
inlinevirtual |
Get the ID of the iterator_base object.
Definition at line 80 of file SouffleInterface.h.
Referenced by iterator_base().
|
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.
Implemented in souffle::interpreter::RelInterface::iterator_base.
|
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.
|
inline |
Overload the "==" operator.
o | Reference to an object of the iterator_base class |
Definition at line 123 of file SouffleInterface.h.
|
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.