/* * PdbAtomInfoContainer.hpp * * Created on: Dec 4, 2010 * Author: heber */ #ifndef PDBATOMINFOCONTAINER_HPP_ #define PDBATOMINFOCONTAINER_HPP_ #include "PdbKey.hpp" #include /** * Holds tremolo-specific information which is not store in the atom class. */ class PdbAtomInfoContainer { public: PdbAtomInfoContainer(); ~PdbAtomInfoContainer(); // getter and setter std::string get(const PdbKey::PdbDataKey key) const; void set(const PdbKey::PdbDataKey key, std::string value); /** Scans a value from a short string and checks whether its empty. * * @param value value to set * @param _piece short string */ template static void ScanKey(T& value, std::string _piece) { ConvertTo toValue; // scan all empty chars ' ' and skip std::string::iterator iter = _piece.begin(); for (;iter != _piece.end();++iter) if ((*iter != ' ') && (*iter != '\t')) break; // only set if there is something contained in the string if (iter != _piece.end()) { _piece.erase(_piece.begin(), iter); value = toValue(_piece); } } private: int serial; std::string name; char altloc; std::string resName; char chainID; int resSeq; char iCode; float occupancy; float tempFactor; int charge; }; #endif /* PDBATOMINFOCONTAINER_HPP_ */