Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Scine::Molassembler::BondIndex Struct Reference

Type used to refer to particular bonds. Orders first < second. More...

#include <Types.h>

Public Types

using const_iterator = const AtomIndex *
 

Public Member Functions

 BondIndex ()
 Default constructor, leaves members uninitialized.
 
 BondIndex (AtomIndex a, AtomIndex b) noexcept
 Component constructor, establishes ordering.
 
bool contains (AtomIndex a) const
 Whether first or second is a.
 
bool operator< (const BondIndex &other) const
 Lexicographic comparison.
 
bool operator== (const BondIndex &other) const
 Lexicographic comparison.
 
const_iterator begin () const
 Returns the address of first.
 
const_iterator end () const
 Returns the address past second.
 

Data Fields

AtomIndex first
 Smaller atom index.
 
AtomIndex second
 Larger atom index.
 

Detailed Description

Type used to refer to particular bonds. Orders first < second.

Member Typedef Documentation

Iterator type is just a pointer to member

Since the standard guarantees that struct members are laid out successively in memory, we can implement an iterator using just pointers. It doesn't have the necessary typedefs for STL algorithms, but could be useful just the same.


The documentation for this struct was generated from the following file: