00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00025
00026
00027 #ifndef BTK_MONOMER_H
00028 #define BTK_MONOMER_H
00029
00030 #include "atom_container.h"
00031 #include "atom.h"
00032
00033 #include <boost/concept_check.hpp>
00034
00035 #include <string>
00036
00037 namespace BTK {
00038
00039
00040 template <typename AtomType> class Monomer;
00041 typedef Monomer<Atom> basic_monomer;
00042
00045 template <typename AtomType>
00046 class Monomer : public AtomContainer<AtomType>{
00047 typedef AtomContainer<AtomType> base_type;
00048 typedef Monomer<AtomType> self_type;
00049 public:
00050
00052
00053 typedef typename base_type::value_type value_type;
00054 typedef typename base_type::reference reference;
00055 typedef typename base_type::const_reference const_reference;
00056 typedef typename base_type::pointer pointer;
00057 typedef typename base_type::const_pointer const_pointer;
00058 typedef typename base_type::size_type size_type;
00059 typedef typename base_type::iterator iterator;
00060 typedef typename base_type::const_iterator const_iterator;
00062
00064
00065 typedef value_type atom_type;
00066 typedef iterator atom_iterator;
00067 typedef const_iterator const_atom_iterator;
00069
00070
00074 Monomer(size_type s = 0)
00075 : base_type(s),
00076 _group_num(0) {}
00077
00080 template <typename AtomIterator>
00081 Monomer(AtomIterator first,
00082 AtomIterator last,
00083 self_type* prev_monomer = 0,
00084 self_type* next_monomer = 0,
00085 const AtomGroupConcept::group_variant_container_t& modifiers = group_variant_container_t())
00086 : base_type(first,last),
00087 _group_num(first->group_num()),
00088 _group_name3(first->group_name3())
00089 {
00090
00091 prev_monomer += 1;
00092 next_monomer += 1;
00093 modifiers.size();
00094 }
00095
00096 template <typename T2>
00097 Monomer(const Monomer<T2>& source)
00098 : base_type(source),
00099 _group_num(source.group_num()),
00100 _group_name3(source.group_name3()) {}
00101
00102 ~Monomer() {}
00103
00104
00106 template <typename T2>
00107 self_type&
00108 operator=(const Monomer<T2>& rhs)
00109 {
00110 base_type::operator=(rhs);
00111 _group_num = rhs.group_num();
00112 _group_name3 = rhs.group_name3();
00113 return *this;
00114 }
00115
00117
00118 virtual GROUP::index_t group_index() const { return GROUP::MONOMER; }
00119
00120 virtual int group_num() const { return _group_num; }
00121 void set_group_num(int x) { _group_num = x; }
00122
00123 virtual const std::string& group_name3() const { return _group_name3; }
00124
00125
00127 virtual char group_name1() const { return 'X'; }
00128
00129 private:
00130 int _group_num;
00131 std::string _group_name3;
00132 };
00133
00134 }
00135
00136 #endif