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_CLASS_HI 00020 #define OST_BASE_CHEM_CLASS_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 ChemClass { 00031 const static char PeptideLinking ='P'; 00032 const static char DPeptideLinking ='D'; 00033 const static char LPeptideLinking ='L'; 00034 const static char RNALinking ='R'; 00035 const static char DNALinking ='S'; 00036 const static char NonPolymer ='N'; 00037 const static char LSaccharide ='X'; 00038 const static char DSaccharide ='Y'; 00039 const static char Saccharide ='Z'; 00040 const static char Unknown ='U'; 00041 explicit ChemClass(char chem_class) 00042 : chem_class_(chem_class) { 00043 } 00044 00045 ChemClass() 00046 : chem_class_(Unknown) { 00047 } 00048 bool operator==(const ChemClass& cc) const { 00049 return cc.chem_class_==chem_class_; 00050 } 00051 00052 bool operator!=(const ChemClass& cc) const { 00053 return this->operator!=(cc); 00054 } 00055 00056 bool IsPeptideLinking() const { 00057 return (chem_class_==ChemClass::PeptideLinking || 00058 chem_class_==ChemClass::DPeptideLinking || 00059 chem_class_==ChemClass::LPeptideLinking); 00060 } 00061 bool IsNucleotideLinking() const { 00062 return (chem_class_==ChemClass::DNALinking || 00063 chem_class_==ChemClass::RNALinking); 00064 } 00065 operator char() const { 00066 return chem_class_; 00067 } 00068 private: 00069 char chem_class_; 00070 }; 00071 00072 }} // ns 00073 #endif
1.5.8