genericMolFile.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: genericMolFile.h,v 1.25 2005/12/23 17:01:46 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_FORMAT_GENERICMOLFILE_H
00008 #define BALL_FORMAT_GENERICMOLFILE_H
00009 
00010 #ifndef BALL_FORMAT_LINEBASEDFILE_H
00011 # include <BALL/FORMAT/lineBasedFile.h>
00012 #endif
00013 
00014 namespace BALL 
00015 {
00016   class Atom;
00017   class System;
00018   class Molecule;
00019 
00058   class BALL_EXPORT GenericMolFile
00059     : public LineBasedFile
00060   {
00061     public:
00062 
00066 
00069     GenericMolFile()
00070       ;
00071 
00074     GenericMolFile(const String& filename, File::OpenMode open_mode = std::ios::in)
00075       throw(Exception::FileNotFound);
00076 
00079     GenericMolFile(const GenericMolFile& file)
00080       throw(Exception::FileNotFound);
00081 
00084     virtual ~GenericMolFile()
00085       ;
00086     
00088 
00091   
00095     const GenericMolFile& operator = (const GenericMolFile& rhs)
00096       throw(Exception::FileNotFound);
00097 
00099 
00102 
00111     virtual bool write(const System& system)
00112       throw(File::CannotWrite);
00113     
00119     virtual bool write(const Molecule& molecule)
00120       throw(File::CannotWrite);
00121     
00131     virtual bool read(System& system)
00132       throw(Exception::ParseError);
00133 
00144     virtual Molecule* read()
00145       throw(Exception::ParseError);
00146 
00148 
00151   
00155     virtual GenericMolFile& operator >> (System& system)
00156       throw(Exception::ParseError);
00157     
00161     virtual GenericMolFile& operator << (const System& system)
00162       throw(File::CannotWrite);
00163 
00167     virtual GenericMolFile& operator >> (Molecule& molecule)
00168       throw(Exception::ParseError);
00169     
00173     virtual GenericMolFile& operator << (const Molecule& molecule)
00174       throw(File::CannotWrite);
00176     
00177     protected:
00185     virtual void initRead_();
00186       
00191     virtual void initWrite_();
00192     
00193   };
00194 } // namespace BALL
00195 
00196 #endif // BALL_FORMAT_GENERICMOLFILE_H