gcu/residue.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GCU_RESIDUE_H
00026 #define GCU_RESIDUE_H
00027
00028 #include "macros.h"
00029 #include <libxml/parser.h>
00030 #include <map>
00031 #include <set>
00032 #include <string>
00033
00035 namespace gcu {
00036
00037 class Application;
00038 class Residue;
00039 class Molecule;
00040 class Document;
00041
00045 typedef struct {
00051 Residue *res;
00055 bool ambiguous;
00056 } SymbolResidue;
00057
00058 typedef std::map<std::string, SymbolResidue>::iterator ResidueIterator;
00059
00067 class Residue
00068 {
00069 public:
00073 Residue ();
00080 Residue (char const *name, Document *doc = NULL);
00084 virtual ~Residue ();
00085
00099 std::map<int,int> const &GetRawFormula () const {return m_Raw;}
00106 std::map<std::string, bool> const &GetSymbols () const {return m_Symbols;}
00111 std::map<std::string, std::string> const &GetNames () const {return m_Names;}
00115 void SetName (char const *name);
00121 void AddSymbol (char const *symbol);
00127 void RemoveSymbol (char const *symbol);
00133 virtual void Load (xmlNodePtr node, Application *app);
00141 static Residue const *GetResidue (char const *symbol, bool *ambiguous = NULL);
00147 static Residue const *GetResiduebyName (char const *name);
00156 static std::string const *GetFirstResidueSymbol (ResidueIterator &i);
00166 static std::string const *GetNextResidueSymbol (ResidueIterator &i);
00171 virtual bool operator== (G_GNUC_UNUSED Molecule const &mol) const {return false;}
00172
00173 public:
00178 static unsigned MaxSymbolLength;
00179
00180 private:
00181 std::map<int,int> m_Raw;
00182 std::map<std::string, bool> m_Symbols;
00183 std::map<std::string, std::string> m_Names;
00184
00188 GCU_RO_PROP (char const *, Name)
00203 GCU_PROP (bool, Generic)
00208 GCU_PROT_POINTER_PROP (Document, Document);
00213 GCU_PROT_POINTER_PROP (Molecule, Molecule);
00218 GCU_RO_PROP (Document *, Owner)
00219 };
00220
00221 }
00222
00223 #endif // GCU_RESIDUE_H