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