29 #ifndef CDPL_CONFGEN_FRAGMENTLIBRARY_HPP
30 #define CDPL_CONFGEN_FRAGMENTLIBRARY_HPP
34 #include <unordered_map>
62 typedef std::unordered_map<std::uint64_t, FragmentLibraryEntry::SharedPointer> HashToEntryMap;
73 typedef HashToEntryMap::value_type
Entry;
219 void save(std::ostream& os)
const;
246 mutable HashToEntryMap hashToEntryMap;
247 mutable std::mutex mutex;
Definition of the preprocessor macro CDPL_CONFGEN_API.
#define CDPL_CONFGEN_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::ConfGen::FragmentLibraryEntry.
std::shared_ptr< FragmentLibraryEntry > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibraryEntry instances.
Definition: FragmentLibraryEntry.hpp:62
Data structure representing a library of pre-generated molecular fragment conformer ensembles.
Definition: FragmentLibrary.hpp:60
std::shared_ptr< FragmentLibrary > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibrary instances.
Definition: FragmentLibrary.hpp:68
EntryIterator end()
Returns a mutable iterator pointing one past the last entry of the library (range-based for support).
ConstEntryIterator end() const
Returns a constant iterator pointing one past the last entry of the library (range-based for support)...
std::size_t getNumEntries() const
Returns the number of entries stored in the library.
void clear()
Removes all entries from the library.
HashToEntryMap::value_type Entry
The type of a stored hash-code-to-entry pair.
Definition: FragmentLibrary.hpp:73
HashToEntryMap::iterator EntryIterator
A mutable iterator over the stored entries.
Definition: FragmentLibrary.hpp:83
std::mutex & getMutex()
Returns the mutex protecting the library state for use by external multi-threaded callers.
bool containsEntry(std::uint64_t hash_code) const
Tells whether the library contains an entry with the specified hash code.
bool removeEntry(std::uint64_t hash_code)
Removes the entry with the specified hash code.
~FragmentLibrary()
Destructor.
static void set(const SharedPointer &lib)
Sets the process-wide default fragment library used by ConfGen routines.
const FragmentLibraryEntry::SharedPointer & getEntry(std::uint64_t hash_code) const
Returns the entry with the specified hash code.
EntryIterator removeEntry(const EntryIterator &it)
Removes the entry referenced by the given iterator.
static const SharedPointer & get()
Returns the process-wide default fragment library.
EntryIterator begin()
Returns a mutable iterator pointing to the first entry of the library (range-based for support).
void save(std::ostream &os) const
Writes the contents of the library to the output stream os.
FragmentLibrary & operator=(const FragmentLibrary &lib)
Replaces the contents of this library with a copy of the contents of lib.
FragmentLibrary(const FragmentLibrary &lib)
Constructs a copy of the FragmentLibrary instance lib.
void loadDefaults()
Loads the default fragment library bundled with CDPKit.
void addEntries(const FragmentLibrary &lib)
Adds all entries from lib to this library.
bool addEntry(const FragmentLibraryEntry::SharedPointer &entry)
Adds the given entry to the library.
ConstEntryIterator getEntriesBegin() const
Returns a constant iterator pointing to the first entry of the library.
EntryIterator getEntriesBegin()
Returns a mutable iterator pointing to the first entry of the library.
ConstEntryIterator getEntriesEnd() const
Returns a constant iterator pointing one past the last entry of the library.
void load(std::istream &is)
Loads the contents of the library from the input stream is.
HashToEntryMap::const_iterator ConstEntryIterator
A constant iterator over the stored entries.
Definition: FragmentLibrary.hpp:78
FragmentLibrary()
Constructs an empty FragmentLibrary instance.
EntryIterator getEntriesEnd()
Returns a mutable iterator pointing one past the last entry of the library.
ConstEntryIterator begin() const
Returns a constant iterator pointing to the first entry of the library (range-based for support).
The namespace of the Chemical Data Processing Library.