Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
GraphInterface.h
Go to the documentation of this file.
1 
8 #ifndef INCLUDE_MOLASSEMBLER_GRAPH_INTERFACE_H
9 #define INCLUDE_MOLASSEMBLER_GRAPH_INTERFACE_H
10 
11 #include "Molassembler/Types.h"
12 
13 #include "boost/optional/optional_fwd.hpp"
15 
16 namespace Scine {
17 namespace Molassembler {
18 
19 class Cycles;
20 
22  virtual ~GraphInterface() = default;
23 
26  virtual AtomIndex addAtom(Utils::ElementType e, AtomIndex i, BondType type) = 0;
27 
28  virtual BondIndex addBond(AtomIndex i, AtomIndex j, BondType type) = 0;
29 
30  virtual void setElementType(AtomIndex i, Utils::ElementType type) = 0;
31 
32  virtual bool setBondType(AtomIndex i, AtomIndex j, BondType type) = 0;
33 
34  virtual void removeAtom(AtomIndex i) = 0;
35 
36  virtual void removeBond(const BondIndex& bond) = 0;
38 
41  virtual bool adjacent(AtomIndex a, AtomIndex b) const = 0;
42 
43  virtual boost::optional<BondIndex> bond(AtomIndex a, AtomIndex b) const = 0;
44 
45  virtual BondType bondType(const BondIndex& edge) const = 0;
46 
47  virtual bool canRemove(AtomIndex a) const = 0;
48 
49  virtual bool canRemove(const BondIndex& edge) const = 0;
50 
51  virtual const Cycles& cycles() const = 0;
52 
53  virtual unsigned degree(AtomIndex a) const = 0;
54 
55  virtual Utils::ElementType elementType(AtomIndex a) const = 0;
56 
57  virtual AtomIndex V() const = 0;
58 
59  virtual unsigned E() const = 0;
61 };
62 
63 } // namespace Molassembler
64 } // namespace Scine
65 
66 #endif
Defines basic types widely shared across the project.
Definition: GraphInterface.h:21
Wrapper class to make working with RDL in C++ more pleasant.
Definition: Cycles.h:44
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
BondType
Discrete bond type numeration.
Definition: Types.h:26
Type used to refer to particular bonds. Orders first &lt; second.
Definition: Types.h:54