29 #ifndef CDPL_BIOMOL_RESIDUEDICTIONARY_HPP
30 #define CDPL_BIOMOL_RESIDUEDICTIONARY_HPP
33 #include <unordered_map>
37 #include <boost/iterator/transform_iterator.hpp>
75 Entry(
const std::string& code,
const std::string& rep_code,
const std::string& rep_by_code,
const std::string& parent_code,
76 const std::string& one_letter_code,
bool obsolete,
const std::string& name,
unsigned int type,
107 std::string replacesCode;
108 std::string replacedByCode;
109 std::string parentCode;
110 std::string oneLetterCode;
118 struct CIStringHashFunc
121 std::size_t operator()(
const std::string& str)
const;
124 struct CIStringCmpFunc
127 bool operator()(
const std::string& str1,
const std::string& str2)
const;
130 typedef std::unordered_map<std::string, Entry, CIStringHashFunc, CIStringCmpFunc> EntryLookupTable;
135 typedef boost::transform_iterator<std::function<
const Entry&(
const EntryLookupTable::value_type&)>,
181 const std::string&
getName(
const std::string& code)
const;
183 unsigned int getType(
const std::string& code)
const;
195 EntryLookupTable entries;
Definition of the preprocessor macro CDPL_BIOMOL_API.
#define CDPL_BIOMOL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Chem::MolecularGraph.
Definition: ResidueDictionary.hpp:58
const std::string & getOneLetterCode() const
const std::string & getName() const
unsigned int getType() const
const std::string & getReplacedByCode() const
const std::string & getReplacedCode() const
Chem::MolecularGraph::SharedPointer getStructure() const
Entry(const std::string &code, const std::string &rep_code, const std::string &rep_by_code, const std::string &parent_code, const std::string &one_letter_code, bool obsolete, const std::string &name, unsigned int type, const StructureRetrievalFunction &struc_ret_func)
Constructs and initializes a Entry instance with the given data.
const std::string & getParentCode() const
const std::string & getCode() const
std::function< Chem::MolecularGraph::SharedPointer(const std::string &)> StructureRetrievalFunction
Definition: ResidueDictionary.hpp:61
A global dictionary for the lookup of meta-data associated with the residues in biological macromolec...
Definition: ResidueDictionary.hpp:54
static void set(const SharedPointer &dict)
const std::string & getReplacedCode(const std::string &code) const
const std::string & getReplacedByCode(const std::string &code) const
std::shared_ptr< ResidueDictionary > SharedPointer
Definition: ResidueDictionary.hpp:133
ConstEntryIterator getEntriesBegin() const
boost::transform_iterator< std::function< const Entry &(const EntryLookupTable::value_type &)>, EntryLookupTable::const_iterator > ConstEntryIterator
Definition: ResidueDictionary.hpp:136
const std::string & getOneLetterCode(const std::string &code) const
Chem::MolecularGraph::SharedPointer getStructure(const std::string &code) const
void addEntry(const Entry &entry)
const std::string & getParentCode(const std::string &code) const
unsigned int getType(const std::string &code) const
const Entry & getEntry(const std::string &code) const
static bool isStdResidue(const std::string &code)
bool containsEntry(const std::string &code) const
const std::string & getName(const std::string &code) const
void removeEntry(const std::string &code)
void addEntry(Entry &&entry)
ConstEntryIterator begin() const
static const SharedPointer & get()
ConstEntryIterator getEntriesEnd() const
bool isObsolete(const std::string &code) const
ConstEntryIterator end() const
std::size_t getNumEntries() const
std::shared_ptr< MolecularGraph > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances.
Definition: MolecularGraph.hpp:58
The namespace of the Chemical Data Processing Library.