6 this->m_val = other.m_val;
10 this->
set(seconds, useconds);
15 TimeInterval(start.getSeconds(), start.getUSeconds()))) {}
19 FW_ASSERT(useconds < 1000000, static_cast<FwAssertArgType>(useconds));
20 this->m_val.
set(seconds, useconds);
25 this->m_val = other.m_val;
48 return ((
GT == c) or (
EQ == c));
53 return ((
LT == c) or (
EQ == c));
84 }
else if (us1 < us2) {
86 }
else if (us1 > us2) {
97 if (uSeconds >= 1000000) {
119 return TimeInterval(seconds, static_cast<U32>(uSeconds));
123 U32 newSeconds = this->m_val.
get_seconds() + seconds;
124 U32 newUSeconds = this->m_val.
get_useconds() + useconds;
125 FW_ASSERT(newUSeconds < 1999999, static_cast<FwAssertArgType>(newUSeconds));
126 if (newUSeconds >= 1000000) {
128 newUSeconds -= 1000000;
131 FW_ASSERT(newUSeconds < 1000000, static_cast<FwAssertArgType>(newUSeconds));
132 this->m_val.
set(newSeconds, newUSeconds);
136 std::ostream& operator<<(std::ostream& os,
const TimeInterval& val) {
SerializeStatus serializeTo(SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const override
Serialize the contents of this object to a buffer.
bool operator>=(const TimeInterval &other) const
bool operator<(const TimeInterval &other) const
static Comparison compare(const TimeInterval &time1, const TimeInterval &time2)
bool operator!=(const TimeInterval &other) const
TimeInterval & operator=(const TimeInterval &other)
void set(U32 seconds, U32 useconds)
SerializeStatus
forward declaration for string
U32 get_seconds() const
Get member seconds.
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG)
Deserialization.
static TimeInterval sub(const TimeInterval &t1, const TimeInterval &t2)
bool operator<=(const TimeInterval &other) const
void add(U32 seconds, U32 mseconds)
bool operator>(const TimeInterval &other) const
SerializeStatus deserializeFrom(SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) override
Deserialize the contents of this object from a buffer.
bool operator==(const TimeInterval &other) const
void set(U32 seconds, U32 useconds)
Set all members.
Comparison
The type of a comparison result.
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const
Serialization.
U32 get_useconds() const
Get member useconds.
Implementation of malloc based allocator.