F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Os::RawTimeInterface Class Referenceabstract

#include <Os/RawTime.hpp>

Inheritance diagram for Os::RawTimeInterface:
Fw::Serializable Os::Posix::RawTime::PosixRawTime Os::RawTime Os::Stub::RawTime::StubRawTime

Public Types

enum  Status { OP_OK , OP_OVERFLOW , INVALID_PARAMS , OTHER_ERROR }
 
- Public Types inherited from Fw::Serializable
using SizeType = NATIVE_UINT_TYPE
 

Public Member Functions

 RawTimeInterface ()=default
 default constructor More...
 
virtual ~RawTimeInterface ()=default
 default virtual destructor More...
 
virtual RawTimeHandlegetHandle ()=0
 return the underlying RawTime handle (implementation specific) More...
 
virtual Status now ()=0
 Get the current time. More...
 
virtual Status getTimeInterval (const Os::RawTime &other, Fw::TimeInterval &interval) const =0
 Calculate the time interval between this and another raw time. More...
 
virtual Fw::SerializeStatus serialize (Fw::SerializeBufferBase &buffer) const =0
 Serialize the contents of the RawTimeInterface object into a buffer. More...
 
virtual Fw::SerializeStatus deserialize (Fw::SerializeBufferBase &buffer)=0
 Deserialize the contents of the RawTimeInterface object from a buffer. More...
 

Static Public Member Functions

static RawTimeInterfacegetDelegate (RawTimeHandleStorage &aligned_new_memory, const RawTimeInterface *to_copy=nullptr)
 provide a pointer to a RawTime delegate object More...
 

Static Public Attributes

static const FwSizeType SERIALIZED_SIZE = FW_RAW_TIME_SERIALIZATION_MAX_SIZE
 

Additional Inherited Members

- Protected Member Functions inherited from Fw::Serializable
 Serializable ()
 Default constructor. More...
 
virtual ~Serializable ()
 destructor More...
 

Detailed Description

Definition at line 20 of file RawTime.hpp.

Member Enumeration Documentation

◆ Status

Enumerator
OP_OK 

Operation was successful.

OP_OVERFLOW 

Operation result caused an overflow.

INVALID_PARAMS 

Parameters invalid for current platform.

OTHER_ERROR 

All other errors.

Definition at line 27 of file RawTime.hpp.

Constructor & Destructor Documentation

◆ RawTimeInterface()

Os::RawTimeInterface::RawTimeInterface ( )
default

default constructor

◆ ~RawTimeInterface()

virtual Os::RawTimeInterface::~RawTimeInterface ( )
virtualdefault

default virtual destructor

Member Function Documentation

◆ deserialize()

virtual Fw::SerializeStatus Os::RawTimeInterface::deserialize ( Fw::SerializeBufferBase buffer)
pure virtual

Deserialize the contents of the RawTimeInterface object from a buffer.

This function deserializes the contents of the RawTimeInterface object from the provided buffer.

Note
The serialization must fit within 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.
Parameters
bufferThe buffer to deserialize the contents from.
Returns
Fw::SerializeStatus indicating the result of the deserialization.

Implements Fw::Serializable.

Implemented in Os::Stub::RawTime::StubRawTime, Os::RawTime, and Os::Posix::RawTime::PosixRawTime.

◆ getDelegate()

RawTimeInterface * Os::RawTimeInterface::getDelegate ( RawTimeHandleStorage aligned_placement_new_memory,
const RawTimeInterface to_copy = nullptr 
)
static

provide a pointer to a RawTime delegate object

get a delegate for RawTimeInterface that intercepts calls for stub RawTime usage

get a delegate for RawTimeInterface that intercepts calls for Posix

Parameters
aligned_new_memoryaligned memory to fill
to_copypointer to copy-constructor input
Returns
: pointer to delegate

Definition at line 14 of file DefaultRawTime.cpp.

◆ getHandle()

virtual RawTimeHandle* Os::RawTimeInterface::getHandle ( )
pure virtual

return the underlying RawTime handle (implementation specific)

Returns
internal RawTime handle representation

Implemented in Os::Stub::RawTime::StubRawTime, Os::RawTime, and Os::Posix::RawTime::PosixRawTime.

◆ getTimeInterval()

virtual Status Os::RawTimeInterface::getTimeInterval ( const Os::RawTime other,
Fw::TimeInterval interval 
) const
pure virtual

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.

Parameters
otherThe other RawTimeHandle to compare against.
intervalOutput parameter to store the calculated time interval.
Returns
Status indicating the result of the operation.

Implemented in Os::Stub::RawTime::StubRawTime, Os::RawTime, and Os::Posix::RawTime::PosixRawTime.

◆ now()

virtual Status Os::RawTimeInterface::now ( )
pure virtual

Get the current time.

This function retrieves the current time and stores it in the RawTime object. Each implementation should define its RawTimeHandle type for storing the time.

Returns
Status indicating the result of the operation.

Implemented in Os::Stub::RawTime::StubRawTime, Os::RawTime, and Os::Posix::RawTime::PosixRawTime.

◆ serialize()

virtual Fw::SerializeStatus Os::RawTimeInterface::serialize ( Fw::SerializeBufferBase buffer) const
pure virtual

Serialize the contents of the RawTimeInterface object into a buffer.

This function serializes the contents of the RawTimeInterface object into the provided buffer.

Note
The serialization must fit within 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.
Parameters
bufferThe buffer to serialize the contents into.
Returns
Fw::SerializeStatus indicating the result of the serialization.

Implements Fw::Serializable.

Implemented in Os::Stub::RawTime::StubRawTime, Os::RawTime, and Os::Posix::RawTime::PosixRawTime.

Member Data Documentation

◆ SERIALIZED_SIZE

const FwSizeType Os::RawTimeInterface::SERIALIZED_SIZE = FW_RAW_TIME_SERIALIZATION_MAX_SIZE
static

Definition at line 25 of file RawTime.hpp.


The documentation for this class was generated from the following files: