Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
graphar::EdgesCollection Class Referenceabstract

EdgesCollection is designed for reading a collection of edges. More...

#include <graph_reader.h>

Inheritance diagram for graphar::EdgesCollection:
graphar::OBDEdgesCollection graphar::OBSEdgeCollection graphar::UBDEdgesCollection graphar::UBSEdgesCollection

Public Member Functions

virtual EdgeIter begin ()
 
virtual EdgeIter end ()
 
virtual size_t size () const noexcept
 
virtual EdgeIter find_src (IdType id, const EdgeIter &from)=0
 
virtual EdgeIter find_dst (IdType id, const EdgeIter &from)=0
 

Static Public Member Functions

static Result< std::shared_ptr< EdgesCollection > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &src_label, const std::string &edge_label, const std::string &dst_label, AdjListType adj_list_type, const IdType vertex_chunk_begin=0, const IdType vertex_chunk_end=std::numeric_limits< int64_t >::max()) noexcept
 Construct an EdgesCollection from graph info and edge label. More...
 

Protected Member Functions

 EdgesCollection (const std::shared_ptr< EdgeInfo > &edge_info, const std::string &prefix, IdType vertex_chunk_begin, IdType vertex_chunk_end, AdjListType adj_list_type)
 Initialize the EdgesCollection with a range of chunks. More...
 

Protected Attributes

std::shared_ptr< EdgeInfoedge_info_
 
std::string prefix_
 
AdjListType adj_list_type_
 
IdType chunk_begin_
 
IdType chunk_end_
 
std::shared_ptr< util::IndexConverterindex_converter_
 
std::shared_ptr< EdgeIterbegin_
 
std::shared_ptr< EdgeIterend_
 
IdType edge_num_
 

Detailed Description

EdgesCollection is designed for reading a collection of edges.

Definition at line 659 of file graph_reader.h.

Constructor & Destructor Documentation

◆ EdgesCollection()

graphar::EdgesCollection::EdgesCollection ( const std::shared_ptr< EdgeInfo > &  edge_info,
const std::string &  prefix,
IdType  vertex_chunk_begin,
IdType  vertex_chunk_end,
AdjListType  adj_list_type 
)
inlineexplicitprotected

Initialize the EdgesCollection with a range of chunks.

Parameters
edge_infoThe edge info that describes the edge type.
prefixThe absolute prefix.
vertex_chunk_beginThe index of the begin vertex chunk.
vertex_chunk_endThe index of the end vertex chunk (not included).
adj_list_typeThe type of adjList.

Definition at line 736 of file graph_reader.h.

Member Function Documentation

◆ begin()

virtual EdgeIter graphar::EdgesCollection::begin ( )
inlinevirtual

The iterator pointing to the first edge.

Definition at line 664 of file graph_reader.h.

◆ end()

virtual EdgeIter graphar::EdgesCollection::end ( )
inlinevirtual

The iterator pointing to the past-the-end element.

Definition at line 674 of file graph_reader.h.

◆ find_dst()

virtual EdgeIter graphar::EdgesCollection::find_dst ( IdType  id,
const EdgeIter from 
)
pure virtual

Construct and return the iterator pointing to the first incoming edge of the vertex with specific id after the input iterator.

Parameters
idThe vertex id.
fromThe input iterator.
Returns
The new constructed iterator.

Implemented in graphar::UBDEdgesCollection, graphar::UBSEdgesCollection, graphar::OBDEdgesCollection, and graphar::OBSEdgeCollection.

◆ find_src()

virtual EdgeIter graphar::EdgesCollection::find_src ( IdType  id,
const EdgeIter from 
)
pure virtual

Construct and return the iterator pointing to the first out-going edge of the vertex with specific id after the input iterator.

Parameters
idThe vertex id.
fromThe input iterator.
Returns
The new constructed iterator.

Implemented in graphar::UBDEdgesCollection, graphar::UBSEdgesCollection, graphar::OBDEdgesCollection, and graphar::OBSEdgeCollection.

◆ Make()

Result< std::shared_ptr< EdgesCollection > > graphar::EdgesCollection::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  src_label,
const std::string &  edge_label,
const std::string &  dst_label,
AdjListType  adj_list_type,
const IdType  vertex_chunk_begin = 0,
const IdType  vertex_chunk_end = std::numeric_limits<int64_t>::max() 
)
staticnoexcept

Construct an EdgesCollection from graph info and edge label.

Parameters
graph_infoThe graph info.
src_labelThe source vertex label.
edge_labelThe edge label.
dst_labelThe destination vertex label.
adj_list_typeThe type of adjList.
vertex_chunk_beginThe index of the begin vertex chunk, default 0.
vertex_chunk_endThe index of the end vertex chunk (not included), default max.

Definition at line 546 of file graph_reader.cc.

◆ size()

virtual size_t graphar::EdgesCollection::size ( ) const
inlinevirtualnoexcept

Get the number of edges in the collection.

Definition at line 684 of file graph_reader.h.


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