Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

molecule.hpp

Go to the documentation of this file.
00001 // -*- mode: c++; -*-
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) 2001, Eric Alm <ealm3141@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 #include <ostream>
00022 
00023 template <typename AtomType>
00024 typename BTK::Molecule<AtomType>::self_type&
00025 BTK::Molecule<AtomType>::
00026 operator=(const self_type& rhs){
00027   if (&rhs == this) return *this;
00028   base_type::operator=(rhs);
00029   _chain_id = rhs._chain_id;
00030   _name = rhs._name;
00031   return *this;
00032 }
00033 
00034 template <typename AtomType>
00035 template <typename T2>
00036 typename BTK::Molecule<AtomType>::self_type&
00037 BTK::Molecule<AtomType>::
00038 operator=(const Molecule<T2>& rhs){
00039   base_type::operator=(rhs);
00040   _chain_id = rhs.chain_id();
00041   _name = rhs.name();
00042   return *this;
00043 }
00044 
00045 template <typename AtomType>
00046 std::ostream& operator<<(std::ostream& os,
00047                          const BTK::Molecule<AtomType>& m){
00048   unsigned atom = 1;
00049   typedef typename BTK::Molecule<AtomType>::const_atom_iterator citer;
00050   citer i=m.atom_begin(),i_end=m.atom_end();
00051   for (;i!=i_end;++i) {
00052     i->print_pdb_line(atom++,m.chain_id(),os);
00053   }  
00054   os << "TER\n";
00055   
00056   return os;
00057 }
00058 

Generated on Wed Apr 14 00:43:17 2004 for BTK by doxygen 1.3.6