type_system.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_IO_TYPE_SYSTEM_HPP
00025 #define BTK_IO_TYPE_SYSTEM_HPP
00026 
00027 namespace BTK {
00028 namespace IO {
00029 
00046 template <typename ElementDictionaryType,
00047           typename AtomDictionaryType,
00048           typename MonomerDictionaryType,
00049           typename StructureDictionaryType>
00050 class TypeSystem
00051 {
00052 public:
00053   typedef ElementDictionaryType element_dictionary;
00054   typedef AtomDictionaryType atom_dictionary;
00055   typedef MonomerDictionaryType monomer_dictionary;
00056   typedef StructureDictionaryType structure_dictionary;
00057   
00058   typedef typename element_dictionary::id_type element_id_type;
00059   typedef typename atom_dictionary::id_type atom_id_type;
00060   typedef typename monomer_dictionary::id_type monomer_id_type;
00061   typedef typename structure_dictionary::id_type structure_id_type;
00062 
00063   typedef TypeSystem<element_dictionary,
00064                      atom_dictionary,
00065                      monomer_dictionary,
00066                      structure_dictionary> self_type;
00067   
00068   TypeSystem() {}
00069   TypeSystem(element_dictionary const & ed,
00070              atom_dictionary const & ad,
00071              monomer_dictionary const & md,
00072              structure_dictionary const & sd) :
00073     _ed(ed), _ad(ad), _md(md), _sd(sd) {}
00074 
00075   virtual ~TypeSystem() {}
00076 
00077   element_dictionary & get_element_dictionary() { return _ed; }
00078   atom_dictionary & get_atom_dictionary() { return _ad; }
00079   monomer_dictionary & get_monomer_dictionary() { return _md; }
00080   structure_dictionary & get_structure_dictionary() { return _sd; }
00081 
00082   element_dictionary const & get_element_dictionary() const { return _ed; }
00083   atom_dictionary const & get_atom_dictionary() const { return _ad; }
00084   monomer_dictionary const & get_monomer_dictionary() const { return _md; }
00085   structure_dictionary const & get_structure_dictionary() const { return _sd; }
00086   
00087 private:
00088   element_dictionary _ed;
00089   atom_dictionary _ad;
00090   monomer_dictionary _md;
00091   structure_dictionary _sd;
00092 };
00093 
00094 } // namespace IO
00095 } // namespace BTK
00096 
00097 #endif 

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