add a ns3::MaxSeconds function
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user