00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef BTK_CONCEPTS_POLYMER_STRUCTURE_CONCEPT_HPP
00022 #define BTK_CONCEPTS_POLYMER_STRUCTURE_CONCEPT_HPP
00023
00024 #include <iostream>
00025 #include <boost/concept_check.hpp>
00026
00027 #include <btk/core/concepts/chemically_typed_concept.hpp>
00028 #include <btk/core/concepts/monomer_concept.hpp>
00029 #include <btk/core/concepts/monomer_iterable_concept.hpp>
00030
00031 namespace BTK {
00032 namespace CONCEPTS {
00033
00034 template <typename T>
00035 struct PolymerStructureConcept {
00036 typedef typename T::monomer_type mt;
00037 typedef typename T::monomer_iterator mi;
00038 typedef typename T::reverse_monomer_iterator rmi;
00039 typedef typename T::const_monomer_iterator cmi;
00040 typedef typename T::const_reverse_monomer_iterator crmi;
00041 typedef typename T::size_type st;
00042
00043 void constraints() {
00044 boost::function_requires<boost::Mutable_ReversibleContainerConcept<T> >();
00045 boost::function_requires<StrictlyChemicallyTypedConcept<T> >();
00046 boost::function_requires<MonomerIterableConcept<T> >();
00047 boost::function_requires<MonomerConcept<mt> >();
00048
00049 const_constraints(obj);
00050 }
00051
00052 void const_constraints(T const & polymer) {
00053 mt const & monomer_ref = polymer[monomer_num];
00054 boost::ignore_unused_variable_warning(monomer_ref);
00055
00056 std::cout << polymer.print(std::cout);
00057 std::cout << polymer.print(std::cout,atom_num,monomer_num);
00058 }
00059
00060 T obj;
00061 st atom_num, monomer_num;
00062 };
00063
00064 template <typename T>
00065 struct MutablePolymerStructureConcept
00066 {
00067 typedef typename T::monomer_type mt;
00068 typedef typename T::size_type st;
00069
00070 void constraints() {
00071 boost::function_requires<boost::SequenceConcept<T> >();
00072 boost::function_requires<ChemicallyTypedConcept<T> >();
00073 boost::function_requires<PolymerStructureConcept<T> >();
00074 boost::function_requires<MutableMonomerIterableConcept<T> >();
00075
00076 mt & monomer_ref = polymer[monomer_num];
00077 boost::ignore_unused_variable_warning(monomer_ref);
00078 }
00079
00080 T polymer;
00081 st monomer_num;
00082 };
00083
00084 }
00085 }
00086
00087 #endif