add a ns3::MaxSeconds function

This commit is contained in:
Mathieu Lacage
2007-11-14 13:45:17 +01:00
parent c18e92df67
commit 5b47785ae4
2 changed files with 12 additions and 0 deletions

View File

@@ -577,6 +577,12 @@ Time PicoSeconds (uint64_t ps);
*/
Time FemtoSeconds (uint64_t fs);
/**
* \brief create a ns3::Time instance which represents
* the maximum value representable in a simulation.
*/
Time MaxSeconds (void);
// internal function not publicly documented
Time TimeStep (uint64_t ts);

View File

@@ -268,6 +268,12 @@ Time FemtoSeconds (uint64_t fs)
uint64_t ts = TimeUnit<1>::UnitsToTimestep(fs, TimeStepPrecision::FS_FACTOR);
return TimeStep(ts);
}
Time MaxSeconds (void)
{
// XXX: I am fairly certain other compilers use other non-standard
// post-fixes to indicate 64 bit constants.
return TimeStep (0xffffffffffffffffLL);
}
/*
* The timestep value passed to this function must be of the precision