180 explicit inline Time (
double v)
196 explicit inline Time (
long int v)
204 explicit inline Time (
long long int v)
212 explicit inline Time (
unsigned int v)
220 explicit inline Time (
unsigned long int v)
228 explicit inline Time (
unsigned long long int v)
266 explicit Time (
const std::string & s);
421 return static_cast<double> (
m_data);
498 return Time (retval);
557 return From (this->
To (unit).Round (), unit);
634 const bool convert =
true);
701 static void Mark (
Time *
const time);
740 friend int64_t
Div (
const Time & lhs,
const Time & rhs);
744 friend typename std::enable_if<std::is_integral<T>::value,
Time>::type
750 friend typename std::enable_if<std::is_arithmetic<T>::value,
Time>::type
754 friend typename std::enable_if<std::is_integral<T>::value,
Time>::type
765 friend typename std::enable_if<std::is_floating_point<T>::value,
Time>::type
768 friend typename std::enable_if<std::is_floating_point<T>::value,
Time>::type
785 namespace TracedValueCallback {
896 return static_cast<uint64_t
> (time.
m_data) < event.
GetTs ();
954 typename std::enable_if<std::is_integral<T>::value,
Time>::type
957 static_assert(!std::is_same<T, bool>::value,
958 "Multiplying a Time by a boolean is not supported");
965 typename std::enable_if<std::is_floating_point<T>::value,
Time>::type
985 typename std::enable_if<std::is_arithmetic<T>::value,
Time>::type
1041 typename std::enable_if<std::is_integral<T>::value,
Time>::type
1044 static_assert(!std::is_same<T, bool>::value,
1045 "Dividing a Time by a boolean is not supported");
1052 typename std::enable_if<std::is_floating_point<T>::value,
Time>::type
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
Attribute helper (ATTRIBUTE_ )macros definition.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
An identifier for simulation events.
uint64_t GetTs(void) const
Smart pointer class similar to boost::intrusive_ptr.
Control the scheduling of simulation events.
Simulation virtual time values and global simulation resolution.
int64_t GetFemtoSeconds(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)
Remainder (modulus) from the quotient of two Times.
double GetDays(void) const
Get an approximation of the time stored in this instance in the indicated unit.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static struct Information * PeekInformation(enum Unit timeUnit)
Get the Information record for timeUnit for the current Resolution.
bool IsStrictlyPositive(void) const
Exactly equivalent to t > 0.
int64x64_t To(enum Unit unit) const
Get the Time value expressed in a particular unit.
double GetMinutes(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static Time From(const int64x64_t &value, enum Unit unit)
Create a Time equal to value in unit unit.
double GetHours(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static enum Unit GetResolution(void)
double GetDouble(void) const
Get the raw time value, in the current resolution unit.
double ToDouble(enum Unit unit) const
Get the Time value expressed in a particular unit.
Time RoundTo(enum Unit unit) const
Round a Time to a specific unit.
Time(const Time &o)
Copy constructor.
Time(const int64x64_t &v)
Construct from a numeric value.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static void ClearMarkedTimes()
Remove all MarkedTimes.
Time(unsigned long int v)
Construct from a numeric value.
static Time From(const int64x64_t &value)
Create a Time in the current unit.
int64_t GetTimeStep(void) const
Get the raw time value, in the current resolution unit.
Time(long long int v)
Construct from a numeric value.
static Time FromInteger(uint64_t value, enum Unit unit)
Create a Time equal to value in unit unit.
int64_t ToInteger(enum Unit unit) const
Get the Time value expressed in a particular unit.
bool IsPositive(void) const
Exactly equivalent to t >= 0.
static Time FromDouble(double value, enum Unit unit)
Create a Time equal to value in unit unit.
Time TimeStep(uint64_t ts)
Scheduler interface.
Time(double v)
Construct from a numeric value.
static struct Resolution SetDefaultNsResolution(void)
Set the default resolution.
static bool StaticInit()
Function to force static initialization of Time.
friend bool operator==(const Time &lhs, const Time &rhs)
Equality operator for Time.
Time(unsigned long long int v)
Construct from a numeric value.
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
int64_t GetInteger(void) const
Get the raw time value, in the current resolution unit.
static void Clear(Time *const time)
Remove a Time instance from the MarkedTimes, called by ~Time().
Unit
The unit to use to interpret a number representing time.
@ AUTO
auto-scale output when using Time::As()
@ LAST
marker for last normal value
Time()
Default constructor, with value 0.
friend bool operator>=(const Time &lhs, const Time &rhs)
Greater than or equal operator for Time.
friend Time & operator+=(Time &lhs, const Time &rhs)
Compound addition assignment for Time.
static struct Resolution * PeekResolution(void)
Get the current Resolution.
friend bool operator<=(const Time &lhs, const Time &rhs)
Less than or equal operator for Time.
static MarkedTimes * g_markingTimes
Record of outstanding Time objects which will need conversion when the resolution is set.
int64_t m_data
Virtual time value, in the current unit.
friend Time Rem(const Time &lhs, const Time &rhs)
Addition operator for Time.
friend int64_t Div(const Time &lhs, const Time &rhs)
Integer quotient from dividing two Times.
static void Mark(Time *const time)
Record a Time instance with the MarkedTimes.
friend bool operator<(const Time &lhs, const Time &rhs)
Less than operator for Time.
Time(int v)
Construct from a numeric value.
friend bool operator!=(const Time &lhs, const Time &rhs)
Inequality operator for Time.
Time(Time &&o)
Move constructor.
static void ConvertTimes(const enum Unit unit)
Convert existing Times to the new unit.
bool IsStrictlyNegative(void) const
Exactly equivalent to t < 0.
Time(unsigned int v)
Construct from a numeric value.
bool IsZero(void) const
Exactly equivalent to t == 0.
int Compare(const Time &o) const
Compare this to another Time.
static void SetResolution(enum Unit resolution)
friend Time operator-(const Time &lhs, const Time &rhs)
Subtraction operator for Time.
int64_t GetMilliSeconds(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)
Addition operator for Time.
double GetYears(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
friend Time operator*(const Time &lhs, const int64x64_t &rhs)
Scale a Time by a numeric value.
std::set< Time * > MarkedTimes
Record all instances of Time, so we can rescale them when the resolution changes.
friend bool operator>(const Time &lhs, const Time &rhs)
Greater than operator for Time.
friend Time Abs(const Time &time)
Absolute value for Time.
Time(long int v)
Construct from a numeric value.
friend Time & operator-=(Time &lhs, const Time &rhs)
Compound subtraction assignment for Time.
friend int64x64_t operator/(const Time &lhs, const Time &rhs)
Exact division, returning a dimensionless fixed point number.
bool IsNegative(void) const
Exactly equivalent to t <= 0.
Time & operator=(const Time &o)
Assignment operator.
int64_t GetPicoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
A Time with attached unit, to facilitate output in that unit.
friend std::ostream & operator<<(std::ostream &os, const TimeWithUnit &timeU)
Output streamer.
TimeWithUnit(const Time time, const Time::Unit unit)
Attach a unit to a Time.
Time::Unit m_unit
The unit to use in output.
Forward calls to a chain of Callback.
High precision numerical type, implementing Q64.64 fixed precision.
void MulByInvert(const int64x64_t &o)
Multiply this value by a Q0.128 value, presumably representing an inverse, completing a division oper...
double GetDouble(void) const
Get this value as a double.
ns3::EventId declarations.
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
#define ATTRIBUTE_VALUE_DEFINE(name)
Declare the attribute value class nameValue for the class name
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
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)
Subtraction operator.
int64x64_t operator+(const int64x64_t &lhs, const int64x64_t &rhs)
Addition operator.
int64x64_t Abs(const int64x64_t &value)
Absolute value.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
bool operator>(const Length &left, const Length &right)
Check if left has a value greater than right.
int64_t Div(const Length &numerator, const Length &denominator, Length *remainder)
Calculate how many times numerator can be split into denominator sized pieces.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time Days(double value)
Construct a Time in the indicated unit.
Time Hours(double value)
Construct a Time in the indicated unit.
Time PicoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time FemtoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Minutes(double value)
Construct a Time in the indicated unit.
Time Years(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Declaration of the ns3::int64x64_t type and associated operators.
Length::Unit Unit
Save some typing by defining a short alias for Length::Unit.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time Rem(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
Time operator%(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
bool operator==(const EventId &a, const EventId &b)
Time & operator+=(Time &lhs, const Time &rhs)
Compound addition assignment for Time.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
bool operator<(const EventId &a, const EventId &b)
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.
std::istream & operator>>(std::istream &is, Angles &a)
Time & operator-=(Time &lhs, const Time &rhs)
Compound subtraction assignment for Time.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Current time unit, and conversion info.
struct Information info[LAST]
Conversion info from current unit.
enum Time::Unit unit
Current time unit.