Overte C++ Documentation
ReceivedPacketProcessor Class Referenceabstract

Generalized threaded processor for handling received inbound packets. More...

#include <ReceivedPacketProcessor.h>

Inheritance diagram for ReceivedPacketProcessor:
Collaboration diagram for ReceivedPacketProcessor:

Public Member Functions

void queueReceivedPacket (QSharedPointer< ReceivedMessage > message, SharedNodePointer sendingNode)
 Add packet from network receive thread to the processing queue.
 
bool hasPacketsToProcess () const
 Are there received packets waiting to be processed.
 
bool isAlive (const QUuid &nodeUUID) const
 Is a specified node still alive?
 
bool hasPacketsToProcessFrom (const SharedNodePointer &sendingNode) const
 Are there received packets waiting to be processed from a specified node.
 
bool hasPacketsToProcessFrom (const QUuid &nodeUUID) const
 Are there received packets waiting to be processed from a specified node.
 
int packetsToProcessCount () const
 How many received packets waiting are to be processed.
 
- Public Member Functions inherited from GenericThread
void initialize (bool isThreaded=true, QThread::Priority priority=QThread::NormalPriority)
 
void terminate ()
 Call to stop the thread.
 

Protected Member Functions

virtual void processPacket (QSharedPointer< ReceivedMessage > message, SharedNodePointer sendingNode)=0
 
virtual bool process () override
 Implements generic processing behavior for this thread.
 
virtual uint32_t getMaxWait () const
 Determines the timeout of the wait when there are no packets to process. Default value is 100ms to allow for regular event processing.
 
virtual void preProcess ()
 Override to do work before the packets processing loop. Default does nothing.
 
virtual void midProcess ()
 Override to do work inside the packet processing loop after a packet is processed. Default does nothing.
 
virtual void postProcess ()
 Override to do work after the packets processing loop. Default does nothing.
 
- Protected Member Functions inherited from GenericThread
void lock ()
 Locks all the resources of the thread.
 
void unlock ()
 Unlocks all the resources of the thread.
 

Additional Inherited Members

- Public Slots inherited from GenericThread
void threadRoutine ()
 If you're running in non-threaded mode, you must call this regularly.
 

Detailed Description

Generalized threaded processor for handling received inbound packets.

Member Function Documentation

◆ processPacket()

virtual void ReceivedPacketProcessor::processPacket ( QSharedPointer< ReceivedMessage >  message,
SharedNodePointer  sendingNode 
)
protectedpure virtual

Callback for processing of recieved packets. Implement this to process the incoming packets.

Parameters
SharedNodePointer&sendingNode the node that sent this packet
QByteArray&the packet to be processed

Implemented in OctreePacketProcessor, and OctreeInboundPacketProcessor.


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