179 explicit inline Time (
double v)
195 explicit inline Time (
long int v)
203 explicit inline Time (
long long int v)
211 explicit inline Time (
unsigned int v)
219 explicit inline Time (
unsigned long int v)
227 explicit inline Time (
unsigned long long int v)
265 explicit Time (
const std::string & s);
397 return static_cast<double> (
m_data);
474 return Time (retval);
607 const bool convert =
true);
668 static void Mark (
Time *
const time);
732 namespace TracedValueCallback {
int64x64_t & operator+=(int64x64_t &lhs, const int64x64_t &rhs)
Compound addition operator.
static struct Resolution * PeekResolution(void)
Get the current Resolution.
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Simulation virtual time values and global simulation resolution.
Smart pointer class similar to boost::intrusive_ptr.
Control the scheduling of simulation events.
int64x64_t operator+(const int64x64_t &lhs)
Unary plus operator.
int64_t GetInteger(void) const
Get the raw time value, in the current resolution unit.
friend Time operator*(const Time &lhs, const int64_t &rhs)
Multiplication operator for Time.
static Time Min()
Minimum representable Time.
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.
High precision numerical type, implementing Q64.64 fixed precision.
Forward calls to a chain of Callback.
friend bool operator<(const Time &lhs, const Time &rhs)
Less than operator for Time.
friend bool operator!=(const Time &lhs, const Time &rhs)
Inequality operator for Time.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define ATTRIBUTE_VALUE_DEFINE(name)
Declare the attribute value class nameValue for the class name.
int64x64_t operator-(const int64x64_t &lhs)
Unary negation operator (change sign operator).
static Time From(const int64x64_t &value)
Create a Time in the current unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
double ToDouble(enum Unit unit) const
Get the Time value expressed in a particular unit.
bool IsStrictlyPositive(void) const
void MulByInvert(const int64x64_t &o)
Multiply this value by a Q0.128 value, presumably representing an inverse, completing a division oper...
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
double GetYears(void) const
Get an approximation of the time stored in this instance in the indicated unit.
TimeWithUnit As(const enum Unit unit) const
Attach a unit to a Time, to facilitate output in a specific unit.
Time(unsigned long int v)
Construct from a numeric value.
Time(const int64x64_t &v)
Construct from a numeric value.
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
int64_t GetPicoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
friend Time operator-(const Time &lhs, const Time &rhs)
Difference operator for Time.
bool operator<(const EventId &a, const EventId &b)
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Time PicoSeconds(uint64_t value)
Construct a Time in the indicated unit.
struct Information info[LAST]
Conversion info from current unit.
static bool NS_UNUSED_GLOBAL(g_TimeStaticInit)
Force static initialization of Time.
friend Time operator+(const Time &lhs, const Time &rhs)
Addition operator for Time.
static Time Max()
Maximum representable Time.
friend Time Abs(const Time &time)
Absolute value function for Time.
bool operator<=(const int64x64_t &lhs, const int64x64_t &rhs)
Less or equal operator.
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
Time(int v)
Construct from a numeric value.
Time Years(double value)
Construct a Time in the indicated unit.
static enum Unit GetResolution(void)
friend Time & operator-=(Time &lhs, const Time &rhs)
Subtraction operator for Time.
Time(long long int v)
Construct from a numeric value.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Current time unit, and conversion info.
static bool StaticInit()
Function to force static initialization of Time.
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
friend std::ostream & operator<<(std::ostream &os, const TimeWithUnit &timeU)
Output streamer.
static Time From(const int64x64_t &value, enum Unit unit)
Create a Time equal to value in unit unit.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
Unit
The unit to use to interpret a number representing time.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
static void ConvertTimes(const enum Unit unit)
Convert existing Times to the new unit.
friend bool operator>=(const Time &lhs, const Time &rhs)
Greater than or equal operator for Time.
double GetDouble(void) const
Get the raw time value, in the current resolution unit.
Time(long int v)
Construct from a numeric value.
static struct Resolution SetDefaultNsResolution(void)
Set the default resolution.
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
int64x64_t Abs(const int64x64_t &value)
Absolute value.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
double GetDays(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time(double v)
Construct from a numeric value.
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time(unsigned long long int v)
Construct from a numeric value.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
friend Time & operator+=(Time &lhs, const Time &rhs)
Addition operator for Time.
friend bool operator==(const Time &lhs, const Time &rhs)
Arithmetic operator.
friend int64_t operator/(const Time &lhs, const Time &rhs)
Division operator for Time.
Time Hours(double value)
Construct a Time in the indicated unit.
Time TimeStep(uint64_t ts)
Time()
Default constructor, with value 0.
static struct Information * PeekInformation(enum Unit timeUnit)
Get the Information record for timeUnit for the current Resolution.
Attribute helper (ATTRIBUTE_ )macros definition.
Time Minutes(double value)
Construct a Time in the indicated unit.
static Time FromDouble(double value, enum Unit unit)
Create a Time equal to value in unit unit.
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
Time(unsigned int v)
Construct from a numeric value.
static void Mark(Time *const time)
Record a Time instance with the MarkedTimes.
friend bool operator>(const Time &lhs, const Time &rhs)
Greater than operator for Time.
double GetMinutes(void) const
Get an approximation of the time stored in this instance in the indicated unit.
int Compare(const Time &o) const
Compare this to another Time.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
bool IsPositive(void) const
bool IsStrictlyNegative(void) const
static Time FromInteger(uint64_t value, enum Unit unit)
Create a Time equal to value in unit unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
bool operator>(const int64x64_t &lhs, const int64x64_t &rhs)
Greater operator.
bool operator==(const EventId &a, const EventId &b)
double GetDouble(void) const
Get this value as a double.
enum Time::Unit unit
Current time unit.
Time::Unit m_unit
The unit to use in output.
static void SetResolution(enum Unit resolution)
int64x64_t To(enum Unit unit) const
Get the Time value expressed in a particular unit.
static void Clear(Time *const time)
Remove a Time instance from the MarkedTimes, called by ~Time().
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
TimeWithUnit(const Time time, const Time::Unit unit)
Attach a unit to a Time.
int64x64_t & operator-=(int64x64_t &lhs, const int64x64_t &rhs)
Compound subtraction operator.
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...
Time Days(double value)
Construct a Time in the indicated unit.
Time FemtoSeconds(uint64_t value)
Construct a Time in the indicated unit.
int64_t GetFemtoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static void ClearMarkedTimes()
Remove all MarkedTimes.
friend bool operator<=(const Time &lhs, const Time &rhs)
Less than or equal operator for Time.
Declaration of the ns3::int64x64_t type and associated operators.
Time & operator=(const Time &o)
Assignment operator.
double GetHours(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time(const Time &o)
Copy constructor.
bool IsNegative(void) const
int64_t m_data
Virtual time value, in the current unit.
Time(Time &&o)
Move constructor.
int64_t GetTimeStep(void) const
Get the raw time value, in the current resolution unit.
NS_UNUSED and NS_UNUSED_GLOBAL macro definitions.