#include <HiveMindBridgeImpl.h>
|
| | HiveMindBridgeImpl (ITCPServer &tcpServer, IHiveMindHostSerializer &serializer, IHiveMindHostDeserializer &deserializer, IUserCallRequestHandler &userCallRequestManager, IHiveMindHostRequestHandler &hmRequestHandler, IUserCallbackMap &userCallbackMap, IMessageHandler &messageHandler, IThreadSafeQueue< MessageDTO > &inboundQueue, IThreadSafeQueue< OutboundRequestHandle > &outboundQueue, ILogger &logger, uint32_t keepAliveNbSpin) |
| |
| | ~HiveMindBridgeImpl () |
| |
| void | spin () |
| |
| void | onConnect (std::function< void()> hook) |
| |
| void | onDisconnect (std::function< void()> hook) |
| |
| bool | onBytesReceived (std::function< void(uint8_t *bytes, uint64_t bytesLength)> callback) |
| |
| bool | registerCustomAction (std::string name, CallbackFunction callback, CallbackArgsManifest manifest) |
| |
| bool | registerCustomAction (std::string name, CallbackFunction callback) |
| |
| bool | queueAndSend (MessageDTO message) |
| |
| bool | sendBytes (uint32_t destinationId, const uint8_t *const payload, uint16_t payloadSize) |
| |
| uint32_t | getSwarmAgentId () const |
| |
| bool | sendNeighborUpdateRequest (uint16_t neighborId) |
| |
| bool | sendNeighborListUpdateRequest () |
| |
◆ HiveMindBridgeImpl()
| HiveMindBridgeImpl::HiveMindBridgeImpl |
( |
ITCPServer & |
tcpServer, |
|
|
IHiveMindHostSerializer & |
serializer, |
|
|
IHiveMindHostDeserializer & |
deserializer, |
|
|
IUserCallRequestHandler & |
userCallRequestManager, |
|
|
IHiveMindHostRequestHandler & |
hmRequestHandler, |
|
|
IUserCallbackMap & |
userCallbackMap, |
|
|
IMessageHandler & |
messageHandler, |
|
|
IThreadSafeQueue< MessageDTO > & |
inboundQueue, |
|
|
IThreadSafeQueue< OutboundRequestHandle > & |
outboundQueue, |
|
|
ILogger & |
logger, |
|
|
uint32_t |
keepAliveNbSpin |
|
) |
| |
Construct a HiveMind Bridge object by injecting already-initialised objects.
- Parameters
-
| tcpServer | A TCPServer to be used |
| serializer | A HiveMindHostSerializer to be used |
| deserializer | A HiveMindHostDeserializer to be used |
| userCallRequestManager | A manager for the usercall request |
| hmRequestHandler | A request handler |
| userCallbackMap | A map of the usercallback |
| messageHandler | A MessageHandler to be used |
| inboundQueue | A ThreadSafeQueue to be used for inbound messages |
| outboundQueue | A ThreadSafeQueue to be used for outbound request handles |
| logger | The logger used in the bridge |
| keepAliveNbSpin | Number of call to spin before a greet is sent to keep the connection alive. Set to 0 to disable |
◆ ~HiveMindBridgeImpl()
| HiveMindBridgeImpl::~HiveMindBridgeImpl |
( |
| ) |
|
◆ getSwarmAgentId()
| uint32_t HiveMindBridgeImpl::getSwarmAgentId |
( |
| ) |
const |
◆ greet()
| bool HiveMindBridgeImpl::greet |
( |
| ) |
|
|
private |
◆ inboundThread()
| void HiveMindBridgeImpl::inboundThread |
( |
| ) |
|
|
private |
◆ isTCPClientConnected()
| bool HiveMindBridgeImpl::isTCPClientConnected |
( |
| ) |
|
|
private |
◆ onBytesReceived()
| bool HiveMindBridgeImpl::onBytesReceived |
( |
std::function< void(uint8_t *bytes, uint64_t bytesLength)> |
callback | ) |
|
◆ onConnect()
| void HiveMindBridgeImpl::onConnect |
( |
std::function< void()> |
hook | ) |
|
◆ onDisconnect()
| void HiveMindBridgeImpl::onDisconnect |
( |
std::function< void()> |
hook | ) |
|
◆ outboundThread()
| void HiveMindBridgeImpl::outboundThread |
( |
| ) |
|
|
private |
◆ queueAndSend()
| bool HiveMindBridgeImpl::queueAndSend |
( |
MessageDTO |
message | ) |
|
◆ registerCustomAction() [1/2]
| bool HiveMindBridgeImpl::registerCustomAction |
( |
std::string |
name, |
|
|
CallbackFunction |
callback |
|
) |
| |
◆ registerCustomAction() [2/2]
◆ sendBytes()
| bool HiveMindBridgeImpl::sendBytes |
( |
uint32_t |
destinationId, |
|
|
const uint8_t *const |
payload, |
|
|
uint16_t |
payloadSize |
|
) |
| |
◆ sendNeighborListUpdateRequest()
| bool HiveMindBridgeImpl::sendNeighborListUpdateRequest |
( |
| ) |
|
◆ sendNeighborUpdateRequest()
| bool HiveMindBridgeImpl::sendNeighborUpdateRequest |
( |
uint16_t |
neighborId | ) |
|
◆ sendReturn()
◆ spin()
| void HiveMindBridgeImpl::spin |
( |
| ) |
|
◆ m_deserializer
| IHiveMindHostDeserializer& HiveMindBridgeImpl::m_deserializer |
|
private |
◆ m_hmRequestHandler
◆ m_inboundQueue
◆ m_inboundRequestsQueue
◆ m_inboundResponsesMap
◆ m_inboundThread
| std::thread HiveMindBridgeImpl::m_inboundThread |
|
private |
◆ m_keepAliveCounter
| uint32_t HiveMindBridgeImpl::m_keepAliveCounter = 0 |
|
private |
◆ m_keepAliveNbSpin
| const uint32_t HiveMindBridgeImpl::m_keepAliveNbSpin |
|
private |
◆ m_logger
| ILogger& HiveMindBridgeImpl::m_logger |
|
private |
◆ m_messageHandler
◆ m_mutex
| std::mutex HiveMindBridgeImpl::m_mutex |
|
private |
◆ m_outboundQueue
◆ m_outboundThread
| std::thread HiveMindBridgeImpl::m_outboundThread |
|
private |
◆ m_serializer
| IHiveMindHostSerializer& HiveMindBridgeImpl::m_serializer |
|
private |
◆ m_swarmAgentID
| uint32_t HiveMindBridgeImpl::m_swarmAgentID = 0 |
|
private |
◆ m_tcpServer
◆ m_userCallbackMap
◆ m_userCallRequestHandler
The documentation for this class was generated from the following files: