ITS
CBFPacketBuffer Class Reference

#include <CBFPacketBuffer.h>

Inheritance diagram for CBFPacketBuffer:
[legend]
Collaboration diagram for CBFPacketBuffer:
[legend]

Public Slots

void sendPacket (GBCPacket packet)
 sendPacket Slot used to send packet (GBC case). More...
 
void sendPacket (GUCPacket packet)
 sendPacket Slot used to send packet (GUC case). More...
 
void sendPacket (LSReplyPacket packet)
 sendPacket Slot used to send packet (LSReply case). More...
 
void stopPacket (GBCPacket packet)
 stopPacket Slot used to stop the packet (GBC case). More...
 
void stopPacket (GUCPacket packet)
 stopPacket Slot used to stop the packet (GUC case). More...
 
void stopPacket (LSReplyPacket packet)
 stopPacket Slot used to stop the packet (LSReply case). More...
 

Signals

void lpvSent ()
 lpvSent Signal sent to advertised of an LPV sending. More...
 
void killAll ()
 killAll Signal used to kill all the buffer entries. More...
 

Public Member Functions

 CBFPacketBuffer ()
 CBFPacketBuffer Default constructor. More...
 
 CBFPacketBuffer (ParameterNetwork *paramNetwork, QHash< QByteArray, LocationTableEntry > *locT, GnAddr *gnaddr, FakeGPSProvider *paramGPS, HistoryPacketBuffer *HPB, quint16 *SN, QHash< QByteArray, int > *CBFPBCounter)
 CBFPacketBuffer Initialization constructor. More...
 
 CBFPacketBuffer (const CBFPacketBuffer &other)
 CBFPacketBuffer Copy constructor. More...
 
int addPacket (BasicHeader bh, CommonHeader ch, GBCPacket packet, QByteArray payload, int timeToBuffer)
 addPacket Add packet to the buffer. More...
 
int addPacket (BasicHeader bh, CommonHeader ch, GUCPacket packet, QByteArray payload, int timeToBuffer)
 addPacket Add packet to the buffer. More...
 
int addPacket (BasicHeader bh, CommonHeader ch, LSReplyPacket packet, QByteArray payload, int timeToBuffer)
 addPacket Add packet to the buffer. More...
 
bool isDuplicateTimestamp (GBCPacket packet)
 isDuplicateTimestamp Check is the packet is duplicate. More...
 
bool isDuplicateTimestamp (GUCPacket packet)
 isDuplicateTimestamp Check is the packet is duplicate. More...
 
bool isDuplicateTimestamp (LSReplyPacket packet)
 isDuplicateTimestamp Check is the packet is duplicate. More...
 
bool erase (GBCPacket packet)
 erase Remove packet from the buffer. More...
 
bool erase (GUCPacket packet)
 erase Remove packet from the buffer. More...
 
bool erase (LSReplyPacket packet)
 erase Remove packet from the buffer. More...
 
bool update (GBCPacket packet, int timeToBuffer)
 update Update the packet of the buffer. More...
 
bool update (GUCPacket packet, int timeToBuffer)
 update Update the packet of the buffer. More...
 
bool update (LSReplyPacket packet, int timeToBuffer)
 update Update the packet of the buffer. More...
 
void clear ()
 clear Clear the buffer. More...
 

Public Attributes

QMutex * m_mutex
 

Static Public Attributes

static int nbCBFPacketQueued = 0
 

Private Attributes

QVector< CBFPacketEntry * > m_CBFPacketBuffer
 
QHash< QByteArray, LocationTableEntry > * m_locationTable
 
ParameterNetworkm_paramNetwork
 
FakeGPSProviderm_paramGPS
 
GnAddrm_gnAddr
 
HistoryPacketBufferm_HPB
 
quint16 * sequenceNumber
 
QHash< QByteArray, int > * m_CBFPBCounter
 

Detailed Description

Definition at line 18 of file CBFPacketBuffer.h.

Constructor & Destructor Documentation

◆ CBFPacketBuffer() [1/3]

CBFPacketBuffer::CBFPacketBuffer ( )

CBFPacketBuffer Default constructor.

Definition at line 5 of file CBFPacketBuffer.cpp.

References m_CBFPBCounter, m_HPB, m_locationTable, m_mutex, m_paramGPS, and m_paramNetwork.

◆ CBFPacketBuffer() [2/3]

CBFPacketBuffer::CBFPacketBuffer ( ParameterNetwork paramNetwork,
QHash< QByteArray, LocationTableEntry > *  locT,
GnAddr gnaddr,
FakeGPSProvider paramGPS,
HistoryPacketBuffer HPB,
quint16 *  SN,
QHash< QByteArray, int > *  CBFPBCounter 
)

CBFPacketBuffer Initialization constructor.

Parameters
gpsGPS Provider
locTLocation table

Definition at line 15 of file CBFPacketBuffer.cpp.

References m_CBFPBCounter, m_gnAddr, m_HPB, m_locationTable, m_mutex, m_paramGPS, m_paramNetwork, and sequenceNumber.

◆ CBFPacketBuffer() [3/3]

CBFPacketBuffer::CBFPacketBuffer ( const CBFPacketBuffer other)

CBFPacketBuffer Copy constructor.

Parameters
otherThe CBFPacketBuffer to copy.

Definition at line 27 of file CBFPacketBuffer.cpp.

References m_CBFPacketBuffer, m_CBFPBCounter, m_gnAddr, m_HPB, m_locationTable, m_mutex, m_paramGPS, m_paramNetwork, and sequenceNumber.

Member Function Documentation

◆ addPacket() [1/3]

int CBFPacketBuffer::addPacket ( BasicHeader  bh,
CommonHeader  ch,
GBCPacket  packet,
QByteArray  payload,
int  timeToBuffer 
)

addPacket Add packet to the buffer.

Parameters
bhPacket Basic Header.
chPacket Common Header.
packetThe packet (GBC case).
payloadThe packet payload.
timeToBufferTime to be in the buffer.
Returns
The number of packet in the buffer.

Definition at line 40 of file CBFPacketBuffer.cpp.

References isDuplicateTimestamp(), itsGnCbfPacketbufferSize, killAll(), m_CBFPacketBuffer, m_gnAddr, m_HPB, m_paramGPS, m_paramNetwork, nbCBFPacketQueued, sendPacket(), sequenceNumber, and stopPacket().

Referenced by GeoNet::advancedForwarding(), GeoNet::CBFUnicast(), and GeoNet::contentionBasedForwardingAlgorithm().

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

◆ addPacket() [2/3]

int CBFPacketBuffer::addPacket ( BasicHeader  bh,
CommonHeader  ch,
GUCPacket  packet,
QByteArray  payload,
int  timeToBuffer 
)

addPacket Add packet to the buffer.

Parameters
bhPacket Basic Header.
chPacket Common Header.
packetThe packet (GUC case).
payloadThe packet payload.
timeToBufferTime to be in the buffer.
Returns
The number of packet in the buffer.

Definition at line 76 of file CBFPacketBuffer.cpp.

References isDuplicateTimestamp(), itsGnCbfPacketbufferSize, killAll(), m_CBFPacketBuffer, m_gnAddr, m_HPB, m_paramGPS, m_paramNetwork, nbCBFPacketQueued, sendPacket(), sequenceNumber, and stopPacket().

Here is the call graph for this function:

◆ addPacket() [3/3]

int CBFPacketBuffer::addPacket ( BasicHeader  bh,
CommonHeader  ch,
LSReplyPacket  packet,
QByteArray  payload,
int  timeToBuffer 
)

addPacket Add packet to the buffer.

Parameters
bhPacket Basic Header.
chPacket Common Header.
packetThe packet (LSReply case).
payloadThe packet payload.
timeToBufferTime to be in the buffer.
Returns
The number of packet in the buffer.

Definition at line 112 of file CBFPacketBuffer.cpp.

References isDuplicateTimestamp(), itsGnCbfPacketbufferSize, killAll(), m_CBFPacketBuffer, m_gnAddr, m_HPB, m_paramGPS, m_paramNetwork, nbCBFPacketQueued, sendPacket(), sequenceNumber, and stopPacket().

Here is the call graph for this function:

◆ clear()

void CBFPacketBuffer::clear ( )

clear Clear the buffer.

Definition at line 256 of file CBFPacketBuffer.cpp.

References killAll(), m_CBFPacketBuffer, and nbCBFPacketQueued.

Referenced by GeoNet::utInitialize().

Here is the caller graph for this function:

◆ erase() [1/3]

bool CBFPacketBuffer::erase ( GBCPacket  packet)

erase Remove packet from the buffer.

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

Definition at line 211 of file CBFPacketBuffer.cpp.

References isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, nbCBFPacketQueued, GBCPacket::sequenceNumber(), GBCPacket::soPv(), and LongPositionVector::timestamp().

Referenced by GeoNet::advancedForwarding(), GeoNet::CBFUnicast(), GeoNet::contentionBasedForwardingAlgorithm(), sendPacket(), and stopPacket().

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

◆ erase() [2/3]

bool CBFPacketBuffer::erase ( GUCPacket  packet)

erase Remove packet from the buffer.

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

Definition at line 226 of file CBFPacketBuffer.cpp.

References isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, nbCBFPacketQueued, GUCPacket::sequenceNumber(), GUCPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

◆ erase() [3/3]

bool CBFPacketBuffer::erase ( LSReplyPacket  packet)

erase Remove packet from the buffer.

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

Definition at line 241 of file CBFPacketBuffer.cpp.

References isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, nbCBFPacketQueued, GUCPacket::sequenceNumber(), GUCPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

◆ isDuplicateTimestamp() [1/3]

bool CBFPacketBuffer::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 184 of file CBFPacketBuffer.cpp.

References CommonHeader::headerType_geoAnycast, CommonHeader::headerType_geoBroadcast, isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, GBCPacket::sequenceNumber(), GBCPacket::soPv(), and LongPositionVector::timestamp().

Referenced by addPacket(), GeoNet::advancedForwarding(), GeoNet::CBFUnicast(), and GeoNet::contentionBasedForwardingAlgorithm().

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

◆ isDuplicateTimestamp() [2/3]

bool CBFPacketBuffer::isDuplicateTimestamp ( GUCPacket  packet)

isDuplicateTimestamp Check is the packet is duplicate.

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

Definition at line 193 of file CBFPacketBuffer.cpp.

References CommonHeader::headerType_geoUnicast, isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, GUCPacket::sequenceNumber(), GUCPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

◆ isDuplicateTimestamp() [3/3]

bool CBFPacketBuffer::isDuplicateTimestamp ( LSReplyPacket  packet)

isDuplicateTimestamp Check is the packet is duplicate.

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

Definition at line 202 of file CBFPacketBuffer.cpp.

References CommonHeader::headerSubTypeLocationService_Reply, CommonHeader::headerType_locationService, isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, GUCPacket::sequenceNumber(), GUCPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

◆ killAll

void CBFPacketBuffer::killAll ( )
signal

killAll Signal used to kill all the buffer entries.

Referenced by addPacket(), and clear().

Here is the caller graph for this function:

◆ lpvSent

void CBFPacketBuffer::lpvSent ( )
signal

lpvSent Signal sent to advertised of an LPV sending.

Referenced by sendPacket().

Here is the caller graph for this function:

◆ sendPacket [1/3]

void CBFPacketBuffer::sendPacket ( GBCPacket  packet)
slot

sendPacket Slot used to send packet (GBC case).

Parameters
packetThe GBC to send.

Definition at line 263 of file CBFPacketBuffer.cpp.

References erase(), LongPositionVector::gnAddr(), GnAddr::helper_size, lpvSent(), m_CBFPBCounter, GBCPacket::sequenceNumber(), GBCPacket::soPv(), LongPositionVector::timestamp(), and GnAddr::toHex().

Referenced by addPacket().

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

◆ sendPacket [2/3]

void CBFPacketBuffer::sendPacket ( GUCPacket  packet)
slot

sendPacket Slot used to send packet (GUC case).

Parameters
packetThe GUC to send.

Definition at line 270 of file CBFPacketBuffer.cpp.

References erase(), LongPositionVector::gnAddr(), GnAddr::helper_size, lpvSent(), m_CBFPBCounter, GUCPacket::sequenceNumber(), GUCPacket::soPv(), LongPositionVector::timestamp(), and GnAddr::toHex().

Here is the call graph for this function:

◆ sendPacket [3/3]

void CBFPacketBuffer::sendPacket ( LSReplyPacket  packet)
slot

sendPacket Slot used to send packet (LSReply case).

Parameters
packetThe LSReply to send.

Definition at line 277 of file CBFPacketBuffer.cpp.

References erase(), LongPositionVector::gnAddr(), GnAddr::helper_size, lpvSent(), m_CBFPBCounter, GUCPacket::sequenceNumber(), GUCPacket::soPv(), LongPositionVector::timestamp(), and GnAddr::toHex().

Here is the call graph for this function:

◆ stopPacket [1/3]

void CBFPacketBuffer::stopPacket ( GBCPacket  packet)
slot

stopPacket Slot used to stop the packet (GBC case).

Parameters
packetThe GBC packet to stop.

Definition at line 284 of file CBFPacketBuffer.cpp.

References erase(), LongPositionVector::gnAddr(), GnAddr::helper_size, m_CBFPBCounter, GBCPacket::sequenceNumber(), GBCPacket::soPv(), LongPositionVector::timestamp(), and GnAddr::toHex().

Referenced by addPacket().

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

◆ stopPacket [2/3]

void CBFPacketBuffer::stopPacket ( GUCPacket  packet)
slot

stopPacket Slot used to stop the packet (GUC case).

Parameters
packetThe GUC packet to stop.

Definition at line 290 of file CBFPacketBuffer.cpp.

References erase(), LongPositionVector::gnAddr(), GnAddr::helper_size, m_CBFPBCounter, GUCPacket::sequenceNumber(), GUCPacket::soPv(), LongPositionVector::timestamp(), and GnAddr::toHex().

Here is the call graph for this function:

◆ stopPacket [3/3]

void CBFPacketBuffer::stopPacket ( LSReplyPacket  packet)
slot

stopPacket Slot used to stop the packet (LSReply case).

Parameters
packetThe LSReply packet to stop.

Definition at line 296 of file CBFPacketBuffer.cpp.

References erase(), LongPositionVector::gnAddr(), GnAddr::helper_size, m_CBFPBCounter, GUCPacket::sequenceNumber(), GUCPacket::soPv(), LongPositionVector::timestamp(), and GnAddr::toHex().

Here is the call graph for this function:

◆ update() [1/3]

bool CBFPacketBuffer::update ( GBCPacket  packet,
int  timeToBuffer 
)

update Update the packet of the buffer.

Parameters
packetThe packet to change (GBC case).
timeToBufferThe new time to be in the buffer.
Returns
True on success.

Definition at line 148 of file CBFPacketBuffer.cpp.

References CommonHeader::headerType_geoAnycast, CommonHeader::headerType_geoBroadcast, isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, GBCPacket::sequenceNumber(), GBCPacket::soPv(), and LongPositionVector::timestamp().

Referenced by GeoNet::advancedForwarding().

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

◆ update() [2/3]

bool CBFPacketBuffer::update ( GUCPacket  packet,
int  timeToBuffer 
)

update Update the packet of the buffer.

Parameters
packetThe packet to change (GUC case).
timeToBufferThe new time to be in the buffer.
Returns
True on success.

Definition at line 160 of file CBFPacketBuffer.cpp.

References CommonHeader::headerType_geoUnicast, isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, GUCPacket::sequenceNumber(), GUCPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

◆ update() [3/3]

bool CBFPacketBuffer::update ( LSReplyPacket  packet,
int  timeToBuffer 
)

update Update the packet of the buffer.

Parameters
packetThe packet to change (LSReply case).
timeToBufferThe new time to be in the buffer.
Returns
True on success.

Definition at line 172 of file CBFPacketBuffer.cpp.

References CommonHeader::headerSubTypeLocationService_Reply, CommonHeader::headerType_locationService, isDuplicatePacketDetectionTimestampSN(), m_CBFPacketBuffer, GUCPacket::sequenceNumber(), GUCPacket::soPv(), and LongPositionVector::timestamp().

Here is the call graph for this function:

Member Data Documentation

◆ m_CBFPacketBuffer

QVector<CBFPacketEntry*> CBFPacketBuffer::m_CBFPacketBuffer
private

The CBF buffer.

Definition at line 182 of file CBFPacketBuffer.h.

Referenced by addPacket(), CBFPacketBuffer(), clear(), erase(), isDuplicateTimestamp(), and update().

◆ m_CBFPBCounter

QHash<QByteArray, int>* CBFPacketBuffer::m_CBFPBCounter
private

HashMap of counters.

Definition at line 190 of file CBFPacketBuffer.h.

Referenced by CBFPacketBuffer(), sendPacket(), and stopPacket().

◆ m_gnAddr

GnAddr* CBFPacketBuffer::m_gnAddr
private

ITS-S GN_ADDR.

Definition at line 187 of file CBFPacketBuffer.h.

Referenced by addPacket(), and CBFPacketBuffer().

◆ m_HPB

HistoryPacketBuffer* CBFPacketBuffer::m_HPB
private

History packet buffer.

Definition at line 188 of file CBFPacketBuffer.h.

Referenced by addPacket(), and CBFPacketBuffer().

◆ m_locationTable

QHash<QByteArray, LocationTableEntry>* CBFPacketBuffer::m_locationTable
private

HashMap of LocTE.

Definition at line 184 of file CBFPacketBuffer.h.

Referenced by CBFPacketBuffer().

◆ m_mutex

QMutex* CBFPacketBuffer::m_mutex

Mutex used when looking into the buffer.

Definition at line 137 of file CBFPacketBuffer.h.

Referenced by CBFPacketBuffer(), and GeoNet::CBFUnicast().

◆ m_paramGPS

FakeGPSProvider* CBFPacketBuffer::m_paramGPS
private

GPS.

Definition at line 186 of file CBFPacketBuffer.h.

Referenced by addPacket(), and CBFPacketBuffer().

◆ m_paramNetwork

ParameterNetwork* CBFPacketBuffer::m_paramNetwork
private

Network configuration.

Definition at line 185 of file CBFPacketBuffer.h.

Referenced by addPacket(), and CBFPacketBuffer().

◆ nbCBFPacketQueued

int CBFPacketBuffer::nbCBFPacketQueued = 0
static

Number of entries in the buffer.

Definition at line 130 of file CBFPacketBuffer.h.

Referenced by addPacket(), clear(), and erase().

◆ sequenceNumber

quint16* CBFPacketBuffer::sequenceNumber
private

GN sequence number.

Definition at line 189 of file CBFPacketBuffer.h.

Referenced by addPacket(), and CBFPacketBuffer().


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