00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 00005 #ifndef BALL_FORMAT_GENERICMOLFILE_H 00006 #define BALL_FORMAT_GENERICMOLFILE_H 00007 00008 #ifndef BALL_FORMAT_LINEBASEDFILE_H 00009 # include <BALL/FORMAT/lineBasedFile.h> 00010 #endif 00011 00012 namespace BALL 00013 { 00014 class Atom; 00015 class System; 00016 class Molecule; 00017 00056 class BALL_EXPORT GenericMolFile 00057 : public LineBasedFile 00058 { 00059 public: 00060 00064 00067 GenericMolFile(); 00068 00072 GenericMolFile(const String& filename, File::OpenMode open_mode = std::ios::in); 00073 00076 virtual ~GenericMolFile(); 00077 00079 00082 00087 const GenericMolFile& operator = (const GenericMolFile& rhs); 00088 00090 00093 00103 virtual bool write(const System& system); 00104 00111 virtual bool write(const Molecule& molecule); 00112 00122 virtual bool read(System& system); 00123 00134 virtual Molecule* read(); 00135 00137 00140 00145 virtual GenericMolFile& operator >> (System& system); 00146 00151 virtual GenericMolFile& operator << (const System& system); 00152 00157 virtual GenericMolFile& operator >> (Molecule& molecule); 00158 00163 virtual GenericMolFile& operator << (const Molecule& molecule); 00165 00166 protected: 00174 virtual void initRead_(); 00175 00180 virtual void initWrite_(); 00181 00182 }; 00183 } // namespace BALL 00184 00185 #endif // BALL_FORMAT_GENERICMOLFILE_H