11 #ifndef INCLUDE_MOLASSEMBLER_STEREOPERMUTATOR_LIST_H
12 #define INCLUDE_MOLASSEMBLER_STEREOPERMUTATOR_LIST_H
17 #include "boost/optional/optional_fwd.hpp"
22 namespace Molassembler {
24 class AtomStereopermutator;
25 class BondStereopermutator;
37 template<
typename Permutator>
43 "This type may not be instantiated for any type other than atom and bond stereopermutators"
46 using iterator_category = std::forward_iterator_tag;
47 using difference_type = std::ptrdiff_t;
48 using value_type = Permutator;
49 using pointer = Permutator*;
50 using reference = Permutator&;
60 using ImplType = std::conditional_t<
61 std::is_const<Permutator>::value,
69 reference operator * ()
const;
71 bool operator == (
const iterator& other)
const;
72 bool operator != (
const iterator& other)
const;
76 std::unique_ptr<Impl> impl_;
191 [[deprecated(
"Prefer remove")]]
198 [[deprecated(
"Prefer remove")]]
319 std::unique_ptr<Impl> impl_;
Defines basic types widely shared across the project.
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
Definition: StereopermutatorList.h:38
Manages all stereopermutators that are part of a Molecule.
Definition: StereopermutatorList.h:30
IteratorRange< BondStereopermutatorConstIterator > bondStereopermutators() const
Returns an iterable object with unmodifiable bond stereopermutator references.
IteratorRange< AtomStereopermutatorConstIterator > atomStereopermutators() const
Returns an iterable object with unmodifiable atom stereopermutator references.
void clearBonds()
Remove all stereopermutators on bonds.
void applyPermutation(const std::vector< AtomIndex > &permutation)
Apply an index mapping to the list of stereopermutators.
bool remove(AtomIndex index)
Removes the AtomStereopermutator on a specified index, if present.
unsigned B() const
Returns the number of BondStereopermutators.
bool remove(const BondIndex &edge)
Removes the BondStereopermutator on a specified edge, if present.
bool hasUnassignedStereopermutators() const
Returns true if there are unassigned stereopermutators.
bool empty() const
Returns true if there are no stereopermutators.
bool compare(const StereopermutatorList &other, AtomEnvironmentComponents componentBitmask) const
Modular comparison with another StereopermutatorList using a bitmask.
BondStereopermutator & at(const BondIndex &index)
Access bond stereopermutator at a bond.
void try_remove(const BondIndex &edge)
Removes the BondStereopermutator on a specified edge, if present.
boost::optional< const BondStereopermutator & > option(const BondIndex &edge) const
Fetch a const ref-option to a BondStereopermutator, if present.
AtomStereopermutator & add(AtomStereopermutator stereopermutator)
Add a new AtomStereopermutator to the list.
boost::optional< AtomStereopermutator & > option(AtomIndex index)
Fetch a reference-option to an AtomStereopermutator.
unsigned A() const
Returns the number of AtomStereopermutators.
const BondStereopermutator & at(const BondIndex &index) const
Access bond stereopermutator at a bond.
void try_remove(AtomIndex index)
Removes the AtomStereopermutator on a specified index, if present.
void propagateVertexRemoval(AtomIndex removedIndex)
Communicates the removal of a vertex index to all stereopermutators in the list.
bool hasZeroAssignmentStereopermutators() const
Returns true if there are any stereopermutators with zero possible assignments.
IteratorRange< AtomStereopermutatorIterator > atomStereopermutators()
Returns an iterable object with modifiable atom stereopermutator references.
const AtomStereopermutator & at(AtomIndex index) const
Access atom stereopermutator at an atom.
IteratorRange< BondStereopermutatorIterator > bondStereopermutators()
Returns an iterable object with modifiable bond stereopermutator references.
unsigned size() const
Combined size of atom and bond-stereopermutator lists.
AtomStereopermutator & at(AtomIndex index)
Access atom stereopermutator at an atom.
boost::optional< const AtomStereopermutator & > option(AtomIndex index) const
Fetch a const ref-option to an AtomStereopermutator, if present.
boost::optional< BondStereopermutator & > option(const BondIndex &edge)
Fetch a reference-option to a BondStereopermutator.
BondStereopermutator & add(BondStereopermutator stereopermutator)
Add a new BondStereopermutator to the list.
void clear()
Remove all stereopermutators.
AtomEnvironmentComponents
For bitmasks grouping components of immediate atom environments.
Definition: Types.h:103
std::size_t AtomIndex
Unsigned integer atom index type. Used to refer to particular atoms.
Definition: Types.h:51
Type used to refer to particular bonds. Orders first < second.
Definition: Types.h:54
Homogeneous pair of iterators with begin and end member fns.
Definition: IteratorRange.h:26
Definition: StereopermutatorListImpl.h:19