.. _cpp-graph/GraphInterface: ********************************************************** graph/GraphInterface.hpp ********************************************************** .. default-domain:: cpp .. default-role:: cpp:expr .. py:currentmodule:: mod .. cpp:namespace:: mod This header contains the definitions for the graph interface for :cpp:class:`graph::Graph`. Class ``graph::Graph::Vertex`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: graph::Graph::Vertex A descriptor of either a vertex in a graph, or a null vertex. Synopsis ^^^^^^^^ .. alias:: graph::Graph::Vertex :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: graph::Graph::Vertex .. function:: Vertex() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: std::size_t getId() const :returns: the index of the vertex. It will be in the range :math:`[0, numVertices[`. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::shared_ptr getGraph() const :returns: the graph the vertex belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::size_t getDegree() const :returns: the degree of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: IncidentEdgeRange incidentEdges() const :returns: a range of incident edges to this vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: const std::string &getStringLabel() const :returns: the string label of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: AtomId getAtomId() const :returns: the atom id of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Isotope getIsotope() const :returns: the isotope of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Charge getCharge() const :returns: the charge of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: bool getRadical() const :returns: the radical status of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: 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: :cpp:class:`LogicError` if it is a null descriptor. .. cpp:namespace-pop:: Class ``graph::Graph::Edge`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: graph::Graph::Edge A descriptor of either an edge in a graph, or a null edge. Synopsis ^^^^^^^^ .. alias:: graph::Graph::Edge :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: graph::Graph::Edge .. function:: Edge() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: std::shared_ptr getGraph() const :returns: the graph the edge belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex source() const :returns: the source vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex target() const :returns: the target vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: const std::string &getStringLabel() const :returns: the string label of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: BondType getBondType() const :returns: the bond type of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. cpp:namespace-pop:: Class ``graph::Graph::VertexIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: graph::Graph::VertexIterator An iterator for traversing all vertices in a graph. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: graph::Graph::VertexIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: graph::Graph::VertexIterator .. function:: VertexIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``graph::Graph::VertexRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: graph::Graph::VertexRange A range of all vertices in a graph. Synopsis ^^^^^^^^ .. alias:: graph::Graph::VertexRange :maxdepth: 2 :noroot: Class ``graph::Graph::EdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: graph::Graph::EdgeIterator An iterator for traversing all edges in a graph. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: graph::Graph::EdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: graph::Graph::EdgeIterator .. function:: EdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``graph::Graph::EdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: graph::Graph::EdgeRange A range of all edges in a graph. Synopsis ^^^^^^^^ .. alias:: graph::Graph::EdgeRange :maxdepth: 2 :noroot: Class ``graph::Graph::IncidentEdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: graph::Graph::IncidentEdgeIterator An iterator for traversing all edges in a graph. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: graph::Graph::IncidentEdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: graph::Graph::IncidentEdgeIterator .. function:: IncidentEdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``graph::Graph::IncidentEdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: graph::Graph::IncidentEdgeRange A range of all incident edges to a vertex in a graph. Synopsis ^^^^^^^^ .. alias:: graph::Graph::IncidentEdgeRange :maxdepth: 2 :noroot: