HiveMind
MessageSender.h
Go to the documentation of this file.
1 #ifndef __MESSAGESENDER_H_
2 #define __MESSAGESENDER_H_
3 
4 #include "IMessageSender.h"
5 #include <bsp/IBSP.h>
6 #include <cpp-common/ICircularQueue.h>
7 #include <logger/ILogger.h>
8 #include <pheromones/HiveMindHostSerializer.h>
9 
10 class MessageSender : public IMessageSender {
11  public:
12  MessageSender(ICircularQueue<MessageDTO>& inputQueue,
13  IHiveMindHostSerializer& serializer,
14  IBSP& bsp,
15  ILogger& logger);
16 
17  ~MessageSender() override = default;
18 
19  bool processAndSerialize() override;
20 
21  private:
22  ICircularQueue<MessageDTO>& m_inputQueue;
23  IHiveMindHostSerializer& m_serializer;
26 };
27 
28 #endif // __MESSAGESENDER_H_
MessageSender::m_bsp
IBSP & m_bsp
Definition: MessageSender.h:24
IBSP.h
MessageSender::~MessageSender
~MessageSender() override=default
IMessageSender.h
IBSP
Definition: IBSP.h:6
MessageSender::m_serializer
IHiveMindHostSerializer & m_serializer
Definition: MessageSender.h:23
MessageSender::m_inputQueue
ICircularQueue< MessageDTO > & m_inputQueue
Definition: MessageSender.h:22
ILogger
A logger class with basic logging capabilities.
Definition: ILogger.h:35
MessageSender::m_logger
ILogger & m_logger
Definition: MessageSender.h:25
MessageSender::processAndSerialize
bool processAndSerialize() override
process an item in the queue, serializes it and sends it to the deserializer
Definition: MessageSender.cpp:9
MessageSender::MessageSender
MessageSender(ICircularQueue< MessageDTO > &inputQueue, IHiveMindHostSerializer &serializer, IBSP &bsp, ILogger &logger)
Definition: MessageSender.cpp:3
MessageSender
Definition: MessageSender.h:10
IMessageSender
A class to pipe messages to a stream and serialize them.
Definition: IMessageSender.h:6
ILogger.h