2.2.13.4. rule/GraphInterface.hpp

This header contains the definitions for the graph interface for rule::Rule.

2.2.13.4.1. Left

2.2.13.4.1.1. Class rule::Rule::LeftGraph

class rule::Rule::LeftGraph

A proxy object representing the left graph of the rule.

2.2.13.4.1.1.1. Synopsis

struct Rule::LeftGraph {
    class Vertex;
    class Edge;
    class VertexIterator;
    class VertexRange;
    class EdgeIterator;
    class EdgeRange;
    class IncidentEdgeIterator;
    class IncidentEdgeRange;
private:
    friend class Rule;
    LeftGraph(std::shared_ptr<Rule> r);
public:
    std::shared_ptr<Rule> getRule() const;
    std::size_t numVertices() const;
    VertexRange vertices() const;
    std::size_t numEdges() const;
    EdgeRange edges() const;
private:
    std::shared_ptr<Rule> r;
};

2.2.13.4.1.1.2. Details

std::shared_ptr<Rule> getRule() const
Returns

the rule where the graph belongs to.

std::size_t numVertices() const
Returns

the number of vertices in the graph.

VertexRange vertices() const
Returns

a range of all vertices in the graph.

std::size_t numEdges() const
Returns

the number of edges in the graph.

EdgeRange edges() const
Returns

a range of all edges in the graph.

2.2.13.4.1.2. Class rule::Rule::LeftGraph::Vertex

class rule::Rule::LeftGraph::Vertex

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

2.2.13.4.1.2.1. Synopsis

class Rule::LeftGraph::Vertex {
    friend class Rule::Vertex;
    friend class LeftGraph;
    friend class Edge;
    friend class VertexIterator;
    friend class VertexRange;
    Vertex(std::shared_ptr<Rule> r, std::size_t vId);
public:
    Vertex();
    MOD_DECL friend std::ostream &operator<<(std::ostream &s, const Vertex &v);
    MOD_DECL friend bool operator==(const Vertex &v1, const Vertex &v2);
    MOD_DECL friend bool operator!=(const Vertex &v1, const Vertex &v2);
    MOD_DECL friend bool operator<(const Vertex &v1, const Vertex &v2);
    std::size_t hash() const;
    explicit operator bool() const;
    bool isNull() const;
    std::size_t getId() const;
    std::shared_ptr<Rule> getRule() const;
    Rule::Vertex getCore() 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 graph::Printer &p) const;
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};

2.2.13.4.1.2.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<Rule> getRule() const
Returns

the rule the vertex belongs to.

Throws

LogicError if it is a null descriptor.

Rule::Vertex getCore() const
Returns

the descriptor for this vertex in the core graph.

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 graph::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.

2.2.13.4.1.3. Class rule::Rule::LeftGraph::Edge

class rule::Rule::LeftGraph::Edge

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

2.2.13.4.1.3.1. Synopsis

class Rule::LeftGraph::Edge {
    friend class Rule::Edge;
    friend class EdgeIterator;
    friend class IncidentEdgeIterator;
    Edge(std::shared_ptr<Rule> r, std::size_t vId, std::size_t eId);
public:
    Edge();
    MOD_DECL friend std::ostream &operator<<(std::ostream &s, const Edge &e);
    MOD_DECL friend bool operator==(const Edge &e1, const Edge &e2);
    MOD_DECL friend bool operator!=(const Edge &e1, const Edge &e2);
    MOD_DECL friend bool operator<(const Edge &e1, const Edge &e2);
    explicit operator bool() const;
    bool isNull() const;
    std::shared_ptr<Rule> getRule() const;
    Rule::Edge getCore() const;
    Vertex source() const;
    Vertex target() const;
    const std::string &getStringLabel() const;
    BondType getBondType() const;
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.1.3.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<Rule> getRule() const
Returns

the rule the edge belongs to.

Throws

LogicError if it is a null descriptor.

Rule::Edge getCore() const
Returns

the descriptor for this edge in the core graph.

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.

2.2.13.4.1.4. Class rule::Rule::LeftGraph::VertexIterator

class rule::Rule::LeftGraph::VertexIterator

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

2.2.13.4.1.4.1. Synopsis

class Rule::LeftGraph::VertexIterator : public boost::iterator_facade<VertexIterator, Vertex, std::forward_iterator_tag, Vertex> {
    friend class Rule;
    VertexIterator(std::shared_ptr<Rule> r);
public:
    VertexIterator();
private:
    friend class boost::iterator_core_access;
    Vertex dereference() const;
    bool equal(const VertexIterator &iter) const;
    void increment();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};

2.2.13.4.1.4.2. Details

VertexIterator()

Construct a past-the-end iterator.

2.2.13.4.1.5. Class rule::Rule::LeftGraph::VertexRange

class rule::Rule::LeftGraph::VertexRange

A range of all vertices in a rule.

2.2.13.4.1.5.1. Synopsis

struct Rule::LeftGraph::VertexRange {
    using iterator = VertexIterator;
    using const_iterator = iterator;
private:
    friend class Rule;
    VertexRange(std::shared_ptr<Rule> r);
public:
    VertexIterator begin() const;
    VertexIterator end() const;
private:
    std::shared_ptr<Rule> r;
};

2.2.13.4.1.6. Class rule::Rule::LeftGraph::EdgeIterator

class rule::Rule::LeftGraph::EdgeIterator

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

2.2.13.4.1.6.1. Synopsis

class Rule::LeftGraph::EdgeIterator : public boost::iterator_facade<EdgeIterator, Edge, std::forward_iterator_tag, Edge> {
    friend class Rule;
    EdgeIterator(std::shared_ptr<Rule> r);
public:
    EdgeIterator();
private:
    friend class boost::iterator_core_access;
    Edge dereference() const;
    bool equal(const EdgeIterator &iter) const;
    void increment();
    void advanceToValid();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.1.6.2. Details

EdgeIterator()

Construct a past-the-end iterator.

2.2.13.4.1.7. Class rule::Rule::LeftGraph::EdgeRange

class rule::Rule::LeftGraph::EdgeRange

A range of all edges in a rule.

2.2.13.4.1.7.1. Synopsis

struct Rule::LeftGraph::EdgeRange {
    using iterator = EdgeIterator;
    using const_iterator = iterator;
private:
    friend class Rule;
    EdgeRange(std::shared_ptr<Rule> r);
public:
    EdgeIterator begin() const;
    EdgeIterator end() const;
private:
    std::shared_ptr<Rule> r;
};

2.2.13.4.1.8. Class rule::Rule::LeftGraph::IncidnetEdgeIterator

class rule::Rule::LeftGraph::IncidnetEdgeIterator

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

2.2.13.4.1.8.1. Synopsis

class Rule::LeftGraph::IncidentEdgeIterator : public boost::iterator_facade<IncidentEdgeIterator, Edge, std::forward_iterator_tag, Edge> {
    friend class Rule;
    IncidentEdgeIterator(std::shared_ptr<Rule> r, std::size_t vId);
public:
    IncidentEdgeIterator();
private:
    friend class boost::iterator_core_access;
    Edge dereference() const;
    bool equal(const IncidentEdgeIterator &iter) const;
    void increment();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.1.8.2. Details

IncidentEdgeIterator()

Construct a past-the-end iterator.

2.2.13.4.1.9. Class rule::Rule::LeftGraph::IncidentEdgeRange

class rule::Rule::LeftGraph::IncidentEdgeRange

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

2.2.13.4.1.9.1. Synopsis

struct Rule::LeftGraph::IncidentEdgeRange {
    using iterator = IncidentEdgeIterator;
    using const_iterator = iterator;
private:
    friend class Vertex;
    IncidentEdgeRange(std::shared_ptr<Rule> r, std::size_t vId);
public:
    IncidentEdgeIterator begin() const;
    IncidentEdgeIterator end() const;
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};

2.2.13.4.2. Context

2.2.13.4.2.1. Class rule::Rule::ContextGraph

class rule::Rule::ContextGraph

A proxy object representing the context graph of the rule.

2.2.13.4.2.1.1. Synopsis

struct Rule::ContextGraph {
    class Vertex;
    class Edge;
    class VertexIterator;
    class VertexRange;
    class EdgeIterator;
    class EdgeRange;
    class IncidentEdgeIterator;
    class IncidentEdgeRange;
private:
    friend class Rule;
    ContextGraph(std::shared_ptr<Rule> r);
public:
    std::shared_ptr<Rule> getRule() const;
    std::size_t numVertices() const;
    VertexRange vertices() const;
    std::size_t numEdges() const;
    EdgeRange edges() const;
private:
    std::shared_ptr<Rule> r;
};

2.2.13.4.2.1.2. Details

std::shared_ptr<Rule> getRule() const
Returns

the rule where the graph belongs to.

std::size_t numVertices() const
Returns

the number of vertices in the graph.

VertexRange vertices() const
Returns

a range of all vertices in the graph.

std::size_t numEdges() const
Returns

the number of edges in the graph.

EdgeRange edges() const
Returns

a range of all edges in the graph.

2.2.13.4.2.2. Class rule::Rule::ContextGraph::Vertex

class rule::Rule::ContextGraph::Vertex

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

2.2.13.4.2.2.1. Synopsis

class Rule::ContextGraph::Vertex {
    friend class Rule;
    friend class Edge;
    friend class VertexIterator;
    friend class VertexRange;
    Vertex(std::shared_ptr<Rule> r, std::size_t vId);
public:
    Vertex();
    MOD_DECL friend std::ostream &operator<<(std::ostream &s, const Vertex &v);
    MOD_DECL friend bool operator==(const Vertex &v1, const Vertex &v2);
    MOD_DECL friend bool operator!=(const Vertex &v1, const Vertex &v2);
    MOD_DECL friend bool operator<(const Vertex &v1, const Vertex &v2);
    std::size_t hash() const;
    explicit operator bool() const;
    bool isNull() const;
    std::size_t getId() const;
    std::shared_ptr<Rule> getRule() const;
    Rule::Vertex getCore() const;
    std::size_t getDegree() const;
    IncidentEdgeRange incidentEdges() const;
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};

2.2.13.4.2.2.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<Rule> getRule() const
Returns

the rule the vertex belongs to.

Throws

LogicError if it is a null descriptor.

Rule::Vertex getCore() const
Returns

the descriptor for this vertex in the core graph.

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.

2.2.13.4.2.3. Class rule::Rule::ContextGraph::Edge

class rule::Rule::ContextGraph::Edge

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

2.2.13.4.2.3.1. Synopsis

class Rule::ContextGraph::Edge {
    friend class Rule::Edge;
    friend class EdgeIterator;
    friend class IncidentEdgeIterator;
    Edge(std::shared_ptr<Rule> r, std::size_t vId, std::size_t eId);
public:
    Edge();
    MOD_DECL friend std::ostream &operator<<(std::ostream &s, const Edge &e);
    MOD_DECL friend bool operator==(const Edge &e1, const Edge &e2);
    MOD_DECL friend bool operator!=(const Edge &e1, const Edge &e2);
    MOD_DECL friend bool operator<(const Edge &e1, const Edge &e2);
    explicit operator bool() const;
    bool isNull() const;
    std::shared_ptr<Rule> getRule() const;
    Rule::Edge getCore() const;
    Vertex source() const;
    Vertex target() const;
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.2.3.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<Rule> getRule() const
Returns

the rule the edge belongs to.

Throws

LogicError if it is a null descriptor.

Rule::Edge getCore() const
Returns

the descriptor for this edge in the core graph.

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.

2.2.13.4.2.4. Class rule::Rule::ContextGraph::VertexIterator

class rule::Rule::ContextGraph::VertexIterator

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

2.2.13.4.2.4.1. Synopsis

class Rule::ContextGraph::VertexIterator : public boost::iterator_facade<VertexIterator, Vertex, std::forward_iterator_tag, Vertex> {
    friend class Rule;
    VertexIterator(std::shared_ptr<Rule> r);
public:
    VertexIterator();
private:
    friend class boost::iterator_core_access;
    Vertex dereference() const;
    bool equal(const VertexIterator &iter) const;
    void increment();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};

2.2.13.4.2.4.2. Details

VertexIterator()

Construct a past-the-end iterator.

2.2.13.4.2.5. Class rule::Rule::ContextGraph::VertexRange

class rule::Rule::ContextGraph::VertexRange

A range of all vertices in a rule.

2.2.13.4.2.5.1. Synopsis

struct Rule::ContextGraph::VertexRange {
    using iterator = VertexIterator;
    using const_iterator = iterator;
private:
    friend class Rule;
    VertexRange(std::shared_ptr<Rule> r);
public:
    VertexIterator begin() const;
    VertexIterator end() const;
private:
    std::shared_ptr<Rule> r;
};

2.2.13.4.2.6. Class rule::Rule::ContextGraph::EdgeIterator

class rule::Rule::ContextGraph::EdgeIterator

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

2.2.13.4.2.6.1. Synopsis

class Rule::ContextGraph::EdgeIterator : public boost::iterator_facade<EdgeIterator, Edge, std::forward_iterator_tag, Edge> {
    friend class Rule;
    EdgeIterator(std::shared_ptr<Rule> r);
public:
    EdgeIterator();
private:
    friend class boost::iterator_core_access;
    Edge dereference() const;
    bool equal(const EdgeIterator &iter) const;
    void increment();
    void advanceToValid();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.2.6.2. Details

EdgeIterator()

Construct a past-the-end iterator.

2.2.13.4.2.7. Class rule::Rule::ContextGraph::EdgeRange

class rule::Rule::ContextGraph::EdgeRange

A range of all edges in a rule.

2.2.13.4.2.7.1. Synopsis

struct Rule::ContextGraph::EdgeRange {
    using iterator = EdgeIterator;
    using const_iterator = iterator;
private:
    friend class Rule;
    EdgeRange(std::shared_ptr<Rule> r);
public:
    EdgeIterator begin() const;
    EdgeIterator end() const;
private:
    std::shared_ptr<Rule> r;
};

2.2.13.4.2.8. Class rule::Rule::ContextGraph::IncidnetEdgeIterator

class rule::Rule::ContextGraph::IncidnetEdgeIterator

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

2.2.13.4.2.8.1. Synopsis

class Rule::ContextGraph::IncidentEdgeIterator : public boost::iterator_facade<IncidentEdgeIterator, Edge, std::forward_iterator_tag, Edge> {
    friend class Rule;
    IncidentEdgeIterator(std::shared_ptr<Rule> r, std::size_t vId);
public:
    IncidentEdgeIterator();
private:
    friend class boost::iterator_core_access;
    Edge dereference() const;
    bool equal(const IncidentEdgeIterator &iter) const;
    void increment();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.2.8.2. Details

IncidentEdgeIterator()

Construct a past-the-end iterator.

2.2.13.4.2.9. Class rule::Rule::ContextGraph::IncidentEdgeRange

class rule::Rule::ContextGraph::IncidentEdgeRange

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

2.2.13.4.2.9.1. Synopsis

struct Rule::ContextGraph::IncidentEdgeRange {
    using iterator = IncidentEdgeIterator;
    using const_iterator = iterator;
private:
    friend class Vertex;
    IncidentEdgeRange(std::shared_ptr<Rule> r, std::size_t vId);
public:
    IncidentEdgeIterator begin() const;
    IncidentEdgeIterator end() const;
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};

2.2.13.4.4. Core

2.2.13.4.4.1. Class rule::Rule::Vertex

class rule::Rule::Vertex

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

2.2.13.4.4.1.1. Synopsis

class Rule::Vertex {
    friend class Rule;
    friend class Edge;
    friend class VertexIterator;
    friend class VertexRange;
    Vertex(std::shared_ptr<Rule> r, std::size_t vId);
public:
    Vertex();
    MOD_DECL friend std::ostream &operator<<(std::ostream &s, const Vertex &v);
    MOD_DECL friend bool operator==(const Vertex &v1, const Vertex &v2);
    MOD_DECL friend bool operator!=(const Vertex &v1, const Vertex &v2);
    MOD_DECL friend bool operator<(const Vertex &v1, const Vertex &v2);
    std::size_t hash() const;
    explicit operator bool() const;
    bool isNull() const;
    std::size_t getId() const;
    std::shared_ptr<Rule> getRule() const;
    LeftGraph::Vertex getLeft() const;
    ContextGraph::Vertex getContext() const;
    RightGraph::Vertex getRight() const;
    std::size_t getDegree() const;
    IncidentEdgeRange incidentEdges() const;
    double get2DX(bool withHydrogens = true);
    double get2DY(bool withHydrogens = true);
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};

2.2.13.4.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<Rule> getRule() const
Returns

the rule the vertex belongs to.

Throws

LogicError if it is a null descriptor.

LeftGraph::Vertex getLeft() const
Returns

a null descriptor if this vertex is not in the left graph, otherwise the descriptor of this vertex in the left graph.

ContextGraph::Vertex getContext() const
Returns

a null descriptor if this vertex is not in the context graph, otherwise the descriptor of this vertex in the context graph.

RightGraph::Vertex getRight() const
Returns

a null descriptor if this vertex is not in the right graph, otherwise the descriptor of this vertex in the right graph.

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.

double get2DX(bool withHydrogens = true)
Returns

the x-coordinate in a 2D depiction of the rule. Different sets of coordinates exists for rendering with and wihout certain hydrogens.

Throws

LogicError if it is a null descriptor, or if withHydrogens is true and the vertex is a “clean” hydrogen.

double get2DY(bool withHydrogens = true)
Returns

the y-coordinate in a 2D depiction of the rule. Different sets of coordinates exists for rendering with and wihout certain hydrogens.

Throws

LogicError if it is a null descriptor, or if withHydrogens is true and the vertex is a “clean” hydrogen.

2.2.13.4.4.2. Class rule::Rule::Edge

class rule::Rule::Edge

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

2.2.13.4.4.2.1. Synopsis

class Rule::Edge {
    friend class Rule::LeftGraph::Edge;
    friend class Rule::ContextGraph::Edge;
    friend class Rule::RightGraph::Edge;
    friend class EdgeIterator;
    friend class IncidentEdgeIterator;
    Edge(std::shared_ptr<Rule> r, std::size_t vId, std::size_t eId);
public:
    Edge();
    MOD_DECL friend std::ostream &operator<<(std::ostream &s, const Edge &e);
    MOD_DECL friend bool operator==(const Edge &e1, const Edge &e2);
    MOD_DECL friend bool operator!=(const Edge &e1, const Edge &e2);
    MOD_DECL friend bool operator<(const Edge &e1, const Edge &e2);
    explicit operator bool() const;
    bool isNull() const;
    std::shared_ptr<Rule> getRule() const;
    LeftGraph::Edge getLeft() const;
    ContextGraph::Edge getContext() const;
    RightGraph::Edge getRight() const;
    Vertex source() const;
    Vertex target() const;
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.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<Rule> getRule() const
Returns

the rule the edge belongs to.

Throws

LogicError if it is a null descriptor.

LeftGraph::Edge getLeft() const
Returns

a null descriptor if this edge is not in the left graph, otherwise the descriptor of this edge in the left graph.

ContextGraph::Edge getContext() const
Returns

a null descriptor if this edge is not in the context graph, otherwise the descriptor of this edge in the context graph.

RightGraph::Edge getRight() const
Returns

a null descriptor if this edge is not in the right graph, otherwise the descriptor of this edge in the right graph.

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.

2.2.13.4.4.3. Class rule::Rule::VertexIterator

class rule::Rule::VertexIterator

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

2.2.13.4.4.3.1. Synopsis

class Rule::VertexIterator : public boost::iterator_facade<VertexIterator, Vertex, std::forward_iterator_tag, Vertex> {
    friend class Rule;
    VertexIterator(std::shared_ptr<Rule> r);
public:
    VertexIterator();
private:
    friend class boost::iterator_core_access;
    Vertex dereference() const;
    bool equal(const VertexIterator &iter) const;
    void increment();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};

2.2.13.4.4.3.2. Details

VertexIterator()

Construct a past-the-end iterator.

2.2.13.4.4.4. Class rule::Rule::VertexRange

class rule::Rule::VertexRange

A range of all vertices in a rule.

2.2.13.4.4.4.1. Synopsis

struct Rule::VertexRange {
    using iterator = VertexIterator;
    using const_iterator = iterator;
private:
    friend class Rule;
    VertexRange(std::shared_ptr<Rule> r);
public:
    VertexIterator begin() const;
    VertexIterator end() const;
    Vertex operator[](std::size_t i) const;
private:
    std::shared_ptr<Rule> r;
};

2.2.13.4.4.5. Class rule::Rule::EdgeIterator

class rule::Rule::EdgeIterator

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

2.2.13.4.4.5.1. Synopsis

class Rule::EdgeIterator : public boost::iterator_facade<EdgeIterator, Edge, std::forward_iterator_tag, Edge> {
    friend class Rule;
    EdgeIterator(std::shared_ptr<Rule> r);
public:
    EdgeIterator();
private:
    friend class boost::iterator_core_access;
    Edge dereference() const;
    bool equal(const EdgeIterator &iter) const;
    void increment();
    void advanceToValid();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.4.5.2. Details

EdgeIterator()

Construct a past-the-end iterator.

2.2.13.4.4.6. Class rule::Rule::EdgeRange

class rule::Rule::EdgeRange

A range of all edges in a rule.

2.2.13.4.4.6.1. Synopsis

struct Rule::EdgeRange {
    using iterator = EdgeIterator;
    using const_iterator = iterator;
private:
    friend class Rule;
    EdgeRange(std::shared_ptr<Rule> r);
public:
    EdgeIterator begin() const;
    EdgeIterator end() const;
private:
    std::shared_ptr<Rule> r;
};

2.2.13.4.4.7. Class rule::Rule::IncidnetEdgeIterator

class rule::Rule::IncidnetEdgeIterator

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

2.2.13.4.4.7.1. Synopsis

class Rule::IncidentEdgeIterator : public boost::iterator_facade<IncidentEdgeIterator, Edge, std::forward_iterator_tag, Edge> {
    friend class Rule;
    IncidentEdgeIterator(std::shared_ptr<Rule> r, std::size_t vId);
public:
    IncidentEdgeIterator();
private:
    friend class boost::iterator_core_access;
    Edge dereference() const;
    bool equal(const IncidentEdgeIterator &iter) const;
    void increment();
private:
    std::shared_ptr<Rule> r;
    std::size_t vId, eId;
};

2.2.13.4.4.7.2. Details

IncidentEdgeIterator()

Construct a past-the-end iterator.

2.2.13.4.4.8. Class rule::Rule::IncidentEdgeRange

class rule::Rule::IncidentEdgeRange

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

2.2.13.4.4.8.1. Synopsis

struct Rule::IncidentEdgeRange {
    using iterator = IncidentEdgeIterator;
    using const_iterator = iterator;
private:
    friend class Vertex;
    IncidentEdgeRange(std::shared_ptr<Rule> r, std::size_t vId);
public:
    IncidentEdgeIterator begin() const;
    IncidentEdgeIterator end() const;
private:
    std::shared_ptr<Rule> r;
    std::size_t vId;
};