26 this->
set(timeBase, 0, seconds, useconds);
38 this->
set(timeBase, context, seconds, useconds);
42 this->m_val.
set(timeBase, context, seconds, useconds);
47 this->m_val = other.m_val;
70 return ((
GT == c) or (
EQ == c));
75 return ((
LT == c) or (
EQ == c));
103 Time time(timeBase, 0, 0, 0);
121 }
else if (s1 > s2) {
123 }
else if (us1 < us2) {
125 }
else if (us1 > us2) {
140 if (uSeconds >= 1000000) {
156 const Time& subtrahend
159 static_cast<FwAssertArgType>(subtrahend.
getTimeBase()));
179 return Time(minuend.
getTimeBase(), context, seconds,
static_cast<U32
>(uSeconds));
183 U32 newSeconds = this->m_val.
get_seconds() + seconds;
184 U32 newUSeconds = this->m_val.
get_useconds() + useconds;
185 FW_ASSERT(newUSeconds < 1999999, static_cast<FwAssertArgType>(newUSeconds));
186 if (newUSeconds >= 1000000) {
188 newUSeconds -= 1000000;
190 this->
set(newSeconds, newUSeconds);
202 std::ostream& operator<<(std::ostream& os,
const Time& val) {
bool operator<=(const Time &other) const
U32 get_useconds() const
Get member useconds.
FwTimeContextStoreType get_timeContext() const
Get member timeContext.
Time & operator=(const Time &other)
TimeBase getTimeBase() const
No time base has been established (Required)
TimeBase::T get_timeBase() const
Get member timeBase.
U8 FwTimeContextStoreType
The type used to serialize a time context value.
static Time sub(const Time &minuend, const Time &subtrahend)
Comparison
The type of a comparison result.
bool operator==(const Time &other) const
SerializeStatus
forward declaration for string
static Time zero(TimeBase timeBase=TimeBase::TB_NONE)
bool operator!=(const Time &other) const
void set_seconds(U32 seconds)
Set member seconds.
void setTimeContext(FwTimeContextStoreType context)
Fw::SerializeStatus deserializeFrom(Fw::SerializeBufferBase &buffer)
Deserialization.
Fw::SerializeStatus serializeTo(Fw::SerializeBufferBase &buffer) const
Serialization.
void set(U32 seconds, U32 useconds)
bool operator>(const Time &other) const
bool operator>=(const Time &other) const
void set(TimeBase::T timeBase, FwTimeContextStoreType timeContext, U32 seconds, U32 useconds)
Set all members.
void setTimeBase(TimeBase timeBase)
void set_timeBase(TimeBase::T timeBase)
Set member timeBase.
void set_timeContext(FwTimeContextStoreType timeContext)
Set member timeContext.
static Time add(const Time &a, const Time &b)
FwTimeContextStoreType getContext() const
SerializeStatus deserializeFrom(SerializeBufferBase &buffer) override
deserialize contents from buffer
SerializeStatus serializeTo(SerializeBufferBase &buffer) const override
serialize contents to buffer
static Comparison compare(const Time &time1, const Time &time2)
U32 get_seconds() const
Get member seconds.
bool operator<(const Time &other) const
Define enumeration for Time base types.
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
void set_useconds(U32 useconds)
Set member useconds.