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

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


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

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


Modified: cs/benchmark/cigma/trunk/src/Writer.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/Writer.cpp	2008-02-13 09:51:13 UTC (rev 9293)
+++ cs/benchmark/cigma/trunk/src/Writer.cpp	2008-02-13 09:51:15 UTC (rev 9294)
@@ -1,8 +1,40 @@
-#include "Writer.h"
 #include <cassert>
 #include <cstdlib>
+#include "Writer.h"
+#include "HdfWriter.h"
+#include "TextWriter.h"
+#include "VtkWriter.h"
 
+
+using namespace cigma;
+
+
 // ---------------------------------------------------------------------------
+
+void new_writer(cigma::Writer **writer, std::string ext)
+{
+    if (ext == ".h5")
+    {
+        *writer = new HdfWriter();
+        return;
+    }
+
+    if (ext == ".txt")
+    {
+        *writer = new TextWriter();
+        return;
+    }
+
+    if (ext == ".vtk")
+    {
+        *writer = new VtkWriter();
+        return;
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
 cigma::Writer::Writer()
 {
 }
@@ -12,4 +44,3 @@
 }
 
 // ---------------------------------------------------------------------------
-

Modified: cs/benchmark/cigma/trunk/src/Writer.h
===================================================================
--- cs/benchmark/cigma/trunk/src/Writer.h	2008-02-13 09:51:13 UTC (rev 9293)
+++ cs/benchmark/cigma/trunk/src/Writer.h	2008-02-13 09:51:15 UTC (rev 9294)
@@ -37,6 +37,7 @@
 };
 
 
-// ---------------------------------------------------------------------------
+void new_writer(cigma::Writer **writer, std::string ext);
 
+
 #endif



More information about the cig-commits mailing list