14 this->
set(other.m_timeBase,other.m_timeContext,other.m_seconds,other.m_useconds);
22 this->
set(timeBase,0,seconds,useconds);
26 this->
set(this->m_timeBase,this->m_timeContext,seconds,useconds);
30 this->
set(timeBase,this->m_timeContext,seconds,useconds);
34 this->
set(timeBase,context,seconds,useconds);
38 this->m_timeBase = timeBase;
39 this->m_timeContext = context;
40 this->m_useconds = useconds;
41 this->m_seconds = seconds;
45 this->m_timeBase = other.m_timeBase;
46 this->m_timeContext = other.m_timeContext;
47 this->m_useconds = other.m_useconds;
48 this->m_seconds = other.m_seconds;
71 return ((
GT == c) or (
EQ == c));
76 return ((
LT == c) or (
EQ == c));
89 #if FW_USE_TIME_CONTEXT
90 stat = buffer.
serialize(this->m_timeContext);
101 return buffer.
serialize(this->m_useconds);
115 this->m_timeBase =
static_cast<TimeBase>(deSer);
119 #if FW_USE_TIME_CONTEXT
125 this->m_timeContext = 0;
136 return this->m_seconds;
140 return this->m_useconds;
144 return this->m_timeBase;
148 return this->m_timeContext;
154 Time time(timeBase,0, 0, 0);
169 #if FW_USE_TIME_CONTEXT
181 }
else if (s1 > s2) {
183 }
else if (us1 < us2) {
185 }
else if (us1 > us2) {
201 #if FW_USE_TIME_CONTEXT
207 if (uSeconds >= 1000000) {
218 const Time& subtrahend
224 #if FW_USE_TIME_CONTEXT
242 this->m_seconds += seconds;
243 this->m_useconds += useconds;
245 if (this->m_useconds >= 1000000) {
247 this->m_useconds -= 1000000;
252 this->m_timeBase = timeBase;
256 this->m_timeContext = context;
260 std::ostream& operator<<(std::ostream& os,
const Time& val) {
@ TB_NONE
No time base has been established.
PlatformAssertArgType FwAssertArgType
U8 FwTimeContextStoreType
C++-compatible configuration header for fprime configuration.
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
bool operator<(const Time &other) const
static Time add(const Time &a, const Time &b)
SerializeStatus deserialize(SerializeBufferBase &buffer)
deserialize to contents
FwTimeContextStoreType getContext() const
void set(U32 seconds, U32 useconds)
Time & operator=(const Time &other)
bool operator>=(const Time &other) const
bool operator!=(const Time &other) const
void setTimeContext(FwTimeContextStoreType context)
TimeBase getTimeBase() const
Comparison
The type of a comparison result.
bool operator<=(const Time &other) const
bool operator>(const Time &other) const
static Time sub(const Time &minuend, const Time &subtrahend)
void setTimeBase(TimeBase timeBase)
bool operator==(const Time &other) const
static Time zero(TimeBase timeBase=TB_NONE)
SerializeStatus serialize(SerializeBufferBase &buffer) const
serialize contents
static Comparison compare(const Time &time1, const Time &time2)
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.