[cig-commits] r9293 - cs/benchmark/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Feb 13 01:51:13 PST 2008


Author: luis
Date: 2008-02-13 01:51:13 -0800 (Wed, 13 Feb 2008)
New Revision: 9293

Modified:
   cs/benchmark/cigma/trunk/src/Reader.cpp
   cs/benchmark/cigma/trunk/src/Reader.h
Log:
Moved new_reader() out of Misc.cpp


Modified: cs/benchmark/cigma/trunk/src/Reader.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/Reader.cpp	2008-02-13 09:51:11 UTC (rev 9292)
+++ cs/benchmark/cigma/trunk/src/Reader.cpp	2008-02-13 09:51:13 UTC (rev 9293)
@@ -1,8 +1,39 @@
-#include "Reader.h"
 #include <cassert>
 #include <cstdlib>
+#include "Reader.h"
+#include "HdfReader.h"
+#include "TextReader.h"
+#include "VtkReader.h"
 
+using namespace cigma;
+
+
 // ---------------------------------------------------------------------------
+
+void new_reader(cigma::Reader **reader, std::string ext)
+{
+    if (ext == ".h5")
+    {
+        *reader = new HdfReader();
+        return;
+    }
+
+    if (ext == ".txt")
+    {
+        *reader = new TextReader();
+        return;
+    }
+
+    if (ext == ".vtk")
+    {
+        *reader = new VtkReader();
+        return;
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
 cigma::Reader::Reader()
 {
 }
@@ -12,4 +43,3 @@
 }
 
 // ---------------------------------------------------------------------------
-

Modified: cs/benchmark/cigma/trunk/src/Reader.h
===================================================================
--- cs/benchmark/cigma/trunk/src/Reader.h	2008-02-13 09:51:11 UTC (rev 9292)
+++ cs/benchmark/cigma/trunk/src/Reader.h	2008-02-13 09:51:13 UTC (rev 9293)
@@ -33,4 +33,8 @@
     virtual void get_connectivity(const char *loc, int **connectivity, int *nel, int *ndofs) = 0;
 };
 
+
+void new_reader(cigma::Reader **reader, std::string ext);
+
+
 #endif



More information about the cig-commits mailing list