181 explicit inline Time (
double v)
197 explicit inline Time (
long int v)
205 explicit inline Time (
long long int v)
213 explicit inline Time (
unsigned int v)
221 explicit inline Time (
unsigned long int v)
229 explicit inline Time (
unsigned long long int v)
267 explicit Time (
const std::string & s);
422 return static_cast<double> (
m_data);
499 return Time (retval);
557 return From (this->
To (unit).Round (), unit);
634 const bool convert =
true);
701 static void Mark (
Time *
const time);
738 friend typename std::enable_if<std::is_integral<T>::value,
Time>::type
748 friend typename std::enable_if<std::is_arithmetic<T>::value,
Time>::type
752 friend typename std::enable_if<std::is_floating_point<T>::value,
Time>::type
759 friend typename std::enable_if<std::is_integral<T>::value,
Time>::type
763 friend typename std::enable_if<std::is_floating_point<T>::value,
Time>::type
767 friend int64_t
Div (
const Time & lhs,
const Time & rhs);
805 namespace TracedValueCallback {
916 return static_cast<uint64_t
> (time.
m_data) < event.
GetTs ();
974 typename std::enable_if<std::is_integral<T>::value,
Time>::type
977 static_assert(!std::is_same<T, bool>::value,
978 "Multiplying a Time by a boolean is not supported");
997 typename std::enable_if<std::is_arithmetic<T>::value,
Time>::type
1013 typename std::enable_if<std::is_floating_point<T>::value,
Time>::type
1069 typename std::enable_if<std::is_integral<T>::value,
Time>::type
1072 static_assert(!std::is_same<T, bool>::value,
1073 "Dividing a Time by a boolean is not supported");
1088 typename std::enable_if<std::is_floating_point<T>::value,
Time>::type
int64x64_t & operator+=(int64x64_t &lhs, const int64x64_t &rhs)
Compound addition operator.
static struct Resolution * PeekResolution(void)
Get the current Resolution.
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Time operator%(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
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.
#define NS_UNUSED_GLOBAL(x)
Mark a variable at file scope as unused.
static Time Min()
Minimum representable Time Not to be confused with Min(Time,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
Exactly equivalent to t > 0.
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.
std::istream & operator>>(std::istream &is, Angles &a)
friend Time operator%(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
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.
auto-scale output when using Time::As()
friend Time operator-(const Time &lhs, const Time &rhs)
Subtraction operator for Time.
bool operator<(const EventId &a, const EventId &b)
Time PicoSeconds(uint64_t value)
Construct a Time in the indicated unit.
struct Information info[LAST]
Conversion info from current unit.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Time RoundTo(enum Unit unit) const
Round a Time to a specific unit.
friend Time operator+(const Time &lhs, const Time &rhs)
Addition operator for Time.
static Time Max()
Maximum representable Time Not to be confused with Max(Time,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)
bool IsZero(void) const
Exactly equivalent to t == 0.
friend Time & operator-=(Time &lhs, const Time &rhs)
Compound subtraction assignment for Time.
Time TimeStep(uint64_t ts)
Scheduler interface.
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.
Time Rem(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
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.
int64_t Div(const Length &numerator, const Length &denominator, Length *remainder)
This function provides a string parsing method that does not rely on istream, which has been found to...
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.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
friend int64x64_t operator/(const Time &lhs, const Time &rhs)
Exact division, returning a dimensionless fixed point number.
double GetDays(void) const
Get an approximation of the time stored in this instance in the indicated unit.
uint64_t GetTs(void) const
friend int64_t Div(const Time &lhs, const Time &rhs)
Integer quotient from dividing two Times.
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)
Compound addition assignment for Time.
friend bool operator==(const Time &lhs, const Time &rhs)
Equality operator for Time.
Time Hours(double value)
Construct a Time in the indicated unit.
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.
friend Time operator*(const Time &lhs, const int64x64_t &rhs)
Scale a Time by a numeric value.
Time Minutes(double value)
Construct a Time in the indicated unit.
double max(double x, double y)
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.
An identifier for simulation events.
int Compare(const Time &o) const
Compare this to another Time.
friend Time Rem(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
bool IsPositive(void) const
Exactly equivalent to t >= 0.
bool IsStrictlyNegative(void) const
Exactly equivalent to t < 0.
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)
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.
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. ...
marker for last normal value
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.
ns3::EventId declarations.
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
Exactly equivalent to t <= 0.
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.