00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023
00024 #ifndef BTK_MOLECULES_MOLECULE_HPP
00025 #define BTK_MOLECULES_MOLECULE_HPP
00026
00027 #include <btk/core/molecules/chain.hpp>
00028
00029 namespace BTK {
00030 namespace MOLECULES {
00031
00044 template <typename AtomType,
00045 typename ChemicalTypeSystemType =
00046 typename AtomType::chemical_type_system,
00047 typename DictionaryType =
00048 typename ChemicalTypeSystemType::structure_dictionary,
00049 typename StorageStrategy = std::vector<AtomType> >
00050 class Molecule :
00051 public Chain<AtomType,
00052 ChemicalTypeSystemType,
00053 DictionaryType,
00054 StorageStrategy>,
00055 public boost::less_than_comparable<Chain<AtomType,
00056 ChemicalTypeSystemType,
00057 DictionaryType,
00058 StorageStrategy> >
00059 {
00060 typedef Chain<AtomType,
00061 ChemicalTypeSystemType,
00062 DictionaryType,
00063 StorageStrategy> base_type;
00064 typedef Molecule<AtomType,
00065 ChemicalTypeSystemType,
00066 DictionaryType,
00067 StorageStrategy> self_type;
00068
00069 public:
00070 IMPORT_ATOMIC_STRUCTURE_TYPES(base_type);
00071
00072 Molecule(size_type n = 0,
00073 const_reference t = atom_type(),
00074 id_type type = id_type(),
00075 char chain_id = ' ') :
00076 base_type(n,t,type,chain_id) {}
00077
00078 template <typename AtomIterator>
00079 Molecule(AtomIterator i, AtomIterator j,
00080 id_type type = id_type(),
00081 char chain_id = ' ') :
00082 base_type(i,j,type,chain_id) {}
00083
00084 Molecule(self_type const & source) : base_type(source) {}
00085
00086 virtual ~Molecule() {}
00087
00088
00089
00090
00091
00092 IMPORT_BTK_SEQUENCE_METHODS(base_type);
00093
00094 using base_type::set_type;
00095 using base_type::set_chemical_type_system;
00096
00097 virtual dictionary const & get_dictionary() const
00098 {
00099 return base_type::get_chemical_type_system().get_structure_dictionary();
00100 }
00101
00102 virtual dictionary & get_dictionary()
00103 {
00104 return base_type::get_chemical_type_system().get_structure_dictionary();
00105 }
00106
00107 void swap(self_type & b)
00108 {
00109 base_type::swap(b);
00110 }
00111
00112 self_type const & operator=(self_type const & rhs)
00113 {
00114 if (this == &rhs) return *this;
00115 base_type::operator=(rhs);
00116 return *this;
00117 }
00118
00119 bool operator==(self_type const & rhs) const
00120 {
00121 return base_type::operator==(rhs);
00122 }
00123
00124 bool operator!=(self_type const & rhs) const
00125 {
00126 return base_type::operator!=(rhs);
00127 }
00128
00129 bool operator<(self_type const & rhs) const
00130 {
00131 return base_type::operator<(rhs);
00132 }
00133 };
00134
00135 }
00136 }
00137
00138 #endif