29 #ifndef CDPL_FORCEFIELD_MMFF94BONDCHARGEINCREMENTTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94BONDCHARGEINCREMENTTABLE_HPP
35 #include <unordered_map>
39 #include <boost/iterator/transform_iterator.hpp>
65 typedef std::unordered_map<std::uint32_t, Entry> DataStorage;
92 Entry(
unsigned int bond_type_idx,
unsigned int atom1_type,
unsigned int atom2_type,
double bond_chg_inc);
125 unsigned int bondTypeIdx;
126 unsigned int atom1Type;
127 unsigned int atom2Type;
135 typedef boost::transform_iterator<std::function<
const Entry&(
const DataStorage::value_type&)>,
136 DataStorage::const_iterator>
142 typedef boost::transform_iterator<std::function<
Entry&(DataStorage::value_type&)>,
143 DataStorage::iterator>
158 void addEntry(
unsigned int bond_type_idx,
unsigned int atom1_type,
unsigned int atom2_type,
double bond_chg_inc);
167 const Entry&
getEntry(
unsigned int bond_type_idx,
unsigned int atom1_type,
unsigned int atom2_type)
const;
187 bool removeEntry(
unsigned int bond_type_idx,
unsigned int atom1_type,
unsigned int atom2_type);
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Data structure for the storage of values associated with a single table entry.
Definition: MMFF94BondChargeIncrementTable.hpp:77
unsigned int getBondTypeIndex() const
Returns the MMFF94 bond type index.
unsigned int getAtom1Type() const
Returns the numeric MMFF94 atom type of the first bonded atom.
unsigned int getAtom2Type() const
Returns the numeric MMFF94 atom type of the second bonded atom.
Entry(unsigned int bond_type_idx, unsigned int atom1_type, unsigned int atom2_type, double bond_chg_inc)
Constructs an Entry for the given query values and charge increment.
Entry()
Constructs an empty (uninitialized) Entry instance.
double getChargeIncrement() const
Returns the bond charge increment.
Data structure for the storage and lookup of MMFF94 bond charge increments.
Definition: MMFF94BondChargeIncrementTable.hpp:59
const Entry & getEntry(unsigned int bond_type_idx, unsigned int atom1_type, unsigned int atom2_type) const
Returns a reference to the entry matching the specified query values.
ConstEntryIterator getEntriesBegin() const
Returns a constant iterator pointing to the beginning of the entry list.
static const SharedPointer & get()
Returns the process-wide default table (lazily initialized on first call).
EntryIterator removeEntry(const EntryIterator &it)
Removes the entry pointed to by the iterator it.
EntryIterator getEntriesEnd()
Returns a mutable iterator pointing one past the last entry.
EntryIterator getEntriesBegin()
Returns a mutable iterator pointing to the beginning of the entry list.
boost::transform_iterator< std::function< Entry &(DataStorage::value_type &)>, DataStorage::iterator > EntryIterator
A mutable iterator over the entries of the table.
Definition: MMFF94BondChargeIncrementTable.hpp:144
EntryIterator end()
Returns a mutable iterator pointing one past the last entry (alias of getEntriesEnd()).
void load(std::istream &is)
Loads table entries from the input stream is.
EntryIterator begin()
Returns a mutable iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
void addEntry(unsigned int bond_type_idx, unsigned int atom1_type, unsigned int atom2_type, double bond_chg_inc)
Adds a new (or overwrites an existing) entry for the given query values and charge increment.
ConstEntryIterator getEntriesEnd() const
Returns a constant iterator pointing one past the last entry.
void loadDefaults()
Loads the built-in default MMFF94 bond charge increment entries.
void clear()
Removes all entries from the table.
bool removeEntry(unsigned int bond_type_idx, unsigned int atom1_type, unsigned int atom2_type)
Removes the entry matching the specified query values.
std::size_t getNumEntries() const
Returns the number of entries in the table.
ConstEntryIterator end() const
Returns a constant iterator pointing one past the last entry (alias of getEntriesEnd()).
std::shared_ptr< MMFF94BondChargeIncrementTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondChargeIncrementTable in...
Definition: MMFF94BondChargeIncrementTable.hpp:71
boost::transform_iterator< std::function< const Entry &(const DataStorage::value_type &)>, DataStorage::const_iterator > ConstEntryIterator
A constant iterator over the entries of the table.
Definition: MMFF94BondChargeIncrementTable.hpp:137
static void set(const SharedPointer &table)
Replaces the process-wide default table by table.
ConstEntryIterator begin() const
Returns a constant iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
MMFF94BondChargeIncrementTable()
Constructs an empty MMFF94BondChargeIncrementTable instance.
The namespace of the Chemical Data Processing Library.