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

GenericFile.h

Go to the documentation of this file.
00001 // Copyright (C) 2002 Johan Hoffman and Anders Logg.
00002 // Licensed under the GNU GPL Version 2.
00003 
00004 #ifndef __GENERIC_FILE_H
00005 #define __GENERIC_FILE_H
00006 
00007 #include <string>
00008 #include <dolfin/Function.h>
00009 
00010 namespace dolfin {
00011   
00012   class Vector;
00013   class Matrix;
00014   class Mesh;
00015   class Function;
00016   class Function::Vector;
00017   class ParameterList;
00018   class Sample;
00019   
00020   class GenericFile {
00021   public:
00022     
00023     GenericFile(const std::string filename);
00024     virtual ~GenericFile();
00025     
00026     // Input
00027     
00028     virtual void operator>> (Vector& x);
00029     virtual void operator>> (Matrix& A);
00030     virtual void operator>> (Mesh& mesh);
00031     virtual void operator>> (Function& u);
00032     virtual void operator>> (Function::Vector& u);
00033     virtual void operator>> (Sample& sample);
00034     virtual void operator>> (ParameterList& parameters);
00035     
00036     // Output
00037     
00038     virtual void operator<< (Vector& x);
00039     virtual void operator<< (Matrix& A);
00040     virtual void operator<< (Mesh& mesh);
00041     virtual void operator<< (Function& u);
00042     virtual void operator<< (Function::Vector& u);
00043     virtual void operator<< (Sample& sample);
00044     virtual void operator<< (ParameterList& parameters);
00045     
00046     void read();
00047     void write();
00048     
00049   protected:
00050     
00051     void read_not_impl(const std::string object);
00052     void write_not_impl(const std::string object);
00053 
00054     std::string filename;
00055     std::string type;
00056     
00057     bool opened_read;
00058     bool opened_write;
00059 
00060     bool check_header; // True if we have written a header
00061 
00062     int no_meshes;
00063     int no_frames;
00064     
00065   };
00066   
00067 }
00068 
00069 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.