3.2.12.4. graph/GraphInterface.hpp

This header contains the definitions for the graph interface for graph::Graph.

3.2.12.4.1. Class graph::Graph::Vertex

class graph::Graph::Vertex

A descriptor of either a vertex in a graph, or a null vertex.

3.2.12.4.1.1. Synopsis

Vertex()
explicit operator bool() const
bool isNull() const
std::size_t getId() const
std::shared_ptr<Graph> getGraph() const
std::size_t getDegree() const
IncidentEdgeRange incidentEdges() const
const std::string &getStringLabel() const
AtomId getAtomId() const
Isotope getIsotope() const
Charge getCharge() const
bool getRadical() const
std::string printStereo() const
std::string printStereo(const Printer &p) const

3.2.12.4.1.2. Details

Vertex()

Constructs a null descriptor.

explicit operator bool() const
Returns:

!isNull()

bool isNull() const
Returns:

whether this is a null descriptor or not.

std::size_t getId() const
Returns:

the index of the vertex. It will be in the range \([0, numVertices[\).

Throws:

LogicError if it is a null descriptor.

std::shared_ptr<Graph> getGraph() const
Returns:

the graph the vertex belongs to.

Throws:

LogicError if it is a null descriptor.

std::size_t getDegree() const
Returns:

the degree of the vertex.

Throws:

LogicError if it is a null descriptor.

IncidentEdgeRange incidentEdges() const
Returns:

a range of incident edges to this vertex.

Throws:

LogicError if it is a null descriptor.

const std::string &getStringLabel() const
Returns:

the string label of the vertex.

Throws:

LogicError if it is a null descriptor.

AtomId getAtomId() const
Returns:

the atom id of the vertex.

Throws:

LogicError if it is a null descriptor.

Isotope getIsotope() const
Returns:

the isotope of the vertex.

Throws:

LogicError if it is a null descriptor.

Charge getCharge() const
Returns:

the charge of the vertex.

Throws:

LogicError if it is a null descriptor.

bool getRadical() const
Returns:

the radical status of the vertex.

Throws:

LogicError if it is a null descriptor.

std::string printStereo() const
std::string printStereo(const Printer &p) const

Print the stereo configuration for the vertex.

Returns:

the name of the PDF-file that will be compiled in post-processing.

Throws:

LogicError if it is a null descriptor.

3.2.12.4.2. Class graph::Graph::Edge

class graph::Graph::Edge

A descriptor of either an edge in a graph, or a null edge.

3.2.12.4.2.1. Synopsis

Edge()
explicit operator bool() const
bool isNull() const
std::shared_ptr<Graph> getGraph() const
Vertex source() const
Vertex target() const
const std::string &getStringLabel() const
BondType getBondType() const

3.2.12.4.2.2. Details

Edge()

Constructs a null descriptor.

explicit operator bool() const
Returns:

!isNull()

bool isNull() const
Returns:

whether this is a null descriptor or not.

std::shared_ptr<Graph> getGraph() const
Returns:

the graph the edge belongs to.

Throws:

LogicError if it is a null descriptor.

Vertex source() const
Returns:

the source vertex of the edge.

Throws:

LogicError if it is a null descriptor.

Vertex target() const
Returns:

the target vertex of the edge.

Throws:

LogicError if it is a null descriptor.

const std::string &getStringLabel() const
Returns:

the string label of the edge.

Throws:

LogicError if it is a null descriptor.

BondType getBondType() const
Returns:

the bond type of the edge.

Throws:

LogicError if it is a null descriptor.

3.2.12.4.3. Class graph::Graph::VertexIterator

class graph::Graph::VertexIterator

An iterator for traversing all vertices in a graph. It models a forward iterator.

3.2.12.4.3.1. Synopsis

VertexIterator()

3.2.12.4.3.2. Details

VertexIterator()

Construct a past-the-end iterator.

3.2.12.4.4. Class graph::Graph::VertexRange

class graph::Graph::VertexRange

A range of all vertices in a graph.

3.2.12.4.4.1. Synopsis

3.2.12.4.5. Class graph::Graph::EdgeIterator

class graph::Graph::EdgeIterator

An iterator for traversing all edges in a graph. It models a forward iterator.

3.2.12.4.5.1. Synopsis

EdgeIterator()

3.2.12.4.5.2. Details

EdgeIterator()

Construct a past-the-end iterator.

3.2.12.4.6. Class graph::Graph::EdgeRange

class graph::Graph::EdgeRange

A range of all edges in a graph.

3.2.12.4.6.1. Synopsis

3.2.12.4.7. Class graph::Graph::IncidentEdgeIterator

class graph::Graph::IncidentEdgeIterator

An iterator for traversing all edges in a graph. It models a forward iterator.

3.2.12.4.7.1. Synopsis

IncidentEdgeIterator()

3.2.12.4.7.2. Details

IncidentEdgeIterator()

Construct a past-the-end iterator.

3.2.12.4.8. Class graph::Graph::IncidentEdgeRange

class graph::Graph::IncidentEdgeRange

A range of all incident edges to a vertex in a graph.

3.2.12.4.8.1. Synopsis