[cig-commits] r15236 - cs/spatialdata-0.1/trunk/libsrc/spatialdb

brad at geodynamics.org brad at geodynamics.org
Sun Jun 14 08:03:32 PDT 2009


Author: brad
Date: 2009-06-14 08:03:32 -0700 (Sun, 14 Jun 2009)
New Revision: 15236

Modified:
   cs/spatialdata-0.1/trunk/libsrc/spatialdb/TimeHistoryIO.cc
Log:
Added check to make sure time history is ordered (assumed in queries).

Modified: cs/spatialdata-0.1/trunk/libsrc/spatialdb/TimeHistoryIO.cc
===================================================================
--- cs/spatialdata-0.1/trunk/libsrc/spatialdb/TimeHistoryIO.cc	2009-06-14 14:50:21 UTC (rev 15235)
+++ cs/spatialdata-0.1/trunk/libsrc/spatialdb/TimeHistoryIO.cc	2009-06-14 15:03:32 UTC (rev 15236)
@@ -134,6 +134,10 @@
       buffer >> amplitude[i];
       time[i] *= scale;
     } // for
+    // Verify that the time stamps are ordered in time.
+    for (int i=1; i < size; ++i)
+      if (time[i-1] >= time[i])
+	throw std::runtime_error("Time history must be ordered in time.");
     
     if (!filein.good())
       throw std::runtime_error("Unknown error while reading.");



More information about the CIG-COMMITS mailing list