|
| const ClockTime & | operator= (const ClockTime &x) |
| |
| const ClockTime & | operator= (const cPar &d) |
| |
| const ClockTime & | operator= (double d) |
| |
| const ClockTime & | operator= (short d) |
| |
| const ClockTime & | operator= (int d) |
| |
| const ClockTime & | operator= (long d) |
| |
| const ClockTime & | operator= (long long d) |
| |
| const ClockTime & | operator= (unsigned short d) |
| |
| const ClockTime & | operator= (unsigned int d) |
| |
| const ClockTime & | operator= (unsigned long d) |
| |
| const ClockTime & | operator= (unsigned long long d) |
| |
| bool | operator== (const ClockTime &x) const |
| |
| bool | operator!= (const ClockTime &x) const |
| |
| bool | operator< (const ClockTime &x) const |
| |
| bool | operator> (const ClockTime &x) const |
| |
| bool | operator<= (const ClockTime &x) const |
| |
| bool | operator>= (const ClockTime &x) const |
| |
| ClockTime | operator- () const |
| |
| const ClockTime & | operator+= (const ClockTime &x) |
| |
| const ClockTime & | operator-= (const ClockTime &x) |
| |
| const ClockTime & | operator*= (double d) |
| |
| const ClockTime & | operator*= (short d) |
| |
| const ClockTime & | operator*= (int d) |
| |
| const ClockTime & | operator*= (long d) |
| |
| const ClockTime & | operator*= (long long d) |
| |
| const ClockTime & | operator*= (unsigned short d) |
| |
| const ClockTime & | operator*= (unsigned int d) |
| |
| const ClockTime & | operator*= (unsigned long d) |
| |
| const ClockTime & | operator*= (unsigned long long d) |
| |
| const ClockTime & | operator*= (const cPar &p) |
| |
| const ClockTime & | operator/= (double d) |
| |
| const ClockTime & | operator/= (short d) |
| |
| const ClockTime & | operator/= (int d) |
| |
| const ClockTime & | operator/= (long d) |
| |
| const ClockTime & | operator/= (long long d) |
| |
| const ClockTime & | operator/= (unsigned short d) |
| |
| const ClockTime & | operator/= (unsigned int d) |
| |
| const ClockTime & | operator/= (unsigned long d) |
| |
| const ClockTime & | operator/= (unsigned long long d) |
| |
| const ClockTime & | operator/= (const cPar &p) |
| |
| const friend ClockTime | operator+ (const ClockTime &x, const ClockTime &y) |
| |
| const friend ClockTime | operator- (const ClockTime &x, const ClockTime &y) |
| |
| const friend ClockTime | operator* (const ClockTime &x, double d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, short d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, int d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, long d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, long long d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, unsigned short d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, unsigned int d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, unsigned long d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, unsigned long long d) |
| |
| const friend ClockTime | operator* (const ClockTime &x, const cPar &p) |
| |
| const friend ClockTime | operator* (double d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (short d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (int d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (long d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (long long d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (unsigned short d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (unsigned int d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (unsigned long d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (unsigned long long d, const ClockTime &x) |
| |
| const friend ClockTime | operator* (const cPar &p, const ClockTime &x) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, double d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, short d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, int d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, long d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, long long d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, unsigned short d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, unsigned int d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, unsigned long d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, unsigned long long d) |
| |
| const friend ClockTime | operator/ (const ClockTime &x, const cPar &p) |
| |
| double | operator/ (const ClockTime &x, const ClockTime &y) |
| |
| double | operator/ (double x, const ClockTime &y) |
| |
| double | operator/ (short x, const ClockTime &y) |
| |
| double | operator/ (int x, const ClockTime &y) |
| |
| double | operator/ (long x, const ClockTime &y) |
| |
| double | operator/ (long long x, const ClockTime &y) |
| |
| double | operator/ (unsigned short x, const ClockTime &y) |
| |
| double | operator/ (unsigned int x, const ClockTime &y) |
| |
| double | operator/ (unsigned long x, const ClockTime &y) |
| |
| double | operator/ (unsigned long long x, const ClockTime &y) |
| |
| double | operator/ (const cPar &p, const ClockTime &x) |
| |
|
| SimTime | asSimTime () const |
| | Convert to SimTime. More...
|
| |
| bool | isZero () const |
| | Returns true if this simulation time is zero, false otherwise. More...
|
| |
| double | dbl () const |
| | Converts simulation time (in seconds) to a double. More...
|
| |
| int64_t | inUnit (SimTimeUnit unit) const |
| | Converts the simulation time to the given time unit, discarding the fractional part (i.e. More...
|
| |
| ClockTime | trunc (SimTimeUnit unit) const |
| | Returns a new simulation time that is truncated (rounded towards zero) to the precision of the specified time unit. More...
|
| |
| ClockTime | remainderForUnit (SimTimeUnit unit) const |
| | Returns a simtime that is the difference between the simulation time and its truncated value (see trunc()). More...
|
| |
| void | split (SimTimeUnit unit, int64_t &outValue, ClockTime &outRemainder) const |
| | Convenience method: splits the simulation time into a whole and a fractional part with regard to a time unit. More...
|
| |
| std::string | str () const |
| | Converts the time to a numeric string. More...
|
| |
| char * | str (char *buf) const |
| | Converts to a string in the same way as str() does. More...
|
| |
| std::string | ustr () const |
| | Converts the time to a numeric string with unit in the same format as ustr(SimTimeUnit) does, but chooses the time unit automatically. More...
|
| |
| std::string | ustr (SimTimeUnit unit) const |
| | Converts the time to a numeric string in the given time unit. More...
|
| |
| int64_t | raw () const |
| | Returns the underlying 64-bit integer. More...
|
| |
| const ClockTime & | setRaw (int64_t l) |
| | Directly sets the underlying 64-bit integer. More...
|
| |
| static ClockTime | from (SimTime t) |
| | Convert from SimTime. More...
|
| |
| static const ClockTime | getMaxTime () |
| | Returns the largest simulation time that can be represented using the present scale exponent. More...
|
| |
| static int64_t | getScale () |
| | Returns the time resolution as the number of units per second, e.g. More...
|
| |
| static int | getScaleExp () |
| | Returns the scale exponent, which is an integer in the range -18..0. More...
|
| |
| static const ClockTime | parse (const char *s) |
| | Converts the given string to simulation time. More...
|
| |
| static const ClockTime | parse (const char *s, const char *&endp) |
| | Converts a prefix of the given string to simulation time, up to the first character that cannot occur in simulation time strings: not (digit or letter or "." or "+" or "-" or whitespace). More...
|
| |
| static char * | ttoa (char *buf, int64_t impl, int scaleexp, char *&endp) |
| | Utility function to convert a 64-bit fixed point number into a string buffer. More...
|
| |
This class is a proxy for the SimTime class.
The reason behind this design is that the simulation time and the clock time must not be confused. So this class doesn't have implicit conversion operators to and from the simulation time.
| inet::ClockTime::ClockTime |
( |
int64_t |
value, |
|
|
SimTimeUnit |
unit |
|
) |
| |
|
inline |
Initialize simulation time from value specified in the given units.
This constructor allows one to specify precise constants, without conversion errors incurred by the double constructor. An error will be thrown if the resulting value cannot be represented (overflow) or it cannot be represented precisely (precision loss) with the current resolution (i.e. scale exponent). Note that the unit parameter actually represents a base-10 exponent, so the constructor will also work correctly for values not in the SimTimeUnit enum.
Examples: Simtime(15, SIMTIME_US) -> 15us Simtime(-3, SIMTIME_S) -> -1s Simtime(5, (SimTimeUnit)2) -> 500s;
| static char* inet::ClockTime::ttoa |
( |
char * |
buf, |
|
|
int64_t |
impl, |
|
|
int |
scaleexp, |
|
|
char *& |
endp |
|
) |
| |
|
inlinestatic |
Utility function to convert a 64-bit fixed point number into a string buffer.
scaleexp must be in the -18..0 range, and the buffer must be at least 64 bytes long. A pointer to the result string will be returned. A pointer to the terminating '\0' will be returned in endp.
ATTENTION: For performance reasons, the returned pointer will point somewhere into the buffer, but NOT necessarily at the beginning.
337 {
return SimTime::ttoa(buf,
impl, scaleexp, endp); }
Referenced by inet::operator<<().