ITS
BroadcastForwardingPacketBuffer Class Reference

#include <BroadcastForwardingPacketBuffer.h>

Public Member Functions

 BroadcastForwardingPacketBuffer ()
 BroadcastForwardingPacketBuffer Default constructor. More...
 
 BroadcastForwardingPacketBuffer (const BroadcastForwardingPacketBuffer &other)
 BroadcastForwardingPacketBuffer Copy constructor. More...
 
void addPacket (BasicHeader bh, CommonHeader ch, GACPacket packet, QByteArray payload, QByteArray sender, uchar *destination, uchar *forwarder)
 addPacket Add packet to the buffer. More...
 
void addPacket (BasicHeader bh, CommonHeader ch, GBCPacket packet, QByteArray payload, QByteArray sender, uchar *destination, uchar *forwarder)
 addPacket Add packet to the buffer. More...
 
void addPacket (BasicHeader bh, CommonHeader ch, TSBPacket packet, QByteArray payload, QByteArray sender)
 addPacket Add packet to the buffer. More...
 
void addPacket (BasicHeader bh, CommonHeader ch, SHBPacket packet, QByteArray payload, QByteArray sender)
 addPacket Add packet to the buffer. More...
 
bool isDuplicateTimestamp (GACPacket packet)
 isDuplicateTimestamp Check is the packet is duplicate. More...
 
bool isDuplicateTimestamp (GBCPacket packet)
 isDuplicateTimestamp Check is the packet is duplicate. More...
 
bool isDuplicateTimestamp (TSBPacket packet)
 isDuplicateTimestamp Check is the packet is duplicate. More...
 
bool isDuplicateTimestamp (SHBPacket packet)
 isDuplicateTimestamp Check is the packet is duplicate. More...
 
bool erase (GACPacket packet)
 erase Remove packet from the buffer. More...
 
bool erase (GBCPacket packet)
 erase Remove packet from the buffer. More...
 
bool erase (TSBPacket packet)
 erase Remove packet from the buffer. More...
 
bool erase (SHBPacket packet)
 erase Remove packet from the buffer. More...
 
void clear ()
 clear Clear the buffer. More...
 
QVector< BroadcastForwardingPacketEntrybcForwardPacketBuffer () const
 bcForwardPacketBuffer Buffer getter. More...
 

Public Attributes

QMutex * m_mutex
 

Static Public Attributes

static int nbBCForwardingPacketQueued = 0
 

Private Attributes

QVector< BroadcastForwardingPacketEntrym_bcForwardPacketBuffer
 

Detailed Description

Definition at line 17 of file BroadcastForwardingPacketBuffer.h.

Constructor & Destructor Documentation

◆ BroadcastForwardingPacketBuffer() [1/2]

BroadcastForwardingPacketBuffer::BroadcastForwardingPacketBuffer ( )

BroadcastForwardingPacketBuffer Default constructor.

Definition at line 5 of file BroadcastForwardingPacketBuffer.cpp.

References m_mutex.

◆ BroadcastForwardingPacketBuffer() [2/2]

BroadcastForwardingPacketBuffer::BroadcastForwardingPacketBuffer ( const BroadcastForwardingPacketBuffer other)

BroadcastForwardingPacketBuffer Copy constructor.

Parameters
otherThe BroadcastForwardingPacketBuffer to copy.

Definition at line 10 of file BroadcastForwardingPacketBuffer.cpp.

References m_bcForwardPacketBuffer.

Member Function Documentation

◆ addPacket() [1/4]

void BroadcastForwardingPacketBuffer::addPacket ( BasicHeader  bh,
CommonHeader  ch,
GACPacket  packet,
QByteArray  payload,
QByteArray  sender,
uchar *  destination,
uchar *  forwarder 
)

addPacket Add packet to the buffer.

Parameters
bhPacket Basic Header.
chPacket Common Header.
packetThe packet (GAC case).
payloadThe packet payload.
senderThe sender.
destinationThe destination.
forwarderThe forwarder.

Definition at line 15 of file BroadcastForwardingPacketBuffer.cpp.

References itsGnBcForwardingPacketBufferSize, m_bcForwardPacketBuffer, PacketBuffersEntry::m_elapsed, m_mutex, and nbBCForwardingPacketQueued.

Referenced by GeoNet::checkBCFPB(), GeoNet::greedy(), GeoNet::sendSHB(), GeoNet::sendTSB(), and GeoNet::tsbPacketProcessing().

Here is the caller graph for this function:

◆ addPacket() [2/4]

void BroadcastForwardingPacketBuffer::addPacket ( BasicHeader  bh,
CommonHeader  ch,
GBCPacket  packet,
QByteArray  payload,
QByteArray  sender,
uchar *  destination,
uchar *  forwarder 
)

addPacket Add packet to the buffer.

Parameters
bhPacket Basic Header.
chPacket Common Header.
packetThe packet (GBC case).
payloadThe packet payload.
senderThe sender.
destinationThe destination.
forwarderThe forwarder.

Definition at line 38 of file BroadcastForwardingPacketBuffer.cpp.

References itsGnBcForwardingPacketBufferSize, m_bcForwardPacketBuffer, PacketBuffersEntry::m_elapsed, m_mutex, and nbBCForwardingPacketQueued.

◆ addPacket() [3/4]

void BroadcastForwardingPacketBuffer::addPacket ( BasicHeader  bh,
CommonHeader  ch,
TSBPacket  packet,
QByteArray  payload,
QByteArray  sender 
)

addPacket Add packet to the buffer.

Parameters
bhPacket Basic Header.
chPacket Common Header.
packetThe packet (TSB case).
payloadThe packet payload.
senderThe sender.

Definition at line 62 of file BroadcastForwardingPacketBuffer.cpp.

References itsGnBcForwardingPacketBufferSize, m_bcForwardPacketBuffer, PacketBuffersEntry::m_elapsed, m_mutex, and nbBCForwardingPacketQueued.

◆ addPacket() [4/4]

void BroadcastForwardingPacketBuffer::addPacket ( BasicHeader  bh,
CommonHeader  ch,
SHBPacket  packet,
QByteArray  payload,
QByteArray  sender 
)

addPacket Add packet to the buffer.

Parameters
bhPacket Basic Header.
chPacket Common Header.
packetThe packet (SHB case).
payloadThe packet payload.
senderThe sender.

Definition at line 85 of file BroadcastForwardingPacketBuffer.cpp.

References itsGnBcForwardingPacketBufferSize, m_bcForwardPacketBuffer, PacketBuffersEntry::m_elapsed, m_mutex, and nbBCForwardingPacketQueued.

◆ bcForwardPacketBuffer()

QVector<BroadcastForwardingPacketEntry> BroadcastForwardingPacketBuffer::bcForwardPacketBuffer ( ) const
inline

bcForwardPacketBuffer Buffer getter.

Returns
The buffer.

Definition at line 133 of file BroadcastForwardingPacketBuffer.h.

References m_bcForwardPacketBuffer.

Referenced by GeoNet::checkBCFPB().

Here is the caller graph for this function:

◆ clear()

void BroadcastForwardingPacketBuffer::clear ( )

clear Clear the buffer.

Definition at line 148 of file BroadcastForwardingPacketBuffer.cpp.

References m_bcForwardPacketBuffer, m_mutex, and nbBCForwardingPacketQueued.

Referenced by GeoNet::utInitialize().

Here is the caller graph for this function:

◆ erase() [1/4]

bool BroadcastForwardingPacketBuffer::erase ( GACPacket  packet)

erase Remove packet from the buffer.

Parameters
packetThe packet (GAC case).
Returns
True if the remove succeed.

◆ erase() [2/4]

bool BroadcastForwardingPacketBuffer::erase ( GBCPacket  packet)

erase Remove packet from the buffer.

Parameters
packetThe packet (GBC case).
Returns
True if the remove succeed.

◆ erase() [3/4]

bool BroadcastForwardingPacketBuffer::erase ( TSBPacket  packet)

erase Remove packet from the buffer.

Parameters
packetThe packet (TSB case).
Returns
True if the remove succeed.

◆ erase() [4/4]

bool BroadcastForwardingPacketBuffer::erase ( SHBPacket  packet)

erase Remove packet from the buffer.

Parameters
packetThe packet (SHB case).
Returns
True if the remove succeed.

◆ isDuplicateTimestamp() [1/4]

bool BroadcastForwardingPacketBuffer::isDuplicateTimestamp ( GACPacket  packet)

isDuplicateTimestamp Check is the packet is duplicate.

Parameters
packetThe packet (GAC case).
Returns
True if the packet is a duplicate one.

Definition at line 108 of file BroadcastForwardingPacketBuffer.cpp.

References CommonHeader::headerType_geoUnicast, isDuplicatePacketDetectionTimestampSN(), m_bcForwardPacketBuffer, m_mutex, GBCPacket::sequenceNumber(), GBCPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

◆ isDuplicateTimestamp() [2/4]

bool BroadcastForwardingPacketBuffer::isDuplicateTimestamp ( GBCPacket  packet)

isDuplicateTimestamp Check is the packet is duplicate.

Parameters
packetThe packet (GBC case).
Returns
True if the packet is a duplicate one.

Definition at line 118 of file BroadcastForwardingPacketBuffer.cpp.

References CommonHeader::headerType_geoBroadcast, isDuplicatePacketDetectionTimestampSN(), m_bcForwardPacketBuffer, m_mutex, GBCPacket::sequenceNumber(), GBCPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

◆ isDuplicateTimestamp() [3/4]

bool BroadcastForwardingPacketBuffer::isDuplicateTimestamp ( TSBPacket  packet)

isDuplicateTimestamp Check is the packet is duplicate.

Parameters
packetThe packet (TSB case).
Returns
True if the packet is a duplicate one.

Definition at line 128 of file BroadcastForwardingPacketBuffer.cpp.

References CommonHeader::headerSubTypeTopologicallyScopedBroadcast_multiHop, CommonHeader::headerType_topologicallyScopedBroadcast, isDuplicatePacketDetectionTimestampSN(), m_bcForwardPacketBuffer, m_mutex, TSBPacket::sequenceNumber(), TSBPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

◆ isDuplicateTimestamp() [4/4]

bool BroadcastForwardingPacketBuffer::isDuplicateTimestamp ( SHBPacket  packet)

isDuplicateTimestamp Check is the packet is duplicate.

Parameters
packetThe packet (SHB case).
Returns
True if the packet is a duplicate one.

Definition at line 138 of file BroadcastForwardingPacketBuffer.cpp.

References CommonHeader::headerSubTypeTopologicallyScopedBroadcast_singleHop, CommonHeader::headerType_topologicallyScopedBroadcast, isDuplicatePacketDetectionTimestamp(), m_bcForwardPacketBuffer, m_mutex, SHBPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

Member Data Documentation

◆ m_bcForwardPacketBuffer

QVector<BroadcastForwardingPacketEntry> BroadcastForwardingPacketBuffer::m_bcForwardPacketBuffer
private

◆ m_mutex

QMutex* BroadcastForwardingPacketBuffer::m_mutex

Mutex used when looking into the buffer.

Definition at line 127 of file BroadcastForwardingPacketBuffer.h.

Referenced by addPacket(), BroadcastForwardingPacketBuffer(), clear(), and isDuplicateTimestamp().

◆ nbBCForwardingPacketQueued

int BroadcastForwardingPacketBuffer::nbBCForwardingPacketQueued = 0
static

Number of packet in the entry.

Definition at line 120 of file BroadcastForwardingPacketBuffer.h.

Referenced by addPacket(), and clear().


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