155 explicit inline Time (
double v)
171 explicit inline Time (
long int v)
179 explicit inline Time (
long long int v)
187 explicit inline Time (
unsigned int v)
195 explicit inline Time (
unsigned long int v)
203 explicit inline Time (
unsigned long long int v)
241 explicit Time (
const std::string &
s);
246 return Time (std::numeric_limits<int64_t>::min ());
251 return Time (std::numeric_limits<int64_t>::max ());
430 return Time (retval);
551 const bool convert =
true);
612 static void Mark (
Time *
const time);
782 std::ostream &
operator << (std::ostream & os,
const Time & time);
793 std::istream &
operator >> (std::istream & is, Time & time);
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
bool IsPositive(void) const
Control the scheduling of simulation events.
int64x64_t operator+(const int64x64_t &lhs)
Unary plus operator.
friend Time operator*(const Time &lhs, const int64_t &rhs)
Arithmetic operator.
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.
friend bool operator<(const Time &lhs, const Time &rhs)
Arithmetic operator.
friend bool operator!=(const Time &lhs, const Time &rhs)
Arithmetic operator.
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.
#define ATTRIBUTE_VALUE_DEFINE(Name)
Declare the attribute value class NameValue for the class Name
int64x64_t & operator+=(int64x64_t &lhs, const int64x64_t &rhs)
Compound addition operator.
void MulByInvert(const int64x64_t &o)
Multiply this value by a Q0.128 value, presumably representing an inverse, completing a division oper...
int64_t GetFemtoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
double GetDouble(void) const
Get this value as a double.
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.
int Compare(const Time &o) const
Compare this to another Time.
friend Time operator-(const Time &lhs, const Time &rhs)
Arithmetic operator.
int64x64_t To(enum Unit unit) const
Get the Time value expressed in a particular unit.
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)
Arithmetic operator.
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.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
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)
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
friend Time & operator-=(Time &lhs, const Time &rhs)
Arithmetic operator.
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.
bool IsStrictlyPositive(void) const
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.
double ToDouble(enum Unit unit) const
Get the Time value expressed in a particular unit.
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)
Arithmetic operator.
ATTRIBUTE_ACCESSOR_DEFINE(Boolean)
Time(long int v)
Construct from a numeric value.
static struct Resolution SetDefaultNsResolution(void)
Set the default resolution.
bool operator<(const int64x64_t &lhs, const int64x64_t &rhs)
Less than operator.
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
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.
Time(unsigned long long int v)
Construct from a numeric value.
friend Time & operator+=(Time &lhs, const Time &rhs)
Arithmetic operator.
friend bool operator==(const Time &lhs, const Time &rhs)
Arithmetic operator.
bool IsNegative(void) const
int64_t GetTimeStep(void) const
friend int64_t operator/(const Time &lhs, const Time &rhs)
Arithmetic operator.
Time Hours(double value)
Construct a Time in the indicated unit.
Time TimeStep(uint64_t ts)
double GetHours(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time()
Default constructor, with value 0.
int64_t GetInteger(void) const
double GetDouble(void) const
static struct Information * PeekInformation(enum Unit timeUnit)
Get the Information record for timeUnit for the current Resolution.
Time Minutes(double value)
Construct a Time in the indicated unit.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
static Time FromDouble(double value, enum Unit unit)
Create a Time equal to value in unit unit.
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)
Arithmetic operator.
int64_t GetPicoSeconds(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.
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.
double GetDays(void) const
Get an approximation of the time stored in this instance in the indicated unit.
bool operator>(const int64x64_t &lhs, const int64x64_t &rhs)
Greater operator.
bool operator==(const EventId &a, const EventId &b)
enum Time::Unit unit
Current time unit.
Time::Unit m_unit
The unit to use in output.
bool IsStrictlyNegative(void) const
static void SetResolution(enum Unit resolution)
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.
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.
double GetYears(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)
Arithmetic operator.
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
double GetMinutes(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time & operator=(const Time &o)
Assignment operator.
Time(const Time &o)
Copy constructor.
int64_t m_data
Virtual time value, in the current unit.
int64x64_t & operator-=(int64x64_t &lhs, const int64x64_t &rhs)
Compound subtraction operator.