F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
RawTime.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Posix/RawTime.hpp
3 // \brief Posix definitions for Os::RawTime
4 // ======================================================================
5 #ifndef OS_POSIX_RAWTIME_HPP
6 #define OS_POSIX_RAWTIME_HPP
7 
8 #include <Os/RawTime.hpp>
9 #include <ctime>
10 
11 namespace Os {
12 namespace Posix {
13 namespace RawTime {
14 
16  timespec m_timespec = {0, 0};
17 };
18 
24  public:
26  PosixRawTime() = default;
27 
29  ~PosixRawTime() override = default;
30 
33  RawTimeHandle* getHandle() override;
34 
35  // ------------------------------------------------------------
36  // Implementation-specific RawTime overrides
37  // ------------------------------------------------------------
44  Status now() override;
45 
54  Status getTimeInterval(const Os::RawTime& other, Fw::TimeInterval& interval) const override;
55 
70  Fw::Endianness mode = Fw::Endianness::BIG) const override;
71 
86  Fw::Endianness mode = Fw::Endianness::BIG) override;
87 
88  private:
90  PosixRawTimeHandle m_handle;
91 };
92 
93 } // namespace RawTime
94 } // namespace Posix
95 } // namespace Os
96 #endif // OS_POSIX_RAWTIME_HPP
PosixRawTime()=default
constructor
Status getTimeInterval(const Os::RawTime &other, Fw::TimeInterval &interval) const override
Calculate the time interval between this and another raw time.
Definition: RawTime.cpp:23
SerializeStatus
forward declaration for string
Fw::SerializeStatus deserializeFrom(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) override
Deserialize the contents of the RawTimeInterface object from a buffer.
Definition: RawTime.cpp:57
~PosixRawTime() override=default
destructor
Status now() override
Get the current time.
Definition: RawTime.cpp:15
Fw::SerializeStatus serializeTo(Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const override
Serialize the contents of the RawTimeInterface object into a buffer.
Definition: RawTime.cpp:47
RawTimeHandle * getHandle() override
return the underlying RawTime handle (implementation specific)
Definition: RawTime.cpp:74
Posix implementation of Os::RawTime.
Definition: RawTime.hpp:23
Endianness
Big endian serialization.