HiveMind
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
InterlocMessageHandler Class Reference

#include <InterlocMessageHandler.h>

Inheritance diagram for InterlocMessageHandler:
Inheritance graph
Collaboration diagram for InterlocMessageHandler:
Collaboration graph

Public Member Functions

 InterlocMessageHandler (ILogger &logger, IInterlocManager &interlocManager, IBSP &bsp, ICircularQueue< MessageDTO > &inputQueue, ICircularQueue< MessageDTO > &hostQueue, ICircularQueue< MessageDTO > &remoteQueue, INotificationQueue< InterlocUpdate > &interlocPositionUpdateQueue)
 
virtual ~InterlocMessageHandler ()=default
 
bool processMessage () override
 Processes the next message in the queue. More...
 
bool getDumpEnabled () const override
 Retrieves a flag to know if data dumps to the host should be done or not. More...
 
bool sendInterlocDump (InterlocUpdate *updatesHistory, uint8_t updatesLength) override
 Sends a history of interloc updates back to the host. More...
 

Private Member Functions

bool handleMessage (const MessageDTO &dto)
 
bool handleStateChangeMessage (const SetInterlocStateDTO dto) const
 
bool handleConfigurationMessage (const InterlocConfigurationDTO &dto)
 
ICircularQueue< MessageDTO > & getQueueForDestination (uint16_t destinationId) const
 
void stateChangeCallback (InterlocStateDTO previousState, InterlocStateDTO newState)
 
void rawAngleDataCallback (BspInterlocRawAngleData &data)
 
void ensureSendMessage (MessageDTO &msg)
 

Static Private Member Functions

static void stateChangeCallbackStatic (void *context, InterlocStateDTO previousState, InterlocStateDTO newState)
 
static void rawAngleDataCallbackStatic (void *context, BspInterlocRawAngleData &data)
 
static InterlocRawAngleDataDTO constructRawDataMessage (BspInterlocRawAngleData &data, uint32_t fromId, uint8_t numFrames)
 

Private Attributes

ILoggerm_logger
 
IInterlocManagerm_interlocManager
 
IBSPm_bsp
 
ICircularQueue< MessageDTO > & m_inputQueue
 
ICircularQueue< MessageDTO > & m_hostQueue
 
ICircularQueue< MessageDTO > & m_remoteQueue
 
INotificationQueue< InterlocUpdate > & m_interlocPositionUpdateQueue
 
std::array< GetNeighborResponseDTO, InterlocDumpDTO::MAX_UPDATES_SIZE > m_updateDtoArray
 
uint16_t m_messageSourceId
 
bool m_dumpsEnabled
 

Constructor & Destructor Documentation

◆ InterlocMessageHandler()

InterlocMessageHandler::InterlocMessageHandler ( ILogger logger,
IInterlocManager interlocManager,
IBSP bsp,
ICircularQueue< MessageDTO > &  inputQueue,
ICircularQueue< MessageDTO > &  hostQueue,
ICircularQueue< MessageDTO > &  remoteQueue,
INotificationQueue< InterlocUpdate > &  interlocPositionUpdateQueue 
)
Here is the call graph for this function:

◆ ~InterlocMessageHandler()

virtual InterlocMessageHandler::~InterlocMessageHandler ( )
virtualdefault

Member Function Documentation

◆ constructRawDataMessage()

InterlocRawAngleDataDTO InterlocMessageHandler::constructRawDataMessage ( BspInterlocRawAngleData data,
uint32_t  fromId,
uint8_t  numFrames 
)
staticprivate
Here is the caller graph for this function:

◆ ensureSendMessage()

void InterlocMessageHandler::ensureSendMessage ( MessageDTO &  msg)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDumpEnabled()

bool InterlocMessageHandler::getDumpEnabled ( ) const
overridevirtual

Retrieves a flag to know if data dumps to the host should be done or not.

Returns
True if enabled, false otherwise.

Implements IInterlocMessageHandler.

◆ getQueueForDestination()

ICircularQueue< MessageDTO > & InterlocMessageHandler::getQueueForDestination ( uint16_t  destinationId) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleConfigurationMessage()

bool InterlocMessageHandler::handleConfigurationMessage ( const InterlocConfigurationDTO &  dto)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleMessage()

bool InterlocMessageHandler::handleMessage ( const MessageDTO &  dto)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleStateChangeMessage()

bool InterlocMessageHandler::handleStateChangeMessage ( const SetInterlocStateDTO  dto) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processMessage()

bool InterlocMessageHandler::processMessage ( )
overridevirtual

Processes the next message in the queue.

Returns
True if successfully processed, false otherwise

Implements IInterlocMessageHandler.

Here is the call graph for this function:

◆ rawAngleDataCallback()

void InterlocMessageHandler::rawAngleDataCallback ( BspInterlocRawAngleData data)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rawAngleDataCallbackStatic()

void InterlocMessageHandler::rawAngleDataCallbackStatic ( void *  context,
BspInterlocRawAngleData data 
)
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendInterlocDump()

bool InterlocMessageHandler::sendInterlocDump ( InterlocUpdate updatesHistory,
uint8_t  updatesLength 
)
overridevirtual

Sends a history of interloc updates back to the host.

Parameters
updatesHistoryPointer to an array of interlocUpdates
updatesLengthNumber of items in the array
Returns
True if message was queued for send, false otherwise

Implements IInterlocMessageHandler.

Here is the call graph for this function:

◆ stateChangeCallback()

void InterlocMessageHandler::stateChangeCallback ( InterlocStateDTO  previousState,
InterlocStateDTO  newState 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stateChangeCallbackStatic()

void InterlocMessageHandler::stateChangeCallbackStatic ( void *  context,
InterlocStateDTO  previousState,
InterlocStateDTO  newState 
)
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_bsp

IBSP& InterlocMessageHandler::m_bsp
private

◆ m_dumpsEnabled

bool InterlocMessageHandler::m_dumpsEnabled
private

◆ m_hostQueue

ICircularQueue<MessageDTO>& InterlocMessageHandler::m_hostQueue
private

◆ m_inputQueue

ICircularQueue<MessageDTO>& InterlocMessageHandler::m_inputQueue
private

◆ m_interlocManager

IInterlocManager& InterlocMessageHandler::m_interlocManager
private

◆ m_interlocPositionUpdateQueue

INotificationQueue<InterlocUpdate>& InterlocMessageHandler::m_interlocPositionUpdateQueue
private

◆ m_logger

ILogger& InterlocMessageHandler::m_logger
private

◆ m_messageSourceId

uint16_t InterlocMessageHandler::m_messageSourceId
private

◆ m_remoteQueue

ICircularQueue<MessageDTO>& InterlocMessageHandler::m_remoteQueue
private

◆ m_updateDtoArray

std::array<GetNeighborResponseDTO, InterlocDumpDTO::MAX_UPDATES_SIZE> InterlocMessageHandler::m_updateDtoArray
private

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