GAMESSDatFile.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: GAMESSDatFile.h,v 1.2 2005/10/05 09:59:45 anhi Exp $
00005 //
00006 
00007 #ifndef BALL_FORMAT_GAMESSDATFILE_H
00008 #define BALL_FORMAT_GAMESSDATFILE_H
00009 
00010 #ifndef BALL_FORMAT_GENERICMOLFILE_H
00011 # include <BALL/FORMAT/genericMolFile.h>
00012 #endif
00013 
00014 #ifndef BALL_DATATYPE_STRINGHASHMAP_H
00015 # include <BALL/DATATYPE/stringHashMap.h>
00016 #endif
00017 namespace BALL
00018 {
00025   class BALL_EXPORT GAMESSDatFile
00026     : public GenericMolFile
00027   {
00028     public:
00029 
00030       BALL_CREATE(GAMESSDatFile)
00031 
00032       
00033       class block
00034       {
00035         public:
00037           String blockname;
00039           StringHashMap<String> data;
00040 
00041           void operator >> (std::ostream& os) const
00042             ;
00043           
00044       };
00045       
00047       struct State
00048       {
00049         GAMESSDatFile* current_parser;
00050       };
00051 
00055       
00058       GAMESSDatFile()
00059         ;
00060 
00063       GAMESSDatFile(const GAMESSDatFile& file)
00064         throw(Exception::FileNotFound);
00065 
00068       GAMESSDatFile(const String& filename, File::OpenMode open_mode = std::ios::in)
00069         throw(Exception::FileNotFound);
00070 
00073       virtual ~GAMESSDatFile()
00074         ;
00075       
00077 
00080       
00083       const GAMESSDatFile& operator = (const GAMESSDatFile& rhs)
00084         throw(Exception::FileNotFound);
00085 
00087 
00091       
00096       virtual bool write(const Molecule& molecule)
00097         throw(File::CannotWrite);
00098 
00103       virtual bool write(const System& molecule)
00104         throw(File::CannotWrite);
00105 
00110       virtual Molecule* read()
00111         throw(Exception::ParseError);
00112 
00117       virtual bool read(System& system)
00118         throw(Exception::ParseError);
00119 
00121 
00125       void newMolecule()
00126         ;
00127 
00128       void setMoleculeName(char* name)
00129         ;     
00130       
00131       void insertAtom(char* element, float charge, float x, float y, float z)
00132         ;
00133 
00134       void insertBond(Index a1, Index a2)
00135         ;
00136       
00137       void inBlock(const char* blockname)
00138         ;
00139 
00140       void insertBlockedData(const char* key, const char* value)
00141         ;
00142 
00143       void insertBlockedData(const String& key, const String& value)
00144         ;
00145 
00146       String& getBlockedData(const String& block, const String& key)
00147         ;
00148 
00149       const String& getBlockedData(const String& block, const String& key) const
00150         ;
00151 
00152       void clearParameters()
00153         ;
00155       
00156       static State state;
00157 
00158     protected:
00159       virtual void initRead_();
00160 
00161       Molecule* molecule_;
00162       
00163       String current_block_;
00164       StringHashMap<block> blocks_;
00165       String  symmetry_group_;
00166   };
00167 }
00168 
00169 #endif // BALL_FORMAT_GAMESSDATFILE_H