52 return g_markingMutex;
60 static bool firstTime =
true;
94 std::string::size_type n = s.find_first_not_of (
"+-0123456789.");
95 if (n != std::string::npos)
97 std::istringstream iss;
98 iss.str (s.substr (0, n));
101 std::string trailer = s.substr (n, std::string::npos);
102 if (trailer == std::string (
"s"))
106 else if (trailer == std::string (
"ms"))
110 else if (trailer == std::string (
"us"))
114 else if (trailer == std::string (
"ns"))
118 else if (trailer == std::string (
"ps"))
122 else if (trailer == std::string (
"fs"))
134 std::istringstream iss;
149 Time::SetDefaultNsResolution (void)
179 int8_t power [
LAST] = { 15, 12, 9, 6, 3, 0};
182 int shift = power[i] - power[(int)unit];
183 int64_t factor = (int64_t) std::pow (10, std::fabs (shift));
189 info->
timeTo = int64x64_t (1);
195 info->
timeFrom = int64x64_t (factor);
196 info->
timeTo = int64x64_t::Invert (factor);
203 info->
timeFrom = int64x64_t::Invert (factor);
204 info->
timeTo = int64x64_t (factor);
209 resolution->
unit = unit;
257 std::pair< MarkedTimes::iterator, bool> ret;
262 if (ret.second ==
false)
282 "Time object " << time <<
284 " times (should be 1)." );
289 NS_LOG_WARN (
"unexpected result erasing " << time <<
"!");
309 "No MarkedTimes registry. "
310 "Time::SetResolution () called more than once?");
316 Time *
const tp = *it;
317 if ( ! ( (tp->
m_data == std::numeric_limits<int64_t>::min ())
318 || (tp->
m_data == std::numeric_limits<int64_t>::max ())
373 unit =
"unreachable";
378 std::ios_base::fmtflags ff = os.flags ();
389 os << v <<
".0" << unit;
403 Ptr<const AttributeChecker>
410 Checker (
const Time minValue,
const Time maxValue)
411 : m_minValue (minValue),
412 m_maxValue (maxValue) {}
420 return v->
Get () >= m_minValue && v->
Get () <= m_maxValue;
422 virtual std::string GetValueTypeName (
void)
const {
424 return "ns3::TimeValue";
426 virtual bool HasUnderlyingTypeInformation (
void)
const {
430 virtual std::string GetUnderlyingTypeInformation (
void)
const {
432 std::ostringstream oss;
433 oss <<
"Time" <<
" " << m_minValue <<
":" << m_maxValue;
438 return ns3::Create<TimeValue> ();
444 if (src == 0 || dst == 0)
453 } *checker =
new Checker (min, max);