ITS
LifeTime Class Reference

#include <LifeTime.h>

Public Types

enum  e_helper { helper_size = 1 }
 The e_helper enum is used to help to have sizes. More...
 
enum  e_base { base_50_ms = 0, base_1_s = 1, base_10_s = 2, base_100_s = 3 }
 The e_base enum is the base encoding. More...
 

Public Member Functions

 LifeTime ()
 LifeTime LifeTime constructor. More...
 
 LifeTime (quint8 multiplier, enum e_base base)
 LifeTime LifeTime initialization constructor. More...
 
 LifeTime (quint8 multiplierBase)
 LifeTime LifeTime initialization constructor. More...
 
 LifeTime (quint64 lifeTime)
 LifeTime LifeTime initialization constructor. More...
 
 LifeTime (const LifeTime &other)
 LifeTime LifeTime copy constructor. More...
 
 LifeTime (sniff_lifeTime_s lt)
 LifeTime LifeTime copy constructor. More...
 
quint8 multiplier () const
 multiplier Multiplier getter. More...
 
quint8 base () const
 base Base getter. More...
 
int baseUnit () const
 baseUnit Get the base unit in millisecond. More...
 
quint8 multiplierBase () const
 multiplierBase Multiplier + base getter. More...
 
quint32 lifeTime () const
 lifeTime Life time value computation. More...
 
void setMultiplier (quint8 m)
 setMultiplier Multiplier setter. More...
 
void setBase (enum e_base b)
 setBase Base setter. More...
 
void setMultiplierBase (quint8 m)
 setMultiplierBase Multiplier + base setter. More...
 
void setMultiplierBase (quint32 lifeTime)
 setMultiplierBase Multiplier + base setter from life time value. More...
 
QByteArray toHex ()
 toHex Encode the LifeTime in byte array. More...
 

Private Attributes

quint8 m_multiplier_base
 

Detailed Description

Definition at line 21 of file LifeTime.h.

Member Enumeration Documentation

◆ e_base

The e_base enum is the base encoding.

Enumerator
base_50_ms 

The base is 50 ms.

base_1_s 

The base is 1 s.

base_10_s 

The base is 10 s.

base_100_s 

The base is 100 s.

Definition at line 36 of file LifeTime.h.

◆ e_helper

The e_helper enum is used to help to have sizes.

Enumerator
helper_size 

Size of the LifeTime in bytes.

Definition at line 28 of file LifeTime.h.

Constructor & Destructor Documentation

◆ LifeTime() [1/6]

LifeTime::LifeTime ( )

LifeTime LifeTime constructor.

Definition at line 5 of file LifeTime.cpp.

References base_50_ms, and m_multiplier_base.

◆ LifeTime() [2/6]

LifeTime::LifeTime ( quint8  multiplier,
enum e_base  base 
)

LifeTime LifeTime initialization constructor.

Parameters
multiplierThe multiplier.
baseThe base

Definition at line 10 of file LifeTime.cpp.

References base(), m_multiplier_base, and multiplier().

Here is the call graph for this function:

◆ LifeTime() [3/6]

LifeTime::LifeTime ( quint8  multiplierBase)

LifeTime LifeTime initialization constructor.

Parameters
multiplierBaseThe multiplier + thebase.

Definition at line 15 of file LifeTime.cpp.

References m_multiplier_base, and multiplierBase().

Here is the call graph for this function:

◆ LifeTime() [4/6]

LifeTime::LifeTime ( quint64  lifeTime)

LifeTime LifeTime initialization constructor.

Parameters
lifeTimeThe life time value.

Definition at line 20 of file LifeTime.cpp.

References base(), base_100_s, base_10_s, base_1_s, base_50_ms, itsGnDefaultPacketLifeTime, lifeTime(), m_multiplier_base, and multiplier().

Here is the call graph for this function:

◆ LifeTime() [5/6]

LifeTime::LifeTime ( const LifeTime other)

LifeTime LifeTime copy constructor.

Parameters
otherThe LifeTime to copy.

Definition at line 52 of file LifeTime.cpp.

References m_multiplier_base.

◆ LifeTime() [6/6]

LifeTime::LifeTime ( sniff_lifeTime_s  lt)

LifeTime LifeTime copy constructor.

Parameters
ltThe LifeTime to copy in C style.

Definition at line 57 of file LifeTime.cpp.

References m_multiplier_base, and sniff_lifeTime_s::multiplier_base.

Member Function Documentation

◆ base()

quint8 LifeTime::base ( ) const
inline

base Base getter.

Returns
The base.

Definition at line 86 of file LifeTime.h.

References m_multiplier_base.

Referenced by baseUnit(), LifeTime(), lifeTime(), and setMultiplierBase().

Here is the caller graph for this function:

◆ baseUnit()

int LifeTime::baseUnit ( ) const
inline

baseUnit Get the base unit in millisecond.

Returns
The base unit.

Definition at line 91 of file LifeTime.h.

References base(), base_100_s, base_10_s, base_1_s, base_50_ms, and itsGnDefaultPacketLifeTime.

Here is the call graph for this function:

◆ lifeTime()

quint32 LifeTime::lifeTime ( ) const
inline

lifeTime Life time value computation.

Returns
The life time value.

Definition at line 120 of file LifeTime.h.

References base(), base_100_s, base_10_s, base_1_s, base_50_ms, itsGnDefaultPacketLifeTime, itsGnMaxPacketLifetime, and multiplier().

Referenced by GeoNet::checkUCFPB(), HistoryPacketEntry::execute(), CBFPacketEntry::execute(), GeoNet::flushLSPB(), UnicastForwardingPacketEntry::isTimeout(), PacketBuffersEntry::isTimeout(), LifeTime(), CBFPacketEntry::sendPacket(), and setMultiplierBase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ multiplier()

quint8 LifeTime::multiplier ( ) const
inline

multiplier Multiplier getter.

Returns
The multiplier.

Definition at line 81 of file LifeTime.h.

References m_multiplier_base.

Referenced by LifeTime(), lifeTime(), and setMultiplierBase().

Here is the caller graph for this function:

◆ multiplierBase()

quint8 LifeTime::multiplierBase ( ) const
inline

multiplierBase Multiplier + base getter.

Returns
The multiplier + the base.

Definition at line 115 of file LifeTime.h.

References m_multiplier_base.

Referenced by LifeTime().

Here is the caller graph for this function:

◆ setBase()

void LifeTime::setBase ( enum e_base  b)
inline

setBase Base setter.

Parameters
bThe new base.

Definition at line 150 of file LifeTime.h.

References m_multiplier_base.

◆ setMultiplier()

void LifeTime::setMultiplier ( quint8  m)
inline

setMultiplier Multiplier setter.

Parameters
mThe new multiplier.

Definition at line 145 of file LifeTime.h.

References m_multiplier_base.

◆ setMultiplierBase() [1/2]

void LifeTime::setMultiplierBase ( quint8  m)
inline

setMultiplierBase Multiplier + base setter.

Parameters
mThe new multiplier + base.

Definition at line 155 of file LifeTime.h.

References m_multiplier_base.

Referenced by GeoNet::flushLSPB().

Here is the caller graph for this function:

◆ setMultiplierBase() [2/2]

void LifeTime::setMultiplierBase ( quint32  lifeTime)

setMultiplierBase Multiplier + base setter from life time value.

Parameters
lifeTimeThe life time value.

Definition at line 62 of file LifeTime.cpp.

References base(), base_100_s, base_10_s, base_1_s, base_50_ms, itsGnDefaultPacketLifeTime, lifeTime(), m_multiplier_base, and multiplier().

Here is the call graph for this function:

◆ toHex()

QByteArray LifeTime::toHex ( )

toHex Encode the LifeTime in byte array.

Returns
The encoded LifeTime.

Definition at line 114 of file LifeTime.cpp.

References m_multiplier_base.

Referenced by gnDataRequestToBin(), and BasicHeader::toHex().

Here is the caller graph for this function:

Member Data Documentation

◆ m_multiplier_base

quint8 LifeTime::m_multiplier_base
private

Multiplier + base.

Definition at line 170 of file LifeTime.h.

Referenced by base(), LifeTime(), multiplier(), multiplierBase(), setBase(), setMultiplier(), setMultiplierBase(), and toHex().


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