system_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 
00021 #ifndef BTK_CONCEPTS_SYSTEM_CONCEPT_HPP
00022 #define BTK_CONCEPTS_SYSTEM_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/atom_iterable_concept.hpp>
00029 #include <btk/core/concepts/chain_iterable_concept.hpp>
00030 #include <btk/core/concepts/chain_concept.hpp>
00031 
00032 namespace BTK {
00033 namespace CONCEPTS {
00034 
00035 template <typename T>
00036 struct SystemConcept
00037 {
00038   typedef typename T::size_type size_type;
00039   typedef typename T::chain_type chain_type;
00040   typedef typename T::chain_iterator chain_iterator;
00041   typedef typename T::const_chain_iterator const_chain_iterator;
00042   typedef typename T::reverse_chain_iterator reverse_chain_iterator;
00043   typedef typename T::const_reverse_chain_iterator const_reverse_chain_iterator;
00044 
00045   void constraints() {
00046     boost::function_requires<boost::Mutable_ReversibleContainerConcept<T> >();
00047     boost::function_requires<StrictlyChemicallyTypedConcept<T> >();
00048     boost::function_requires<AtomIterableConcept<T> >();
00049     boost::function_requires<ChainIterableConcept<T> >();
00050     boost::function_requires<ChainConcept<chain_type> >();
00051 
00052     const_constraints(obj);
00053   }
00054 
00055   void const_constraints(T const & system) {
00056     std::cout << system.print(std::cout);
00057     std::cout << system.print(std::cout,atom_num);
00058   }
00059   
00060   T obj;
00061   size_type size, atom_num;
00062 };
00063 
00064 template <typename T>
00065 struct MutableSystemConcept
00066 {
00067   void constraints() {
00068     boost::function_requires<boost::SequenceConcept<T> >();
00069     boost::function_requires<SystemConcept<T> >();
00070     boost::function_requires<ChemicallyTypedConcept<T> >();
00071   }
00072 };
00073 
00074 } // CONCEPTS
00075 } // BTK
00076 
00077 #endif

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