Template Class Vertices¶
Defined in File fwd.hpp
Class Documentation¶
-
template<EdgeOrientation
Orientation
>
classVertices
¶ Manipulate graph vertices.
Public Functions
-
Vertices
(GraphImpl<Orientation> &pimpl)¶ Build a Vertices
- Parameters
pimpl
: Pointer to implementation
-
VertexIterator
begin
(std::size_t position = 0) const¶ Iterate over vertices.
- Return
vertex iterator
- Parameters
position
: starting position, default at the beginning
-
VertexIterator
end
() const¶ - Return
an iterator referring to the past-the-end
-
Status
count
(std::size_t &count) const¶ get number of vertices in the graph
- Return
information whether operation succeeded or not
- Parameters
count
: non-const reference updated by this member function with the number of vertices in the graph
-
Status
count
(vertex_t type, std::size_t &count) const¶ get number of vertices of a certain type in the graph
- Return
information whether operation succeeded or not
- Parameters
type
: type of vertexcount
: non-const reference updated by this member function
-
Status
clear
(bool commit)¶ Remove all vertices of the graph along with their edges.
- Return
information whether operation succeeded or not
- Parameters
commit
: whether uncommitted operations should be flushed or not
-
Status
insert
(const vertex_uid_t &vertex, bool commit = false)¶ Insert a vertex in the graph.
- Return
information whether operation succeeded or not
- Parameters
vertex
: the vertex unique identifier to insertcommit
: whether uncommitted operations should be flushed or not
-
template<typename
Payload
>
Statusinsert
(const vertex_uid_t &vertex, const Payload &data, bool commit = false)¶ Insert a vertex in the graph.
- Return
information whether operation succeeded or not
- Template Parameters
Payload
: vertex payload type
- Parameters
vertex
: the vertex unique identifier to insertdata
: vertex payloadcommit
: whether uncommitted operations should be flushed or not
-
Status
insert
(const vertex_uid_t &vertex, const char *data, std::size_t size, bool commit = false)¶ Insert a vertex in the graph.
- Return
information whether operation succeeded or not
- Parameters
vertex
: vertex unique identifier to insertdata
: vertex payloadsize
: payload lengthcommit
: whether uncommitted operations should be flushed or not
-
Status
insert
(const vertex_t *types, const vertex_id_t *ids, const char *const *payloads, const std::size_t *payloads_sizes, size_t num_vertices, bool commit = false)¶ Insert a list of vertices all at once.
- Return
information whether operation succeeded or not
- Parameters
types
: array of vertex typesids
: array of vertex identifierspayloads
: array of serialized data, nullptr if none of the vertices have a payloadpayloads_sizes
: size of every payloads, nullptr if none of the vertex have a payloadnum_vertices
: number of vertexs to insertcommit
: whether uncommitted operations should be flushed or not
-
template<typename
T
>
Statusget
(const vertex_uid_t &vertex, T &payload) const¶ Retrieve a vertex from the graph.
- Return
information whether operation succeeded or not
- Template Parameters
T
: vertex payload type
- Parameters
vertex
: the vertex to retrievepayload
: object updated if vertex is present
-
Status
get
(const vertex_uid_t &vertex, std::string *value) const¶ Retrieve a vertex payload.
- Return
information whether operation succeeded or not
- Parameters
vertex
: the vertex to retrievevalue
: payload object updated if vertex exists and has an associated payload
-
Status
has
(const vertex_uid_t &vertex, bool &result) const¶ Check presence of a vertex in the graph.
- Return
information whether operation managed to update result
- Parameters
vertex
: the vertex to look forresult
: reference set to true if vertex exists, false otherwise
-
Status
erase
(const vertex_uid_t &vertex, bool commit = false)¶ Remove a vertex from the graph.
- Return
information whether operation succeeded or not
- Parameters
vertex
: the vertex to removecommit
: whether uncommitted operations should be flushed or not
-