20 : m_handle_storage(), m_delegate(*
RawTimeInterface::getDelegate(m_handle_storage, &other.m_delegate)) {
38 return this->m_delegate.
now();
48 return this->m_delegate.
serialize(buffer);
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;
RawTimeHandle * getHandle() override
return the underlying RawTime handle (implementation specific)
~RawTime() final
Destructor.
Status getDiffUsec(const RawTime &other, U32 &result) const
Calculate the difference in microseconds between two RawTime objects.
Status now() override
Get the current time.
Status getTimeInterval(const Os::RawTime &other, Fw::TimeInterval &interval) const override
Calculate the time interval between this and another raw time.
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.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer) override
Deserialize the contents of the RawTimeInterface object from a buffer.
virtual ~RawTimeInterface()=default
default virtual destructor
virtual Status getTimeInterval(const Os::RawTime &other, Fw::TimeInterval &interval) const =0
Calculate the time interval between this and another raw time.
virtual RawTimeHandle * getHandle()=0
return the underlying RawTime handle (implementation specific)
virtual Status now()=0
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 Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const =0
Serialize the contents of the RawTimeInterface object into a buffer.
virtual Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)=0
Deserialize the contents of the RawTimeInterface object from a buffer.
SerializeStatus
forward declaration for string
@ OP_OK
Operation succeeded.