gcu/residue.h
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
00034 namespace gcu {
00035
00036 class Residue;
00037 class Molecule;
00038 class Document;
00039
00040 typedef struct {
00041 Residue *res;
00042 bool ambiguous;
00043 } SymbolResidue;
00044
00045 typedef std::map<std::string, SymbolResidue>::iterator ResidueIterator;
00046
00047 class Residue
00048 {
00049 public:
00050 Residue ();
00051 Residue (char const *name);
00052 virtual ~Residue ();
00053
00054 std::map<int,int> const &GetRawFormula () const {return m_Raw;}
00055 std::map<std::string, bool> const &GetSymbols () const {return m_Symbols;}
00056 std::map<std::string, std::string> const &GetNames () const {return m_Names;}
00057 void SetName (char const *name);
00058 void AddSymbol (char const *symbol);
00059 void RemoveSymbol (char const *symbol);
00060 virtual void Load (xmlNodePtr node);
00061 static Residue const *GetResidue (char const *symbol, bool *ambiguous = NULL);
00062 static Residue const *GetResiduebyName (char const *name);
00063 static std::string const *GetFirstResidueSymbol (ResidueIterator &i);
00064 static std::string const *GetNextResidueSymbol (ResidueIterator &i);
00065 virtual bool operator== (Molecule const &mol) const {return false;}
00066
00067 public:
00068 static unsigned MaxSymbolLength;
00069
00070 private:
00071 std::map<int,int> m_Raw;
00072 std::map<std::string, bool> m_Symbols;
00073 std::map<std::string, std::string> m_Names;
00074
00075 GCU_RO_PROP (char const *, Name)
00076 GCU_PROP (bool, Generic)
00077 GCU_PROT_POINTER_PROP (Molecule, Molecule);
00078 GCU_PROT_POINTER_PROP (Document, Document);
00079 };
00080
00081 }
00082
00083 #endif // GCU_RESIDUE_H