SWE
/import/home/rettenbs/src/SWE/src/writer/Writer.hh
Go to the documentation of this file.
00001 
00026 #ifndef WRITER_HH_
00027 #define WRITER_HH_
00028 
00029 #include "tools/help.hh"
00030 
00031 namespace io {
00032         struct BoundarySize;
00033         class Writer;
00034 }
00035 
00040 struct io::BoundarySize
00041 {
00048         int boundarySize[4];
00049 
00050         int& operator[](unsigned int i)
00051         {
00052                 return boundarySize[i];
00053         }
00054 
00055         int operator[](unsigned int i) const
00056         {
00057                 return boundarySize[i];
00058         }
00059 };
00060 
00061 class io::Writer
00062 {
00063 protected:
00065         const std::string fileName;
00066 
00068     const Float2D &b;
00069 
00071         const BoundarySize boundarySize;
00072 
00074     const unsigned int nX, nY;
00075 
00077     size_t timeStep;
00078 
00079 public:
00083         Writer(const std::string &i_fileName,
00084                 const Float2D &i_b,
00085                 const BoundarySize &i_boundarySize,
00086                 int i_nX, int i_nY)
00087                 : fileName(i_fileName),
00088                   b(i_b),
00089                   boundarySize(i_boundarySize),
00090                   nX(i_nX), nY(i_nY),
00091                   timeStep(0)
00092         {
00093         }
00094 
00095         virtual ~Writer() {}
00096 
00105         virtual void writeTimeStep(
00106                         const Float2D &i_h,
00107             const Float2D &i_hu,
00108             const Float2D &i_hv,
00109             float i_time) = 0;
00110 };
00111 
00112 #endif // WRITER_HH_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends