00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2010 by the OpenStructure authors 00005 // 00006 // This library is free software; you can redistribute it and/or modify it under 00007 // the terms of the GNU Lesser General Public License as published by the Free 00008 // Software Foundation; either version 3.0 of the License, or (at your option) 00009 // any later version. 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, Inc., 00017 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 //------------------------------------------------------------------------------ 00019 #ifndef OST_BASE_CHEM_TYPE_HI 00020 #define OST_BASE_CHEM_TYPE_HI 00021 #include <vector> 00022 00023 #include <boost/shared_ptr.hpp> 00024 00025 #include <ost/mol/module_config.hh> 00026 00027 00028 namespace ost { namespace mol { 00029 00030 struct ChemType { 00031 const static char IONS ='I'; 00032 const static char NONCANONICALMOLS ='M'; 00033 const static char SACCHARIDES ='S'; 00034 const static char NUCLEOTIDES ='N'; 00035 const static char AMINOACIDS ='A'; 00036 const static char COENZYMES ='E'; 00037 const static char WATERCOORDIONS ='C'; 00038 const static char DRUGS ='D'; 00039 const static char WATERS ='W'; 00040 const static char UNKNOWN ='U'; 00041 00042 explicit ChemType(char chem_type) 00043 : chem_type_(chem_type) { 00044 } 00045 00046 ChemType() 00047 : chem_type_(UNKNOWN) { 00048 } 00049 00050 bool operator==(const ChemType& cc) const { 00051 return cc.chem_type_==chem_type_; 00052 } 00053 00054 bool operator!=(const ChemType& cc) const { 00055 return cc.chem_type_!=chem_type_; 00056 } 00057 00058 bool IsIon() const { 00059 return (chem_type_==ChemType::IONS || 00060 chem_type_==ChemType::WATERCOORDIONS); 00061 } 00062 00063 bool IsNucleotide() const { 00064 return (chem_type_==ChemType::NUCLEOTIDES); 00065 } 00066 00067 bool IsSaccharide() const { 00068 return (chem_type_==ChemType::SACCHARIDES); 00069 } 00070 00071 bool IsAminoAcid() const { 00072 return (chem_type_==ChemType::AMINOACIDS); 00073 } 00074 00075 bool IsCoenzyme() const { 00076 return (chem_type_==ChemType::COENZYMES); 00077 } 00078 00079 bool IsDrug() const { 00080 return (chem_type_==ChemType::DRUGS); 00081 } 00082 00083 bool IsWater() const { 00084 return (chem_type_==ChemType::WATERS); 00085 } 00086 00087 bool IsNonCanonical() const { 00088 return (chem_type_==ChemType::NONCANONICALMOLS); 00089 } 00090 00091 bool IsKnown() const { 00092 return (chem_type_!=ChemType::UNKNOWN); 00093 } 00094 00095 operator char() const { 00096 return chem_type_; 00097 } 00098 00099 private: 00100 char chem_type_; 00101 }; 00102 00103 }} // ns 00104 #endif