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

#include <BittyBuzzMessageService.h>

Inheritance diagram for BittyBuzzMessageService:
Inheritance graph
Collaboration diagram for BittyBuzzMessageService:
Collaboration graph

Public Member Functions

 BittyBuzzMessageService (ICircularQueue< MessageDTO > &hostQueue, ICircularQueue< MessageDTO > &remoteQueue, ICircularQueue< MessageDTO > &buzzQueue, IBSP &bsp, ILogger &logger)
 
 ~BittyBuzzMessageService () override=default
 
bool callHostFunction (uint16_t agentId, const char *functionName, const FunctionCallArgumentDTO *args, uint16_t argsLength) override
 call a function to a host More...
 
bool callBuzzFunction (uint16_t agentId, const char *functionName, const FunctionCallArgumentDTO *args, uint16_t argsLength) override
 call a function to a buzz vm More...
 
bool queueBuzzMessages () override
 queues the buzz messages More...
 
- Public Member Functions inherited from IBittyBuzzMessageService
virtual ~IBittyBuzzMessageService ()=default
 

Private Member Functions

std::optional< std::reference_wrapper< BuzzMessageDTO > > getNextMessage ()
 
bool flush ()
 

Private Attributes

ICircularQueue< MessageDTO > & m_hostQueue
 
ICircularQueue< MessageDTO > & m_remoteQueue
 
ICircularQueue< MessageDTO > & m_buzzQueue
 
BuzzMessagesDTO m_messages
 
IBSPm_bsp
 
ILoggerm_logger
 

Constructor & Destructor Documentation

◆ BittyBuzzMessageService()

BittyBuzzMessageService::BittyBuzzMessageService ( ICircularQueue< MessageDTO > &  hostQueue,
ICircularQueue< MessageDTO > &  remoteQueue,
ICircularQueue< MessageDTO > &  buzzQueue,
IBSP bsp,
ILogger logger 
)

◆ ~BittyBuzzMessageService()

BittyBuzzMessageService::~BittyBuzzMessageService ( )
overridedefault

Member Function Documentation

◆ callBuzzFunction()

bool BittyBuzzMessageService::callBuzzFunction ( uint16_t  agentId,
const char *  functionName,
const FunctionCallArgumentDTO *  args,
uint16_t  argsLength 
)
overridevirtual

call a function to a buzz vm

Parameters
[in]agentIdthe id of the agent, use 0 for broadcast
[in]functionNamethe name of the function to call
[in]argsa list of arguments to pass to the function
[in]argsLengththe number of arguments to pass, the max is FunctionCallRequestDTO::FUNCTION_CALL_ARGUMENTS_MAX_LENGTH

Implements IBittyBuzzMessageService.

Here is the call graph for this function:

◆ callHostFunction()

bool BittyBuzzMessageService::callHostFunction ( uint16_t  agentId,
const char *  functionName,
const FunctionCallArgumentDTO *  args,
uint16_t  argsLength 
)
overridevirtual

call a function to a host

Parameters
[in]agentIdthe id of the agent, use 0 for broadcast
[in]functionNamethe name of the function to call
[in]argsa list of arguments to pass to the function
[in]argsLengththe number of arguments to pass, the max is FunctionCallRequestDTO::FUNCTION_CALL_ARGUMENTS_MAX_LENGTH

Implements IBittyBuzzMessageService.

Here is the call graph for this function:

◆ flush()

bool BittyBuzzMessageService::flush ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNextMessage()

std::optional< std::reference_wrapper< BuzzMessageDTO > > BittyBuzzMessageService::getNextMessage ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ queueBuzzMessages()

bool BittyBuzzMessageService::queueBuzzMessages ( )
overridevirtual

queues the buzz messages

Returns
true if the operation was successfull, false if not (length too big or queue is full)

Implements IBittyBuzzMessageService.

Here is the call graph for this function:

Member Data Documentation

◆ m_bsp

IBSP& BittyBuzzMessageService::m_bsp
private

◆ m_buzzQueue

ICircularQueue<MessageDTO>& BittyBuzzMessageService::m_buzzQueue
private

◆ m_hostQueue

ICircularQueue<MessageDTO>& BittyBuzzMessageService::m_hostQueue
private

◆ m_logger

ILogger& BittyBuzzMessageService::m_logger
private

◆ m_messages

BuzzMessagesDTO BittyBuzzMessageService::m_messages
private

◆ m_remoteQueue

ICircularQueue<MessageDTO>& BittyBuzzMessageService::m_remoteQueue
private

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