Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
Public Member Functions | Friends | List of all members
graphar::EdgeIter Class Reference

The iterator for traversing a type of edges. More...

#include <graph_reader.h>

Public Member Functions

 EdgeIter (const std::shared_ptr< EdgeInfo > &edge_info, const std::string &prefix, AdjListType adj_list_type, IdType global_chunk_index, IdType offset, IdType chunk_begin, IdType chunk_end, std::shared_ptr< util::IndexConverter > index_converter)
 
 EdgeIter (const EdgeIter &other)
 
Edge operator* ()
 
IdType source ()
 
IdType destination ()
 
template<typename T >
Result< T > property (const std::string &property) noexcept
 
EdgeIteroperator++ ()
 
EdgeIter operator++ (int)
 
EdgeIter operator= (const EdgeIter &other)
 
bool operator== (const EdgeIter &rhs) const noexcept
 
bool operator!= (const EdgeIter &rhs) const noexcept
 
IdType global_chunk_index () const
 
IdType cur_offset () const
 
bool first_src (const EdgeIter &from, IdType id)
 
bool first_dst (const EdgeIter &from, IdType id)
 
void to_begin ()
 
bool is_end () const
 
bool next_src ()
 
bool next_dst ()
 
bool next_src (IdType id)
 
bool next_dst (IdType id)
 

Friends

class OBSEdgeCollection
 
class OBDEdgesCollection
 
class UBSEdgesCollection
 
class UBDEdgesCollection
 

Detailed Description

The iterator for traversing a type of edges.

Definition at line 325 of file graph_reader.h.

Constructor & Destructor Documentation

◆ EdgeIter() [1/2]

graphar::EdgeIter::EdgeIter ( const std::shared_ptr< EdgeInfo > &  edge_info,
const std::string &  prefix,
AdjListType  adj_list_type,
IdType  global_chunk_index,
IdType  offset,
IdType  chunk_begin,
IdType  chunk_end,
std::shared_ptr< util::IndexConverter index_converter 
)
inlineexplicit

Initialize the iterator.

Parameters
edge_infoThe edge info that describes the edge type.
prefixThe absolute prefix.
adj_list_typeThe type of adjList.
global_chunk_indexThe global index of the current edge chunk.
offsetThe current offset in the current edge chunk.
chunk_beginThe index of the first chunk.
chunk_endThe index of the last chunk.
index_converterThe converter for transforming the edge chunk indices.

Definition at line 340 of file graph_reader.h.

◆ EdgeIter() [2/2]

graphar::EdgeIter::EdgeIter ( const EdgeIter other)
inline

Copy constructor.

Definition at line 372 of file graph_reader.h.

Member Function Documentation

◆ cur_offset()

IdType graphar::EdgeIter::cur_offset ( ) const
inline

Get the current offset in the current chunk.

Definition at line 509 of file graph_reader.h.

◆ destination()

IdType graphar::EdgeIter::destination ( )

Get the destination vertex id for the current edge.

Definition at line 308 of file graph_reader.cc.

◆ first_dst()

bool graphar::EdgeIter::first_dst ( const EdgeIter from,
IdType  id 
)

Let the input iterator to point to the first incoming edge of the vertex with specific id after the current position of the iterator.

Parameters
fromThe input iterator.
idThe vertex id.
Returns
If such edge is found or not.

Definition at line 431 of file graph_reader.cc.

◆ first_src()

bool graphar::EdgeIter::first_src ( const EdgeIter from,
IdType  id 
)

Let the input iterator to point to the first out-going edge of the vertex with specific id after the current position of the iterator.

Parameters
fromThe input iterator.
idThe vertex id.
Returns
If such edge is found or not.

Definition at line 316 of file graph_reader.cc.

◆ global_chunk_index()

IdType graphar::EdgeIter::global_chunk_index ( ) const
inline

Get the global index of the current edge chunk.

Definition at line 506 of file graph_reader.h.

◆ is_end()

bool graphar::EdgeIter::is_end ( ) const
inline

Check if the current position is the end.

Definition at line 542 of file graph_reader.h.

◆ next_dst() [1/2]

bool graphar::EdgeIter::next_dst ( )
inline

Point to the next edge with the same destination, return false if not found.

Definition at line 575 of file graph_reader.h.

◆ next_dst() [2/2]

bool graphar::EdgeIter::next_dst ( IdType  id)
inline

Point to the next edge with the specific destination, return false if not found.

Definition at line 616 of file graph_reader.h.

◆ next_src() [1/2]

bool graphar::EdgeIter::next_src ( )
inline

Point to the next edge with the same source, return false if not found.

Definition at line 545 of file graph_reader.h.

◆ next_src() [2/2]

bool graphar::EdgeIter::next_src ( IdType  id)
inline

Point to the next edge with the specific source, return false if not found.

Definition at line 605 of file graph_reader.h.

◆ operator!=()

bool graphar::EdgeIter::operator!= ( const EdgeIter rhs) const
inlinenoexcept

The inequality operator.

Definition at line 499 of file graph_reader.h.

◆ operator*()

Edge graphar::EdgeIter::operator* ( )
inline

Construct and return the edge of the current offset.

Definition at line 389 of file graph_reader.h.

◆ operator++() [1/2]

EdgeIter& graphar::EdgeIter::operator++ ( )
inline

The prefix increment operator.

Definition at line 425 of file graph_reader.h.

◆ operator++() [2/2]

EdgeIter graphar::EdgeIter::operator++ ( int  )
inline

The postfix increment operator.

Definition at line 466 of file graph_reader.h.

◆ operator=()

EdgeIter graphar::EdgeIter::operator= ( const EdgeIter other)
inline

The copy assignment operator.

Definition at line 473 of file graph_reader.h.

◆ operator==()

bool graphar::EdgeIter::operator== ( const EdgeIter rhs) const
inlinenoexcept

The equality operator.

Definition at line 492 of file graph_reader.h.

◆ property()

template<typename T >
Result<T> graphar::EdgeIter::property ( const std::string &  property)
inlinenoexcept

Get the value of a property for the current edge.

Definition at line 405 of file graph_reader.h.

◆ source()

IdType graphar::EdgeIter::source ( )

Get the source vertex id for the current edge.

Definition at line 300 of file graph_reader.cc.

◆ to_begin()

void graphar::EdgeIter::to_begin ( )
inline

Let the iterator to point to the begin.

Definition at line 532 of file graph_reader.h.


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