aboutsummaryrefslogtreecommitdiff
path: root/src/AMRPlus/AMRgridreaderPlus.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/AMRPlus/AMRgridreaderPlus.h')
-rw-r--r--src/AMRPlus/AMRgridreaderPlus.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/AMRPlus/AMRgridreaderPlus.h b/src/AMRPlus/AMRgridreaderPlus.h
new file mode 100644
index 0000000..fc6f797
--- /dev/null
+++ b/src/AMRPlus/AMRgridreaderPlus.h
@@ -0,0 +1,41 @@
+#ifndef __AMRGRIDREADERPLUS_HH_
+#define __AMRGRIDREADERPLUS_HH_
+
+#include <IO.hh>
+#include "AMRgridPlus.h"
+#include "IEEEIO.hh"
+
+
+class AMRgridreaderPlus {
+protected:
+ IObase &file;
+
+public:
+ AMRgridreaderPlus(IObase &f) : file(f){};
+ ~AMRgridreaderPlus(){};
+
+ /*
+ * Low level grid/info fetching routines
+ */
+ AMRgridPlus *getGrid(AMRgridPlus &g,int index){
+ if(file.seek(index)<index)
+ return 0; // don't load past end
+ getGridInfo(g,index);
+ getGridData(g,index);
+ return &g;
+ }
+ AMRgridPlus *getGrid(int index){
+ AMRgridPlus *g=new AMRgridPlus;
+ return this->getGrid(*g,index);
+ }
+
+ AMRgridPlus *getGridInfo(AMRgridPlus &g,int index);
+ AMRgridPlus *getGridData(AMRgridPlus &g,int index);
+
+
+
+
+};
+
+
+#endif