11 FW_ASSERT(&this->m_delegate == reinterpret_cast<RawTimeInterface*>(&this->m_handle_storage[0]));
15 FW_ASSERT(&this->m_delegate == reinterpret_cast<RawTimeInterface*>(&this->m_handle_storage[0]));
20 : m_handle_storage(), m_delegate(*
RawTimeInterface::getDelegate(m_handle_storage, &other.m_delegate)) {
21 FW_ASSERT(&this->m_delegate == reinterpret_cast<RawTimeInterface*>(&this->m_handle_storage[0]));
32 FW_ASSERT(&this->m_delegate == reinterpret_cast<RawTimeInterface*>(&this->m_handle_storage[0]));
37 FW_ASSERT(&this->m_delegate == reinterpret_cast<RawTimeInterface*>(&this->m_handle_storage[0]));
38 return this->m_delegate.
now();
42 FW_ASSERT(&this->m_delegate == reinterpret_cast<const RawTimeInterface*>(&this->m_handle_storage[0]));
47 FW_ASSERT(&this->m_delegate == reinterpret_cast<const RawTimeInterface*>(&this->m_handle_storage[0]));
48 return this->m_delegate.
serialize(buffer);
52 FW_ASSERT(&this->m_delegate == reinterpret_cast<const RawTimeInterface*>(&this->m_handle_storage[0]));
66 if (seconds > (std::numeric_limits<U32>::max() / 1000000)) {
67 result = std::numeric_limits<U32>::max();
68 return Status::OP_OVERFLOW;
70 U32 secToUsec = seconds * 1000000;
71 if (secToUsec > (std::numeric_limits<U32>::max() - useconds)) {
72 result = std::numeric_limits<U32>::max();
73 return Status::OP_OVERFLOW;
76 result = secToUsec + useconds;
virtual Status now()=0
Get the current time.
Status now() override
Get the current time.
static RawTimeInterface * getDelegate(RawTimeHandleStorage &aligned_new_memory, const RawTimeInterface *to_copy=nullptr)
provide a pointer to a RawTime delegate object
virtual ~RawTimeInterface()=default
default virtual destructor
virtual Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const =0
Serialize the contents of the RawTimeInterface object into a buffer.
SerializeStatus
forward declaration for string
virtual Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)=0
Deserialize the contents of the RawTimeInterface object from a buffer.
RawTimeHandle * getHandle() override
return the underlying RawTime handle (implementation specific)
virtual RawTimeHandle * getHandle()=0
return the underlying RawTime handle (implementation specific)
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer) override
Deserialize the contents of the RawTimeInterface object from a buffer.
~RawTime() final
Destructor.
RawTime & operator=(const RawTime &other)
assignment operator that copies the internal representation
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const override
Serialize the contents of the RawTimeInterface object into a buffer.
Status getTimeInterval(const Os::RawTime &other, Fw::TimeInterval &interval) const override
Calculate the time interval between this and another raw time.
virtual Status getTimeInterval(const Os::RawTime &other, Fw::TimeInterval &interval) const =0
Calculate the time interval between this and another raw time.
Status getDiffUsec(const RawTime &other, U32 &result) const
Calculate the difference in microseconds between two RawTime objects.