57   return g_markingMutex;
    65   static bool firstTime = 
true;
    99   std::string::size_type 
n = s.find_first_not_of (
"+-0123456789.eE");
   100   if (
n != std::string::npos)
   102       std::istringstream iss;
   103       iss.str (s.substr (0, 
n));
   106       std::string trailer = s.substr (
n, std::string::npos);
   107       if (trailer == std::string (
"s"))
   111       else if (trailer == std::string (
"ms"))
   115       else if (trailer == std::string (
"us"))
   119       else if (trailer == std::string (
"ns"))
   123       else if (trailer == std::string (
"ps"))
   127       else if (trailer == std::string (
"fs"))
   131       else if (trailer == std::string (
"min"))
   135       else if (trailer == std::string (
"h"))
   139       else if (trailer == std::string (
"d"))
   143       else if (trailer == std::string (
"y"))
   155       std::istringstream iss;
   170 Time::SetDefaultNsResolution (void)
   201   const int8_t power[
LAST] = { 17, 17, 17, 16, 15, 12, 9, 6, 3, 0 };
   202   const int32_t coefficient[
LAST] = { 315360, 864, 36, 6, 1, 1, 1, 1, 1, 1 };
   205       int shift = power[i] - power[(int)unit];
   207       if (coefficient[i] > coefficient[(
int) unit])
   209           quotient = coefficient[i] / coefficient[(int) unit];
   210           NS_ASSERT (quotient * coefficient[(
int) unit] == coefficient[i]);
   212       else if (coefficient[i] < coefficient[(
int) unit])
   214           quotient = coefficient[(int) unit] / coefficient[i];
   215           NS_ASSERT (quotient * coefficient[i] == coefficient[(
int) unit]);
   217       NS_LOG_DEBUG (
"SetResolution for unit " << (
int) unit <<
   218                     " loop iteration " << i <<
   219                     " has shift " << shift << 
" has quotient " << quotient);
   220       int64_t factor = 
static_cast<int64_t
> (std::pow (10, std::fabs (shift)) * quotient);
   221       double realFactor = std::pow (10, (
double) shift)
   222         * 
static_cast<double> (coefficient[i]) / coefficient[(
int) unit];
   223       NS_LOG_DEBUG (
"SetResolution factor " << factor << 
" real factor " << realFactor);
   228       if (shift == 0 && quotient == 1)
   235       else if (realFactor > 1)
   251   resolution->
unit = unit;
   299       std::pair< MarkedTimes::iterator, bool> ret;
   304       if (ret.second == 
false)
   324                      "Time object " << time <<
   326                      " times (should be 1)." );
   331           NS_LOG_WARN (
"unexpected result erasing " << time << 
"!");
   351                  "No MarkedTimes registry. "   352                  "Time::SetResolution () called more than once?");
   358       Time * 
const tp = *it;
   411     case Time::Y:    unit = 
"y";    
break;
   412     case Time::D:    unit = 
"d";    
break;
   413     case Time::H:    unit = 
"h";    
break;
   415     case Time::S:    unit = 
"s";    
break;
   426       unit = 
"unreachable";
   438   std::ios_base::fmtflags ff = os.flags ();
   440   os << std::showpos << std::right << v << unit;
   443   if (!(ff & std::ios_base::showpos))
   445       os << std::noshowpos;
   447   if (ff & std::ios_base::left)
   451   else if (ff & std::ios_base::internal)
   478     Checker (
const Time minValue, 
const Time maxValue)
   479       : m_minValue (minValue),
   480         m_maxValue (maxValue)
   490       return v->
Get () >= m_minValue && v->
Get () <= m_maxValue;
   492     virtual std::string GetValueTypeName (
void)
 const   495       return "ns3::TimeValue";
   497     virtual bool HasUnderlyingTypeInformation (
void)
 const   502     virtual std::string GetUnderlyingTypeInformation (
void)
 const   505       std::ostringstream oss;
   506       oss << 
"Time" << 
" " << m_minValue << 
":" << m_maxValue;
   512       return ns3::Create<TimeValue> ();
   519       if (src == 0 || dst == 0)
   528   } *checker = 
new Checker (
min, 
max);
 static struct Resolution * PeekResolution(void)
Get the current Resolution. 
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input 
Represent the type of an attribute. 
Simulation virtual time values and global simulation resolution. 
Smart pointer class similar to boost::intrusive_ptr. 
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message. 
A Time with attached unit, to facilitate output in that unit. 
int64_t ToInteger(enum Unit unit) const
Get the Time value expressed in a particular unit. 
Hold a value for an Attribute. 
High precision numerical type, implementing Q64.64 fixed precision. 
static int64x64_t Invert(const uint64_t v)
Compute the inverse of an integer value. 
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
double ToDouble(enum Unit unit) const
Get the Time value expressed in a particular unit. 
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time. 
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function. 
TimeWithUnit As(const enum Unit unit) const
Attach a unit to a Time, to facilitate output in a specific unit. 
struct Information info[LAST]
Conversion info from current unit. 
#define ATTRIBUTE_VALUE_IMPLEMENT(type)
Define the class methods belonging to attribute value class typeValue for class type. 
System-independent mutex primitive, ns3::SystemMutex, and ns3::CriticalSection. 
static enum Unit GetResolution(void)
  AttributeValue implementation for Time. 
Current time unit, and conversion info. 
static bool StaticInit()
Function to force static initialization of Time. 
A class which provides a simple way to implement a Critical Section. 
Unit
The unit to use to interpret a number representing time. 
static void ConvertTimes(const enum Unit unit)
Convert existing Times to the new unit. 
#define NS_LOG_COMPONENT_DEFINE_MASK(name, mask)
Define a logging component with a mask. 
Declaration of classes ns3::Time and ns3::TimeWithUnit, and the TimeValue implementation classes...
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC. 
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output 
Ptr< T > Create(Ts... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr...
SystemMutex & GetMarkingMutex()
Prefix all trace prints with simulation time. 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
Time()
Default constructor, with value 0. 
A class which provides a relatively platform-independent Mutual Exclusion thread synchronization prim...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
double max(double x, double y)
static Time FromDouble(double value, enum Unit unit)
Create a Time equal to value in unit unit. 
static void Mark(Time *const time)
Record a Time instance with the MarkedTimes. 
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN. 
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG. 
enum Time::Unit unit
Current time unit. 
Time::Unit m_unit
The unit to use in output. 
static void SetResolution(enum Unit resolution)
double min(double x, double y)
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. 
static void Clear(Time *const time)
Remove a Time instance from the MarkedTimes, called by ~Time(). 
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR. 
std::set< Time *> MarkedTimes
Record all instances of Time, so we can rescale them when the resolution changes. ...
static MarkedTimes * g_markingTimes
Record of outstanding Time objects which will need conversion when the resolution is set...
static void ClearMarkedTimes()
Remove all MarkedTimes. 
Ptr< T > Copy(Ptr< T > object)
Return a deep copy of a Ptr. 
int64_t m_data
Virtual time value, in the current unit. 
NS_ABORT_x macro definitions.