Main Page | Namespace List | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Examples

Model.h

00001 /* Copyright 2004
00002 Stanford University
00003 
00004 This file is part of the DSR PDB Library.
00005 
00006 The DSR PDB Library is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU Lesser General Public License as published by
00008 the Free Software Foundation; either version 2.1 of the License, or (at your
00009 option) any later version.
00010 
00011 The DSR PDB Library is distributed in the hope that it will be useful, but
00012 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00013 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00014 License for more details.
00015 
00016 You should have received a copy of the GNU Lesser General Public License
00017 along with the DSR PDB Library; see the file COPYING.LIB.  If not, write to
00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00019 MA 02111-1307, USA. */
00020 
00021 #ifndef DSR_MODEL_H_
00022 #define DSR_MODEL_H_
00023 #include <dsrpdb/Protein.h>
00024 #include <vector>
00025 #include <string>
00026 
00027 namespace dsrpdb {
00028 
00029   class PDB;
00030 
00032 
00035   class Model {
00036     friend class PDB;
00037   public:
00039     Model();
00041     Model(unsigned int i);
00042     
00044     size_t number_of_chains() const;
00046     Protein &chain(unsigned int i);
00048     const Protein &chain(unsigned int i) const;    
00049 
00051     void new_chain(const Protein &p);
00052 
00054     void write(std::ostream &out) const;
00055 
00057     int index() const{return index_;}
00058 
00060     void set_index(int ind) {index_=ind;}
00061   protected:
00062     void process_line(const char *c);
00063 
00064     std::vector<std::string> extra_;
00065     std::vector<Protein> chains_;
00066     int index_;
00067   };
00068 }
00069 #endif