From 866da9180e366b7cdd55126d5e73a7f65bc34ff5 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Wed, 18 Aug 2010 15:06:26 -0700 Subject: [PATCH] Additional stubs for HighPrecision operators --- src/simulator/high-precision-cairo.h | 11 +++++++++++ src/simulator/high-precision-double.h | 20 ++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/simulator/high-precision-cairo.h b/src/simulator/high-precision-cairo.h index 7a3c9d0c8..117df6965 100644 --- a/src/simulator/high-precision-cairo.h +++ b/src/simulator/high-precision-cairo.h @@ -162,6 +162,17 @@ HighPrecision::HighPrecision (double value) } #undef HPCAIRO_MAX_64 +std::ostream &operator << (std::ostream &os, const HighPrecision &hp) +{ + // XXX stubbed out + return os; +} +std::istream &operator >> (std::istream &is, HighPrecision &hp) +{ + // XXX stubbed out + return is; +} + } // namespace ns3 #endif /* HIGH_PRECISION_CAIRO_H */ diff --git a/src/simulator/high-precision-double.h b/src/simulator/high-precision-double.h index 9746b83c4..0521265b0 100644 --- a/src/simulator/high-precision-double.h +++ b/src/simulator/high-precision-double.h @@ -21,6 +21,7 @@ #define HIGH_PRECISION_DOUBLE_H #include +#include "ns3/fatal-error.h" namespace ns3 { @@ -56,6 +57,9 @@ private: double m_value; }; +inline std::ostream &operator << (std::ostream &os, const HighPrecision &hp); +inline std::istream &operator >> (std::istream &is, HighPrecision &hp); + } // namespace ns3 namespace ns3 { @@ -131,8 +135,7 @@ HighPrecision::Zero (void) int64_t HighPrecision::GetHigh (void) const { - NS_FATAL_ERROR ("XXX this function unavailable for high-precision-as-double; patch requested"); - return 0; + return GetInteger (); } uint64_t @@ -142,6 +145,19 @@ HighPrecision::GetLow (void) const return 0; } +std::ostream &operator << (std::ostream &os, const HighPrecision &hp) +{ + // XXX stubbed out + return os; +} + +std::istream &operator >> (std::istream &is, HighPrecision &hp) +{ + // XXX stubbed out + return is; +} + + } // namespace ns3 #endif /* HIGH_PRECISION_DOUBLE_H */