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

#include <Fw/Time/Time.hpp>

Inheritance diagram for Fw::Time:
Fw::Serializable

Public Types

enum  { SERIALIZED_SIZE }
 
enum  Comparison { LT = -1 , EQ = 0 , GT = 1 , INCOMPARABLE = 2 }
 The type of a comparison result. More...
 
- Public Types inherited from Fw::Serializable
using SizeType = NATIVE_UINT_TYPE
 

Public Member Functions

 Time ()
 
 Time (const Time &other)
 
 Time (U32 seconds, U32 useconds)
 
 Time (TimeBase timeBase, U32 seconds, U32 useconds)
 
 Time (TimeBase timeBase, FwTimeContextStoreType context, U32 seconds, U32 useconds)
 
virtual ~Time ()
 
void set (U32 seconds, U32 useconds)
 
void set (TimeBase timeBase, U32 seconds, U32 useconds)
 
void set (TimeBase timeBase, FwTimeContextStoreType context, U32 seconds, U32 useconds)
 
void setTimeBase (TimeBase timeBase)
 
void setTimeContext (FwTimeContextStoreType context)
 
U32 getSeconds () const
 
U32 getUSeconds () const
 
TimeBase getTimeBase () const
 
FwTimeContextStoreType getContext () const
 
SerializeStatus serialize (SerializeBufferBase &buffer) const
 serialize contents More...
 
SerializeStatus deserialize (SerializeBufferBase &buffer)
 deserialize to contents More...
 
bool operator== (const Time &other) const
 
bool operator!= (const Time &other) const
 
bool operator> (const Time &other) const
 
bool operator< (const Time &other) const
 
bool operator>= (const Time &other) const
 
bool operator<= (const Time &other) const
 
Timeoperator= (const Time &other)
 
void add (U32 seconds, U32 mseconds)
 

Static Public Member Functions

static Time zero (TimeBase timeBase=TB_NONE)
 
static Comparison compare (const Time &time1, const Time &time2)
 
static Time add (const Time &a, const Time &b)
 
static Time sub (const Time &minuend, const Time &subtrahend)
 

Additional Inherited Members

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

Detailed Description

Definition at line 9 of file Time.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SERIALIZED_SIZE 

Definition at line 12 of file Time.hpp.

◆ Comparison

The type of a comparison result.

Enumerator
LT 
EQ 
GT 
INCOMPARABLE 

Definition at line 45 of file Time.hpp.

Constructor & Destructor Documentation

◆ Time() [1/5]

Fw::Time::Time ( )

Definition at line 7 of file Time.cpp.

◆ Time() [2/5]

Fw::Time::Time ( const Time other)

Definition at line 13 of file Time.cpp.

◆ Time() [3/5]

Fw::Time::Time ( U32  seconds,
U32  useconds 
)

Definition at line 17 of file Time.cpp.

◆ Time() [4/5]

Fw::Time::Time ( TimeBase  timeBase,
U32  seconds,
U32  useconds 
)

Definition at line 21 of file Time.cpp.

◆ Time() [5/5]

Fw::Time::Time ( TimeBase  timeBase,
FwTimeContextStoreType  context,
U32  seconds,
U32  useconds 
)

Definition at line 33 of file Time.cpp.

◆ ~Time()

Fw::Time::~Time ( )
virtual

Definition at line 10 of file Time.cpp.

Member Function Documentation

◆ add() [1/2]

Time Fw::Time::add ( const Time a,
const Time b 
)
static

Add two times

Returns
The result
Parameters
aTime a
bTime b

Definition at line 192 of file Time.cpp.

◆ add() [2/2]

void Fw::Time::add ( U32  seconds,
U32  mseconds 
)

Definition at line 241 of file Time.cpp.

◆ compare()

Time::Comparison Fw::Time::compare ( const Time time1,
const Time time2 
)
static

Compare two times

Returns
The result
Parameters
time1Time 1
time2Time 2

Definition at line 158 of file Time.cpp.

◆ deserialize()

SerializeStatus Fw::Time::deserialize ( SerializeBufferBase buffer)
virtual

deserialize to contents

Implements Fw::Serializable.

Definition at line 104 of file Time.cpp.

◆ getContext()

FwTimeContextStoreType Fw::Time::getContext ( ) const

Definition at line 147 of file Time.cpp.

◆ getSeconds()

U32 Fw::Time::getSeconds ( ) const

Definition at line 135 of file Time.cpp.

◆ getTimeBase()

TimeBase Fw::Time::getTimeBase ( ) const

Definition at line 143 of file Time.cpp.

◆ getUSeconds()

U32 Fw::Time::getUSeconds ( ) const

Definition at line 139 of file Time.cpp.

◆ operator!=()

bool Fw::Time::operator!= ( const Time other) const

Definition at line 57 of file Time.cpp.

◆ operator<()

bool Fw::Time::operator< ( const Time other) const

Definition at line 65 of file Time.cpp.

◆ operator<=()

bool Fw::Time::operator<= ( const Time other) const

Definition at line 74 of file Time.cpp.

◆ operator=()

Time & Fw::Time::operator= ( const Time other)

Definition at line 44 of file Time.cpp.

◆ operator==()

bool Fw::Time::operator== ( const Time other) const

Definition at line 53 of file Time.cpp.

◆ operator>()

bool Fw::Time::operator> ( const Time other) const

Definition at line 61 of file Time.cpp.

◆ operator>=()

bool Fw::Time::operator>= ( const Time other) const

Definition at line 69 of file Time.cpp.

◆ serialize()

SerializeStatus Fw::Time::serialize ( SerializeBufferBase buffer) const
virtual

serialize contents

Implements Fw::Serializable.

Definition at line 79 of file Time.cpp.

◆ set() [1/3]

void Fw::Time::set ( TimeBase  timeBase,
FwTimeContextStoreType  context,
U32  seconds,
U32  useconds 
)

Definition at line 37 of file Time.cpp.

◆ set() [2/3]

void Fw::Time::set ( TimeBase  timeBase,
U32  seconds,
U32  useconds 
)

Definition at line 29 of file Time.cpp.

◆ set() [3/3]

void Fw::Time::set ( U32  seconds,
U32  useconds 
)

Definition at line 25 of file Time.cpp.

◆ setTimeBase()

void Fw::Time::setTimeBase ( TimeBase  timeBase)

Definition at line 251 of file Time.cpp.

◆ setTimeContext()

void Fw::Time::setTimeContext ( FwTimeContextStoreType  context)

Definition at line 255 of file Time.cpp.

◆ sub()

Time Fw::Time::sub ( const Time minuend,
const Time subtrahend 
)
static

Subtract subtrahend from minuend

Returns
The result
Parameters
minuendValue being subtracted from
subtrahendValue being subtracted

Definition at line 215 of file Time.cpp.

◆ zero()

Time Fw::Time::zero ( TimeBase  timeBase = TB_NONE)
static
Returns
time zero

Definition at line 151 of file Time.cpp.


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