Revert Raj's time unit patch-- causing compilation errors
authorTom Henderson <tomh@tomh.org>
Sun, 25 Mar 2007 06:43:34 -0700
changeset 367 be64c89ac945
parent 366 078917e9b382
child 368 1df1165d6a68
Revert Raj's time unit patch-- causing compilation errors
src/node/onoff-application.cc
src/simulator/nstime.h
src/simulator/time.cc
--- a/src/node/onoff-application.cc	Fri Mar 23 13:47:22 2007 -0400
+++ b/src/node/onoff-application.cc	Sun Mar 25 06:43:34 2007 -0700
@@ -60,7 +60,7 @@
       m_cbrRate(rate),
       m_pktSize(size), 
       m_residualBits(0),
-      m_lastStartTime((HighPrecision)0),
+      m_lastStartTime(0),
       m_maxBytes(0xffffffff),
       m_totBytes(0),
       m_startStopScheduled(false),
--- a/src/simulator/nstime.h	Fri Mar 23 13:47:22 2007 -0400
+++ b/src/simulator/nstime.h	Sun Mar 25 06:43:34 2007 -0700
@@ -309,21 +309,6 @@
 public:
 
   /**
-   * \brief String constructor
-   * Construct TimeUnit<1> object from common time expressions like "
-   * 1ms" or "10s".  Supported units include:
-   * - s  (seconds)
-   * - ms (milliseconds)
-   * - us (microseconds)
-   * - ns (nanoseconds)
-   *
-   * There can be no white space between the numerical portion
-   * and the units.  Any otherwise malformed string causes a fatal error to
-   * occur.
-   * \param s The string to parse into a TimeUnit<1>
-   */
-  TimeUnit<1>(const std::string& s);
-  /**
    * \returns an approximation in seconds of the time stored in this
    *          instance.
    */
--- a/src/simulator/time.cc	Fri Mar 23 13:47:22 2007 -0400
+++ b/src/simulator/time.cc	Sun Mar 25 06:43:34 2007 -0700
@@ -20,43 +20,9 @@
  */
 #include "time.h"
 #include "simulator.h"
-#include "ns3/fatal-error.h"
 
 namespace ns3 {
 
-TimeUnit<1>::TimeUnit<1>(const std::string& s)
-{
-  std::string::size_type n = s.find_first_not_of("0123456789.");
-  if (n != std::string::npos)
-  { // Found non-numeric
-    double r = atof(s.substr(0, n).c_str());
-    std::string trailer = s.substr(n, std::string::npos);
-    if (trailer == std::string("s"))
-    {
-      m_data = HighPrecision (r * 1000000000.0);
-      return;
-    }
-    if (trailer == std::string("ms"))
-    {
-      m_data = HighPrecision ((int64_t)(r * 1000000), false);
-      return;
-    }
-    if (trailer == std::string("us"))
-    {
-      m_data = HighPrecision ((int64_t)(r * 1000), false);
-      return;
-    }
-    if (trailer == std::string("ns"))
-    {
-      m_data = HighPrecision ((int64_t)r, false);
-      return;
-    }
-    NS_FATAL_ERROR("Can't Parse Time "<<s);
-  }
-  //else
-  //they didn't provide units, assume seconds
-  m_data = HighPrecision (atof(s.c_str()) * 1000000000.0);
-}
 double 
 TimeUnit<1>::GetSeconds (void) const
 {