|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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
static Time From(const int64x64_t &value, enum Unit unit)
Create a Time equal to value in unit unit.
int64x64_t operator+(const int64x64_t &lhs)
Unary plus operator.
ns3::EventId declarations.
static Time FromDouble(double value, enum Unit unit)
Create a Time equal to value in unit unit.
Time PicoSeconds(uint64_t value)
Construct a Time in the indicated unit.
static void ConvertTimes(const enum Unit unit)
Convert existing Times to the new unit.
Time(unsigned int v)
Construct from a numeric value.
Attribute helper (ATTRIBUTE_ )macros definition.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
int64x64_t & operator+=(int64x64_t &lhs, const int64x64_t &rhs)
Compound addition operator.
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
int64_t GetFemtoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
An identifier for simulation events.
Time TimeStep(uint64_t ts)
Scheduler interface.
static Time From(const int64x64_t &value)
Create a Time in the current unit.
Time Years(double value)
Construct a Time in the indicated unit.
friend bool operator==(const Time &lhs, const Time &rhs)
Equality operator for Time.
bool IsNegative(void) const
Exactly equivalent to t <= 0.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
friend int64_t Div(const Time &lhs, const Time &rhs)
Integer quotient from dividing two Times.
bool operator<(const EventId &a, const EventId &b)
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time operator%(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
double GetDouble(void) const
Get this value as a double.
Time FemtoSeconds(uint64_t value)
Construct a Time in the indicated unit.
static void Clear(Time *const time)
Remove a Time instance from the MarkedTimes, called by ~Time().
double GetMinutes(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time(unsigned long int v)
Construct from a numeric value.
static struct Resolution * PeekResolution(void)
Get the current Resolution.
#define ATTRIBUTE_VALUE_DEFINE(name)
Declare the attribute value class nameValue for the class name
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
Time(const Time &o)
Copy constructor.
bool IsStrictlyPositive(void) const
Exactly equivalent to t > 0.
uint64_t GetTs(void) const
int64x64_t operator-(const int64x64_t &lhs)
Unary negation operator (change sign operator).
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
double GetDays(void) const
Get an approximation of the time stored in this instance in the indicated unit.
NS_UNUSED and NS_UNUSED_GLOBAL macro definitions.
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
High precision numerical type, implementing Q64.64 fixed precision.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
Time & operator=(const Time &o)
Assignment operator.
int64_t GetInteger(void) const
Get the raw time value, in the current resolution unit.
static void Mark(Time *const time)
Record a Time instance with the MarkedTimes.
static enum Unit GetResolution(void)
std::set< Time * > MarkedTimes
Record all instances of Time, so we can rescale them when the resolution changes.
TimeWithUnit(const Time time, const Time::Unit unit)
Attach a unit to a Time.
int64_t GetTimeStep(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.
Smart pointer class similar to boost::intrusive_ptr.
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
friend bool operator!=(const Time &lhs, const Time &rhs)
Inequality operator for Time.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
bool operator<=(const int64x64_t &lhs, const int64x64_t &rhs)
Less or equal operator.
static struct Resolution SetDefaultNsResolution(void)
Set the default resolution.
double min(double x, double y)
friend Time operator+(const Time &lhs, const Time &rhs)
Addition operator for Time.
Time::Unit m_unit
The unit to use in output.
friend Time & operator+=(Time &lhs, const Time &rhs)
Compound addition assignment for Time.
Time(double v)
Construct from a numeric value.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
enum Time::Unit unit
Current time unit.
static bool StaticInit()
Function to force static initialization of Time.
bool IsZero(void) const
Exactly equivalent to t == 0.
@ AUTO
auto-scale output when using Time::As()
int64x64_t Abs(const int64x64_t &value)
Absolute value.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
double GetYears(void) const
Get an approximation of the time stored in this instance in the indicated unit.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
int64_t ToInteger(enum Unit unit) const
Get the Time value expressed in a particular unit.
friend bool operator>=(const Time &lhs, const Time &rhs)
Greater than or equal operator for Time.
Time(unsigned long long int v)
Construct from a numeric value.
static MarkedTimes * g_markingTimes
Record of outstanding Time objects which will need conversion when the resolution is set.
Simulation virtual time values and global simulation resolution.
@ LAST
marker for last normal value
friend Time Abs(const Time &time)
Absolute value function for Time.
bool operator==(const EventId &a, const EventId &b)
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time Days(double value)
Construct a Time in the indicated unit.
A Time with attached unit, to facilitate output in that unit.
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
Declaration of the ns3::int64x64_t type and associated operators.
Time Minutes(double value)
Construct a Time in the indicated unit.
#define NS_UNUSED_GLOBAL(x)
Mark a variable at file scope as unused.
static Time FromInteger(uint64_t value, enum Unit unit)
Create a Time equal to value in unit unit.
friend Time & operator-=(Time &lhs, const Time &rhs)
Compound subtraction assignment for Time.
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.
Time Rem(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
Time(int v)
Construct from a numeric value.
struct Information info[LAST]
Conversion info from current unit.
Time(Time &&o)
Move constructor.
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
static struct Information * PeekInformation(enum Unit timeUnit)
Get the Information record for timeUnit for the current Resolution.
bool IsStrictlyNegative(void) const
Exactly equivalent to t < 0.
int Compare(const Time &o) const
Compare this to another Time.
friend std::ostream & operator<<(std::ostream &os, const TimeWithUnit &timeU)
Output streamer.
Time Seconds(double value)
Construct a Time in the indicated unit.
Control the scheduling of simulation events.
friend Time operator%(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
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.
void MulByInvert(const int64x64_t &o)
Multiply this value by a Q0.128 value, presumably representing an inverse, completing a division oper...
Time(const int64x64_t &v)
Construct from a numeric value.
Time RoundTo(enum Unit unit) const
Round a Time to a specific unit.
int64x64_t & operator-=(int64x64_t &lhs, const int64x64_t &rhs)
Compound subtraction operator.
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...
friend bool operator<(const Time &lhs, const Time &rhs)
Less than operator for Time.
friend Time operator-(const Time &lhs, const Time &rhs)
Subtraction operator for Time.
bool operator>(const int64x64_t &lhs, const int64x64_t &rhs)
Greater operator.
Time()
Default constructor, with value 0.
int64_t m_data
Virtual time value, in the current unit.
friend int64x64_t operator/(const Time &lhs, const Time &rhs)
Exact division, returning a dimensionless fixed point number.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Forward calls to a chain of Callback.
double max(double x, double y)
double GetDouble(void) const
Get the raw time value, in the current resolution unit.
Time(long int v)
Construct from a numeric value.
friend bool operator<=(const Time &lhs, const Time &rhs)
Less than or equal operator for Time.
Time Hours(double value)
Construct a Time in the indicated unit.
static void ClearMarkedTimes()
Remove all MarkedTimes.
double GetHours(void) const
Get an approximation of the time stored in this instance in the indicated unit.
int64_t GetPicoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Current time unit, and conversion info.
int64x64_t To(enum Unit unit) const
Get the Time value expressed in a particular unit.
friend Time Rem(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time(long long int v)
Construct from a numeric value.
Unit
The unit to use to interpret a number representing time.
friend bool operator>(const Time &lhs, const Time &rhs)
Greater than operator for Time.
static void SetResolution(enum Unit resolution)
friend Time operator*(const Time &lhs, const int64x64_t &rhs)
Scale a Time by a numeric value.
std::istream & operator>>(std::istream &is, Angles &a)