atomic_structure_concept.hpp

Go to the documentation of this file.
00001 // -*- mode: c++; indent-tabs-mode: nil; -*-
00002 //
00003 //The Biomolecule Toolkit (BTK) is a C++ library for use in the
00004 //modeling, analysis, and design of biological macromolecules.
00005 //Copyright (C) 2006, Tim Robertson <kid50@users.sourceforge.net>
00006 //
00007 //This program is free software; you can redistribute it and/or modify
00008 //it under the terms of the GNU Lesser General Public License as published
00009 //by the Free Software Foundation; either version 2.1 of the License, or (at
00010 //your option) any later version.
00011 //
00012 //This program is distributed in the hope that it will be useful,  but
00013 //WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 //Lesser General Public License for more details.
00016 //
00017 //You should have received a copy of the GNU Lesser General Public License
00018 //along with this program; if not, write to the Free Software Foundation,
00019 //Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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 } // namespace CONCEPTS
00228 } // namespace BTK
00229 
00230 #endif //DOXYGEN_SHOULD_SKIP_THIS
00231 
00232 #endif 

Generated on Sun Jul 15 20:46:24 2007 for BTK Core by  doxygen 1.5.1