00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023
00024 #ifndef BTK_CONCEPTS_ATOMIC_STRUCTURE_CONCEPT_HPP
00025 #define BTK_CONCEPTS_ATOMIC_STRUCTURE_CONCEPT_HPP
00026
00108
00109 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00110
00111 #include <iostream>
00112 #include <boost/concept_check.hpp>
00113
00114 #include <btk/core/concepts/atom_concept.hpp>
00115 #include <btk/core/concepts/atom_iterable_concept.hpp>
00116 #include <btk/core/concepts/chemically_typed_concept.hpp>
00117
00118 namespace BTK {
00119 namespace CONCEPTS {
00120
00121 template <class T>
00122 struct AtomicStructureConcept
00123 {
00124 typedef typename T::atom_type at;
00125 typedef typename T::size_type st;
00126
00127 void constraints() {
00128 boost::function_requires<boost::Mutable_ReversibleContainerConcept<T> >();
00129 boost::function_requires<StrictlyChemicallyTypedConcept<T> >();
00130 boost::function_requires<AtomIterableConcept<T> >();
00131 boost::function_requires<AtomConcept<at> >();
00132
00133 const_constraints(obj);
00134 }
00135
00136 void const_constraints(T const & c_obj) {
00137
00138 at const & atom_ref = c_obj[atom_num];
00139 boost::ignore_unused_variable_warning(atom_ref);
00140
00141 std::cout << c_obj.print(std::cout);
00142 std::cout << c_obj.print(std::cout,atom_num);
00143 }
00144
00145 T obj;
00146 st atom_num;
00147 };
00148
00149 #endif // DOXYGEN_SHOULD_SKIP_THIS
00150
00205
00206 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00207
00208 template <typename T>
00209 struct MutableAtomicStructureConcept
00210 {
00211 typedef typename T::atom_type at;
00212 typedef typename T::size_type st;
00213
00214 void constraints() {
00215 boost::function_requires<boost::SequenceConcept<T> >();
00216 boost::function_requires<ChemicallyTypedConcept<T> >();
00217 boost::function_requires<AtomicStructureConcept<T> >();
00218
00219 at & atom_ref = obj[atom_num];
00220 boost::ignore_unused_variable_warning(atom_ref);
00221 }
00222
00223 T obj;
00224 st atom_num;
00225 };
00226
00227 }
00228 }
00229
00230 #endif //DOXYGEN_SHOULD_SKIP_THIS
00231
00232 #endif