Molassembler  1.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
StereopermutatorListImpl.h
Go to the documentation of this file.
1 
8 #ifndef INCLUDE_MOLASSEMBLER_STEREOPERMUTATOR_LIST_IMPL_H
9 #define INCLUDE_MOLASSEMBLER_STEREOPERMUTATOR_LIST_IMPL_H
10 
13 
14 #include <unordered_map>
15 
16 namespace Scine {
17 namespace Molassembler {
18 
20  using AtomMapType = std::unordered_map<AtomIndex, AtomStereopermutator>;
21  using BondMapType = std::unordered_map<BondIndex, BondStereopermutator, boost::hash<BondIndex>>;
22 
25 
33 
41  BondStereopermutator& at(const BondIndex& index);
42 
50 
58 
66  void applyPermutation(const std::vector<AtomIndex>& permutation);
67 
72  void clear();
73 
78  void clearBonds();
79 
84  boost::optional<AtomStereopermutator&> option(AtomIndex index);
85 
90  boost::optional<BondStereopermutator&> option(const BondIndex& edge);
91 
100  void propagateVertexRemoval(AtomIndex removedIndex);
101 
106  void remove(AtomIndex index);
107 
112  void remove(const BondIndex& edge);
113 
118  void try_remove(AtomIndex index);
119 
124  void try_remove(const BondIndex& edge);
126 
129 
136  const AtomStereopermutator& at(AtomIndex index) const;
137 
145  const BondStereopermutator& at(const BondIndex& index) const;
146 
151  bool compare(
152  const Impl& other,
153  AtomEnvironmentComponents componentBitmask
154  ) const;
155 
160  bool empty() const;
161 
167 
172  bool hasUnassignedStereopermutators() const;
173 
178  boost::optional<const AtomStereopermutator&> option(AtomIndex index) const;
179 
184  boost::optional<const BondStereopermutator&> option(const BondIndex& edge) const;
185 
190  unsigned A() const;
191 
196  unsigned B() const;
197 
202  unsigned size() const;
204 
207 
211  bool operator == (const Impl& other) const;
213 
216 
219 };
220 
221 } // namespace Molassembler
222 } // namespace Scine
223 #endif
unsigned A() const
Returns the number of AtomStereopermutators.
boost::optional< AtomStereopermutator & > option(AtomIndex index)
Fetch a reference-option to an AtomStereopermutator.
void applyPermutation(const std::vector< AtomIndex > &permutation)
Apply an index mapping to the list of stereopermutators.
BondMapType bondStereopermutators
The underlying storage for bond stereopermutators.
Definition: StereopermutatorListImpl.h:218
AtomStereopermutator & at(AtomIndex index)
Access atom stereopermutator at an atom.
AtomMapType atomStereopermutators
The underlying storage for atom stereopermutators.
Definition: StereopermutatorListImpl.h:215
AtomEnvironmentComponents
For bitmasks grouping components of immediate atom environments.
Definition: Types.h:103
Handles the steric permutation of substituents of a non-terminal central atom.
Definition: AtomStereopermutator.h:79
Handles specific relative arrangements of two atom stereopermutators joined by a bond.
Definition: BondStereopermutator.h:46
unsigned size() const
Combined size of atom and bond-stereopermutator lists.
void clearBonds()
Remove all stereopermutators on bonds.
AtomStereopermutator & add(AtomStereopermutator stereopermutator)
Add a new AtomStereopermutator to the list.
void try_remove(AtomIndex index)
Removes the AtomStereopermutator on a specified index, if present.
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
void clear()
Remove all stereopermutators.
Handle rotational arrangements of adjacent atom-centered shapes.
bool compare(const Impl &other, AtomEnvironmentComponents componentBitmask) const
Modular comparison with another StereopermutatorList using a bitmask.
Type used to refer to particular bonds. Orders first &lt; second.
Definition: Types.h:54
bool hasUnassignedStereopermutators() const
Returns true if there are unassigned stereopermutators.
bool hasZeroAssignmentStereopermutators() const
Returns true if there are any stereopermutators with zero possible assignments.
bool operator==(const Impl &other) const
Strict equality comparison.
bool empty() const
Returns true if there are no stereopermutators.
void propagateVertexRemoval(AtomIndex removedIndex)
Communicates the removal of a vertex index to all stereopermutators in the list.
Owning class storing all stereopermutators in a molecule.
Definition: StereopermutatorListImpl.h:19
unsigned B() const
Returns the number of BondStereopermutators.