Template Class Edges¶
Defined in File edges.hpp
Class Documentation¶
-
template<EdgeOrientation
Orientation>
classEdges¶ Forward declarations.
Manipulate the edges of a graph
Public Functions
-
Edges(GraphImpl<Orientation> &pimpl)¶ Construct a Edges.
- Parameters
pimpl: Pointer to implementation
-
EdgeIterator
begin(std::size_t position = 0) const¶ Iterator over the edges of the graph.
- Return
edge iterator
- Parameters
position: starting position, default at the beginning
-
EdgeIterator
end() const¶ - Return
an iterator referring to the past-the-end
-
Status
insert(const vertex_uid_t &vertex1, const vertex_uid_t &vertex2, bool commit = false)¶ Create an edge between 2 vertices. Both vertices must already be in the graph.
- Return
information whether operation succeeded or not
- Parameters
vertex1: one end of the edgevertex2: second end of the edgecommit: whether uncommitted operations should be flushed or not
-
Status
insert(const vertex_uid_t &vertex1, const vertex_uid_t &vertex2, const char *data, std::size_t size, bool commit = false)¶ Create an edge between 2 vertices. Both vertices must already be in the graph.
- Return
information whether operation succeeded or not
- Parameters
vertex1: one end of the edgevertex2: second end of the edgedata: payload of the edgesize: payload lengthcommit: whether uncommitted operations should be flushed or not
-
Status
insert(const vertex_uid_t &vertex, const vertex_uids_t &vertices, const std::vector<const char *> &data = {}, const std::vector<std::size_t> &sizes = {}, bool commit = false)¶ Create edges between a vertex and several vertices.
- Return
information whether operation succeeded or not
- Parameters
vertex: the vertex to connect to othersvertices: the vertices to connect to vertexdata: payloads of every edges to createsizes: the sizes of the payloadscommit: whether uncommitted operations should be flushed or not
-
Status
insert(const vertex_uid_t &vertex, vertex_t type, const vertex_id_t *vertices, size_t num_vertices, bool create_vertices = false, bool commit = false)¶ Create edges between a vertex and several vertices of the same type.
- Return
information whether operation succeeded or not
- Parameters
vertex: the vertex to connect to otherstype: target vertices typevertices: the vertices to connect to vertexnum_vertices: number of target verticescreate_vertices: whether vertices should be created as wellcommit: whether uncommitted operations should be flushed or not
-
Status
insert(const vertex_uid_t &vertex, vertex_t type, const std::size_t *vertices, const char *const *vertex_payloads, const std::size_t *vertex_payloads_sizes, size_t num_vertices, bool create_vertices = false, bool commit = false)¶ Creates edges between a vertex and several vertices of the same type.
- Return
information whether operation succeeded or not
- Parameters
vertex: the vertex to connect to otherstype: target vertices typevertices: the vertices to connect to vertexvertex_payloads: payload of every target vertex Use nullptr is there is no payload.vertex_payloads_sizes: payload size of every target vertexnum_vertices: number of target verticescreate_vertices: whether vertices should be created as wellcommit: whether uncommitted operations should be flushed or not
-
Status
get(const edge_uid_t &edge, std::string *value) const¶ Retrieve an edge payload.
- Return
information whether operation succeeded or not
- Parameters
edge: unique identifier to retrievevalue: payload object updated if the edge exists and has an associated payload
-
Status
has(const vertex_uid_t &vertex1, const vertex_uid_t &vertex2, bool &result) const¶ check connectivity between 2 vertices
- Return
provides information whether operation succeeded or not
- Parameters
vertex1: first end of the edge to look forvertex2: second end of the edge to look forresult: a boolean indicating whether vertex1 and vertex2 are connected
-
Status
get(const vertex_uid_t &vertex, vertex_uids_t &edges) const¶ get vertices connected to a vertex
- Return
information whether operation succeeded or not
- Parameters
vertex: for directed graph, the head of the edges to look for, any end of the edges otherwiseedges: accumulator where connected vertices are added.
-
Status
get(const vertex_uid_t &vertex, vertex_t filter, vertex_uids_t &edges) const¶ get vertices of a specific type connected to one vertex
- Return
information whether operation succeeded or not
- Parameters
vertex: one end of the edges to lookfilter: type of target verticesedges: accumulator where connected vertices are added
-
Status
erase(const vertex_uid_t &vertex1, const vertex_uid_t &vertex2, bool commit = false)¶ remove edge between 2 vertices
- Return
information whether operation succeeded or not
- Parameters
vertex1: one end of the edge to removevertex2: other end of the edge to removecommit: whether uncommitted operations should be flushed or not
-
Status
erase(const vertex_uid_t &vertex, vertex_t filter, size_t &removed, bool commit = false)¶ remove edges of a given type
- Return
information whether operation succeeded or not
- Parameters
vertex: vertex from which to remove edgesfilter: type of target verticesremoved: number of vertices removed during the operationcommit: whether uncommitted operations should be flushed or not
-
Status
erase(const vertex_uid_t &vertex, std::size_t &removed, bool commit = false)¶ remove all edges of a vertex
- Return
information whether operation succeeded or not
- Parameters
vertex: one end of the edges to removecommit: whether uncommitted operations should be flushed or notremoved: number of vertices removed during the operation
-