Data structure representing a library of pre-generated molecular fragment conformer ensembles.
More...
#include <FragmentLibrary.hpp>
Data structure representing a library of pre-generated molecular fragment conformer ensembles.
Entries are FragmentLibraryEntry instances keyed by the hash code of the associated ConfGen::CanonicalFragment. The library is iterable, supports lookup/insertion/removal, can be serialized to and from a stream, and provides a process-wide default instance via the static set() / get() accessors. A built-in mutex is exposed via getMutex() to allow callers to coordinate concurrent access.
- See also
- [CFRG]
◆ SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibrary instances.
◆ Entry
The type of a stored hash-code-to-entry pair.
◆ ConstEntryIterator
A constant iterator over the stored entries.
◆ EntryIterator
A mutable iterator over the stored entries.
◆ FragmentLibrary() [1/2]
| CDPL::ConfGen::FragmentLibrary::FragmentLibrary |
( |
| ) |
|
Constructs an empty FragmentLibrary instance.
◆ FragmentLibrary() [2/2]
| CDPL::ConfGen::FragmentLibrary::FragmentLibrary |
( |
const FragmentLibrary & |
lib | ) |
|
Constructs a copy of the FragmentLibrary instance lib.
- Parameters
-
| lib | The FragmentLibrary to copy. |
◆ ~FragmentLibrary()
| CDPL::ConfGen::FragmentLibrary::~FragmentLibrary |
( |
| ) |
|
◆ operator=()
Replaces the contents of this library with a copy of the contents of lib.
- Parameters
-
| lib | The source FragmentLibrary. |
- Returns
- A reference to itself.
◆ addEntries()
| void CDPL::ConfGen::FragmentLibrary::addEntries |
( |
const FragmentLibrary & |
lib | ) |
|
Adds all entries from lib to this library.
- Parameters
-
| lib | The source FragmentLibrary. |
◆ addEntry()
Adds the given entry to the library.
- Parameters
-
- Returns
true if the entry was added, and false if an entry with the same hash code was already present.
◆ getEntry()
Returns the entry with the specified hash code.
- Parameters
-
| hash_code | The hash code of the queried entry. |
- Returns
- A
const reference to the matching entry's smart pointer, or to an empty smart pointer if no entry with hash_code exists.
◆ containsEntry()
| bool CDPL::ConfGen::FragmentLibrary::containsEntry |
( |
std::uint64_t |
hash_code | ) |
const |
Tells whether the library contains an entry with the specified hash code.
- Parameters
-
| hash_code | The hash code of the queried entry. |
- Returns
true if the entry exists, and false otherwise.
◆ getNumEntries()
| std::size_t CDPL::ConfGen::FragmentLibrary::getNumEntries |
( |
| ) |
const |
Returns the number of entries stored in the library.
- Returns
- The number of entries.
◆ clear()
| void CDPL::ConfGen::FragmentLibrary::clear |
( |
| ) |
|
Removes all entries from the library.
◆ removeEntry() [1/2]
| bool CDPL::ConfGen::FragmentLibrary::removeEntry |
( |
std::uint64_t |
hash_code | ) |
|
Removes the entry with the specified hash code.
- Parameters
-
| hash_code | The hash code of the entry to remove. |
- Returns
true if the entry was removed, and false if no matching entry existed.
◆ removeEntry() [2/2]
Removes the entry referenced by the given iterator.
- Parameters
-
| it | Iterator referencing the entry to remove. |
- Returns
- An iterator pointing to the entry following the removed one.
◆ getEntriesBegin() [1/2]
Returns a constant iterator pointing to the first entry of the library.
- Returns
- A constant iterator pointing to the first entry.
◆ getEntriesEnd() [1/2]
Returns a constant iterator pointing one past the last entry of the library.
- Returns
- A constant iterator pointing one past the last entry.
◆ getEntriesBegin() [2/2]
| EntryIterator CDPL::ConfGen::FragmentLibrary::getEntriesBegin |
( |
| ) |
|
Returns a mutable iterator pointing to the first entry of the library.
- Returns
- A mutable iterator pointing to the first entry.
◆ getEntriesEnd() [2/2]
Returns a mutable iterator pointing one past the last entry of the library.
- Returns
- A mutable iterator pointing one past the last entry.
◆ begin() [1/2]
Returns a constant iterator pointing to the first entry of the library (range-based for support).
- Returns
- A constant iterator pointing to the first entry.
◆ end() [1/2]
Returns a constant iterator pointing one past the last entry of the library (range-based for support).
- Returns
- A constant iterator pointing one past the last entry.
◆ begin() [2/2]
Returns a mutable iterator pointing to the first entry of the library (range-based for support).
- Returns
- A mutable iterator pointing to the first entry.
◆ end() [2/2]
Returns a mutable iterator pointing one past the last entry of the library (range-based for support).
- Returns
- A mutable iterator pointing one past the last entry.
◆ load()
| void CDPL::ConfGen::FragmentLibrary::load |
( |
std::istream & |
is | ) |
|
Loads the contents of the library from the input stream is.
- Parameters
-
| is | The input stream to read from. |
◆ save()
| void CDPL::ConfGen::FragmentLibrary::save |
( |
std::ostream & |
os | ) |
const |
Writes the contents of the library to the output stream os.
- Parameters
-
| os | The output stream to write to. |
◆ loadDefaults()
| void CDPL::ConfGen::FragmentLibrary::loadDefaults |
( |
| ) |
|
Loads the default fragment library bundled with CDPKit.
◆ getMutex()
| std::mutex& CDPL::ConfGen::FragmentLibrary::getMutex |
( |
| ) |
|
Returns the mutex protecting the library state for use by external multi-threaded callers.
- Returns
- A reference to the protecting mutex.
◆ set()
| static void CDPL::ConfGen::FragmentLibrary::set |
( |
const SharedPointer & |
lib | ) |
|
|
static |
Sets the process-wide default fragment library used by ConfGen routines.
- Parameters
-
| lib | The new default fragment library. |
◆ get()
| static const SharedPointer& CDPL::ConfGen::FragmentLibrary::get |
( |
| ) |
|
|
static |
Returns the process-wide default fragment library.
- Returns
- The current default fragment library.
The documentation for this class was generated from the following file: