AERA
|
Static Public Member Functions | |
static Timestamp | GetTimeReference () |
static std::chrono::microseconds | GetBasePeriod () |
static uint32 | GetFloatTolerance () |
static std::chrono::microseconds | GetTimeTolerance () |
static void | SetReferenceValues (std::chrono::microseconds base_period, float32 float_tolerance, std::chrono::microseconds time_tolerance) |
static void | SetTimeReference (Timestamp time_reference) |
static bool | Equal (float32 l, float32 r) |
static bool | Synchronous (Timestamp l, Timestamp r) |
static int64 | GetInt64 (const Atom *code, size_t index) |
static void | SetInt64 (Atom *code, size_t index, int64 value) |
static Timestamp | GetTimestamp (const Atom *iptr) |
static std::chrono::microseconds | GetMicrosecondsSinceEpoch (const Atom *iptr) |
static void | SetTimestamp (Atom *iptr, Timestamp timestamp) |
static void | SetTimestampStruct (Code *object, uint16 index, Timestamp timestamp) |
template<class O > | |
static bool | HasTimestamp (const O *object, uint16 index) |
template<class O > | |
static Timestamp | GetTimestamp (const O *object, uint16 index) |
template<class O > | |
static void | SetTimestamp (O *object, uint16 index, Timestamp timestamp) |
static std::string | ToString_s_ms_us (Timestamp timestamp, Timestamp time_reference) |
static std::chrono::microseconds | GetDuration (const Atom *iptr) |
static void | SetDuration (Atom *iptr, std::chrono::microseconds duration) |
static void | SetDurationStruct (Code *object, uint16 index, std::chrono::microseconds duration) |
template<class O > | |
static std::chrono::microseconds | GetDuration (const O *object, uint16 index) |
template<class O > | |
static void | SetDuration (O *object, uint16 index, std::chrono::microseconds duration) |
static std::string | ToString_us (std::chrono::microseconds duration) |
static std::string | GetString (const Atom *iptr) |
static void | SetString (Atom *iptr, const std::string &s) |
template<class O > | |
static std::string | GetString (const O *object, uint16 index) |
template<class O > | |
static void | SetString (O *object, uint16 index, const std::string &s) |
static int32 | GetResilience (Timestamp now, std::chrono::microseconds time_to_live, uint64 upr) |
static int32 | GetResilience (float32 resilience, float32 origin_upr, float32 destination_upr) |
static std::string | RelativeTime (Timestamp t) |
static bool | has_reference (const Atom *code, uint16 index) |
Static Public Attributes | |
static const uint64 | MaxTHZ = 0xFFFFFFFF |
Definition at line 115 of file r_code/utils.h.
|
inlinestatic |
Interpret iptr[1] and iptr[2] as an signed 64-bit integer and return it as a duration. This assumes that the caller has already checked iptr[0] == Atom::DURATION, if needed.
iptr | A pointer into the Atom array. |
Definition at line 242 of file r_code/utils.h.
|
inlinestatic |
Get the duration pointed to by the I_PTR at index. This assumes that the caller has already checked that the code pointed to is Atom::DURATION, if needed.
object | The object with the Code array. |
index | The index in the Code array of the I_PTR to the duration structure (like SetDuration<Code>() but not the index of the duration structure itself as in SetDurationStruct()). |
Definition at line 274 of file r_code/utils.h.
|
inlinestatic |
Get the signed 64-bit integer at code[index] and code[index + 1].
code | The Atom array. |
index | The index in code of the first uint32 value. |
Definition at line 138 of file r_code/utils.h.
|
static |
Interpret iptr[1] and iptr[2] as an signed 64-bit integer and return it as time stamp. This assumes that the caller has already checked iptr[0] == Atom::TIMESTAMP, if needed.
iptr | A pointer into the Atom array. |
Definition at line 129 of file code_utils.cpp.
|
inlinestatic |
Get the time stamp pointed to by the I_PTR at index.
object | The object with the Code array. |
index | The index in the Code array of the I_PTR to the time stamp structure (like SetTimestamp<Code>() but not the index of the time stamp structure itself as in SetTimestampStruct()). |
Definition at line 204 of file r_code/utils.h.
|
static |
Check the code at index has a reference, also following I_PTR and recursing into sets.
code | The code to check. |
index | start checking at code[index]. |
Definition at line 254 of file code_utils.cpp.
|
inlinestatic |
Set iptr[0] to Atom::Duration() and set iptr[1] and iptr[2] to the signed 64-bit value of the duration.
iptr | A pointer into the Atom array. |
duration | The duration. |
Definition at line 251 of file r_code/utils.h.
|
inlinestatic |
Set the Code array values at index with the structure for the duration.
object | The object with the Code array. |
index | The index in the Code array of the I_PTR to the duration structure (like GetDuration() but not the index of the time stamp structure itself as in SetDurationStruct()). |
duration | The duration to put in the structure at the index. |
Definition at line 287 of file r_code/utils.h.
|
static |
Set the Code array values at index with the structure for the duration.
object | The object with the Code array. This expands object->code to allocate atoms. |
index | The index in the Code array to place the duration structure (not the index of the I_PTR to the structure as in SetDuration<Code>() or GetDuration()). |
duration | The duration to put in the structure at the index. |
Definition at line 168 of file code_utils.cpp.
|
inlinestatic |
Set the uint32 values at code[index] and code[index + 1] to the big-endian of value.
code | The Atom array. You must make sure the array has room up to code[index + 1]. |
index | The index in code for the first uint32 value. |
value | The signed 64-bit integer to set. |
Definition at line 149 of file r_code/utils.h.
|
static |
Set iptr[0] to Atom::Timestamp() and set iptr[1] and iptr[2] to the signed 64-bit value of the time stamp.
iptr | A pointer into the Atom array. |
timestamp | The time stamp. |
Definition at line 134 of file code_utils.cpp.
|
inlinestatic |
Set the Code array values at index with the structure for the timestamp.
object | The object with the Code array. |
index | The index in the Code array of the I_PTR to the time stamp structure (like GetTimestamp() but not the index of the time stamp structure itself as in SetTimestampStruct()). |
timestamp | The time stamp to put in the structure at the index. |
Definition at line 217 of file r_code/utils.h.
|
static |
Set the Code array values at index with the structure for the timestamp.
object | The object with the Code array. |
index | The index in the Code array to place the time stamp structure (not the index of the I_PTR to the structure as in SetTimestamp<Code>() or GetTimestamp()). |
timestamp | The time stamp to put in the structure at the index. |
Definition at line 140 of file code_utils.cpp.
|
static |
Make a string from (timestamp - time_reference) in the form XXXs:YYYms:ZZZus, with a minus sign if it is negative.
timestamp | The time stamp. |
time_reference | The reference time to subtract from timestamp, usually the session start time. We do this because timestamp is seconds since 01/01/1970, so the seconds would be very large. |
Definition at line 148 of file code_utils.cpp.
|
static |
Make a string from duration in the form XXXus, with a minus sign if it is negative. However if the microseconds portion is zero, then use YYYms. Or if the microseconds and milliseconds portions are zero, then use ZZZs. (This is the complement to how the compiler parses durations.)
duration | The duration. |
Definition at line 174 of file code_utils.cpp.