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_ATOM_ITERABLE_CONCEPT_HPP
00025 #define BTK_CONCEPTS_ATOM_ITERABLE_CONCEPT_HPP
00026
00202
00203 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00204
00205 #include <boost/concept_check.hpp>
00206
00207 #include <btk/core/concepts/atom_iterator_concept.hpp>
00208
00209 namespace BTK {
00210 namespace CONCEPTS {
00211
00212 template <typename T>
00213 struct AtomIterableConcept
00214 {
00215 typedef typename T::size_type st;
00216 typedef typename T::const_atom_iterator const_atom_it;
00217 typedef typename T::const_reverse_atom_iterator const_rev_atom_it;
00218 typedef typename T::atom_iterator atom_it;
00219 typedef typename T::reverse_atom_iterator rev_atom_it;
00220
00221 void constraints() {
00222 boost::function_requires<AtomIterableConcept<T> >();
00223 boost::function_requires<MutableAtomIteratorConcept<atom_it> >();
00224 boost::function_requires<MutableAtomIteratorConcept<rev_atom_it> >();
00225
00226 ai = obj.structure_begin();
00227 ai = obj.structure_end();
00228 rai = obj.structure_rbegin();
00229 rai = obj.structure_rend();
00230
00231 const_constraints(obj);
00232 };
00233
00234 void const_constraints(T const & ac) {
00235 boost::function_requires<AtomIteratorConcept<const_atom_it> >();
00236 boost::function_requires<AtomIteratorConcept<const_rev_atom_it> >();
00237
00238 size = ac.num_atoms();
00239
00240 cai = ac.structure_begin();
00241 cai = ac.structure_end();
00242 crai = ac.structure_rbegin();
00243 crai = ac.structure_rend();
00244 }
00245
00246 T obj;
00247 st size;
00248 const_atom_it cai;
00249 const_rev_atom_it crai;
00250 atom_it ai;
00251 rev_atom_it rai;
00252 };
00253
00254 }
00255 }
00256 #endif // DOXYGEN_SHOULD_SKIP_THIS
00257
00258 #endif // BTK_CONCEPTS_ATOM_ITERABLE_CONCEPT_HPP