![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
Os::RawTime wrapper around the implementation T selected at compile time.
More...
#include <Os/RawTime.hpp>
Public Member Functions | |
| RawTimeCommon ()=default | |
| Default constructor. More... | |
| RawTimeCommon (RawTimeSource source) | |
| Constructor with timer source selection. More... | |
| ~RawTimeCommon ()=default | |
| Destructor. More... | |
| RawTimeCommon (const RawTimeCommon &other)=default | |
| copy constructor that copies the internal representation More... | |
| RawTimeCommon & | operator= (const RawTimeCommon &other)=default |
| assignment operator that copies the internal representation More... | |
| RawTimeHandle * | getHandle () |
| return the underlying RawTime handle (implementation specific) More... | |
| Status | now () |
| Get the current time. More... | |
| Status | getTimeInterval (const RawTimeCommon &other, Fw::TimeInterval &interval) const |
| Calculate the time interval between this and another raw time. More... | |
| Fw::SerializeStatus | serializeTo (Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) const override |
| Serialize the contents of the RawTime object into a buffer. More... | |
| Fw::SerializeStatus | deserializeFrom (Fw::SerialBufferBase &buffer, Fw::Endianness mode=Fw::Endianness::BIG) override |
| Deserialize the contents of the RawTime object from a buffer. More... | |
| Status | getDiffUsec (const RawTimeCommon &other, U32 &result) const |
| Calculate the difference in microseconds between two RawTime objects. More... | |
| bool | operator== (const RawTimeCommon &other) const |
| Compare whether two RawTime objects are the same (i.e. refer to the same microsecond) More... | |
| RawTimeSource | getSource () const |
| Get the timer source used by this RawTime instance. More... | |
Public Member Functions inherited from Fw::Serializable | |
| DEPRECATED (SerializeStatus serialize(SerialBufferBase &buffer) const, "Use serializeTo(SerialBufferBase& buffer) instead") | |
| DEPRECATED (SerializeStatus deserialize(SerialBufferBase &buffer), "Use deserializeFrom(SerialBufferBase& buffer) instead") | |
Static Public Attributes | |
| static const FwSizeType | SERIALIZED_SIZE |
Static Public Attributes inherited from Os::RawTimeUserInterface | |
| static const FwSizeType | SERIALIZED_SIZE = FW_RAW_TIME_SERIALIZATION_MAX_SIZE |
Additional Inherited Members | |
Public Types inherited from Os::RawTimeUserInterface | |
| enum | Status { OP_OK, OP_OVERFLOW, INVALID_PARAMS, NOT_SUPPORTED, OTHER_ERROR } |
Public Types inherited from Fw::Serializable | |
| using | SizeType = FwSizeType |
Protected Member Functions inherited from Fw::Serializable | |
| Serializable () | |
| Default constructor. More... | |
| virtual | ~Serializable () |
| Virtual destructor. More... | |
Os::RawTime wrapper around the implementation T selected at compile time.
Holds the implementation by value and forwards every operation to it. Os::RawTime is this class instantiated on the implementation selected in config/RawTimeSelection.hpp. T must be copyable and constructible from a RawTimeSource.
Definition at line 23 of file RawTime.hpp.
|
default |
Default constructor.
|
explicit |
Constructor with timer source selection.
| source | Timer source to use |
Definition at line 128 of file RawTime.hpp.
|
default |
Destructor.
|
default |
copy constructor that copies the internal representation
|
overridevirtual |
Deserialize the contents of the RawTime object from a buffer.
| buffer | The buffer to deserialize the contents from. |
| mode | Endianness to use when deserializing from the buffer. |
Implements Fw::Serializable.
Definition at line 152 of file RawTime.hpp.
| RawTimeCommon< T >::Status Os::RawTimeCommon< T >::getDiffUsec | ( | const RawTimeCommon< T > & | other, |
| U32 & | result | ||
| ) | const |
Calculate the difference in microseconds between two RawTime objects.
| other | The other RawTime object to compare against. |
| result | A reference to a U32 variable where the result will be stored. |
Definition at line 157 of file RawTime.hpp.
| RawTimeHandle * Os::RawTimeCommon< T >::getHandle | ( | ) |
return the underlying RawTime handle (implementation specific)
Definition at line 131 of file RawTime.hpp.
| RawTimeSource Os::RawTimeCommon< T >::getSource | ( | ) | const |
Get the timer source used by this RawTime instance.
Definition at line 169 of file RawTime.hpp.
| RawTimeCommon< T >::Status Os::RawTimeCommon< T >::getTimeInterval | ( | const RawTimeCommon< T > & | other, |
| Fw::TimeInterval & | interval | ||
| ) | const |
Calculate the time interval between this and another raw time.
This function calculates the time interval between the current raw time and another specified raw time. The result is stored in the provided (output) interval object.
| other | The other RawTime to compare against. |
| interval | Output parameter to store the calculated time interval. |
Definition at line 141 of file RawTime.hpp.
| RawTimeCommon< T >::Status Os::RawTimeCommon< T >::now | ( | ) |
Get the current time.
This function retrieves the current time and stores it in the RawTime object.
Definition at line 136 of file RawTime.hpp.
|
default |
assignment operator that copies the internal representation
| bool Os::RawTimeCommon< T >::operator== | ( | const RawTimeCommon< T > & | other | ) | const |
Compare whether two RawTime objects are the same (i.e. refer to the same microsecond)
Definition at line 162 of file RawTime.hpp.
|
overridevirtual |
Serialize the contents of the RawTime object into a buffer.
FW_RAW_TIME_SERIALIZATION_MAX_SIZE bytes. This value is defined in FpConfig.h. For example, Posix systems use a pair of U32 (sec, nanosec) and can therefore serialize in 8 bytes. Should an OSAL implementation require more than this, the project must increase that value in its config/ folder.| buffer | The buffer to serialize the contents into. |
| mode | Endianness to use when serializing to buffer. |
Implements Fw::Serializable.
Definition at line 147 of file RawTime.hpp.
|
static |
Definition at line 24 of file RawTimeUserInterface.hpp.