lgraph_edge_index_iterator
-
namespace lgraph
-
namespace lgraph_api
-
class EdgeIndexIterator
- #include <lgraph_edge_index_iterator.h>
EdgeIndexIterator can be used to access a set of edges that has the same indexed value. If the index is unique (that is, each Edge has a unique index value), then each EdgeIndexIterator will only have one edge unique id, and will become invalid after Next() is called.
An EdgeIndexIterator is valid iff it points to a valid (index_value, euid) pair, otherwise it is invalid. Calling member function on an invalid EdgeIndexIterator throws an exception, except for the IsValid() function.
Public Functions
-
EdgeIndexIterator(EdgeIndexIterator &&rhs)
-
EdgeIndexIterator &operator=(EdgeIndexIterator&&)
-
~EdgeIndexIterator()
-
void Close()
Closes this iterator
-
bool IsValid() const
Query if this iterator is valid, i.e. the Key and Vid can be queried.
- 返回
True if valid, false if not.
-
bool Next()
Move to the next edge unique id in the list, which consists of all the valid edge unique ids of the iterator and is sorted from small to large. If we hit the end of the list, iterator will become invalid and false is returned.
- 返回
True if it succeeds, otherwise false.
-
FieldData GetIndexValue() const
Gets the current index value. The euids are sorted in ( EdgeIndexValue, euid) order. When Next() is called, the iterator moves from one euid to next, possibly moving from one EdgeIndexValue to another. This function tells the EdgeIndexValue currently pointed to.
- 返回
The key.
-
int64_t GetSrc() const
Gets the source vertex id.
- 返回
The source vertex id.
-
int64_t GetDst() const
Gets destination of the edge.
- 返回
The destination vertex id.
-
size_t GetLabelId() const
Gets label id of this edge.
- 返回
The label identifier.
-
int64_t GetEdgeId() const
Gets edge id.
- 返回
The edge identifier.
Private Functions
-
EdgeIndexIterator(const EdgeIndexIterator&) = delete
-
EdgeIndexIterator &operator=(const EdgeIndexIterator&) = delete
Private Members
Friends
- friend class Transaction
-
EdgeIndexIterator(EdgeIndexIterator &&rhs)
-
class EdgeIndexIterator