#include <chrono>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <boost/asio.hpp>
#include <boost/filesystem.hpp>
#include <boost/noncopyable.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include "ChannelEventHandlersImpl.h"
#include "ChannelMessageHandlersImpl.h"
#include "CommandAttachmentImpl.h"
#include "Logger.h"
#include "MonitoringThread.h"
#include "ProtocolDef.h"
Go to the source code of this file.
◆ BEGIN_MSG_MAP
#define BEGIN_MSG_MAP |
( |
|
theClass | ) |
|
◆ END_MSG_MAP
Value:default: \
LOG(
dds::misc::error) <<
"The received message doesn't have a handler: " << _currentMsg->toString(); \
} \
} \
catch (std::exception & _e) \
{ \
LOG(
dds::misc::error) <<
"Channel processMessage (" << _currentMsg->toString() <<
"): " << _e.what(); \
} \
}
◆ MESSAGE_HANDLER
#define MESSAGE_HANDLER |
( |
|
msg, |
|
|
|
func |
|
) |
| |
Value:case msg: \
{ \
typedef typename SCommandAttachmentImpl<msg>::ptr_t attahcmentPtr_t; \
attahcmentPtr_t attachmentPtr = SCommandAttachmentImpl<msg>::decode(_currentMsg); \
LOG(
dds::misc::debug) <<
"Processing " << g_cmdToString[msg] <<
" received from " << remoteEndIDString(); \
processed = func(attachmentPtr, sender); \
if (!processed) \
{ \
if (!handlerExists(msg)) \
{ \
LOG(
dds::misc::error) <<
"The received message was not processed and has no registered handler: " \
<< _currentMsg->toString(); \
} \
else \
{ \
dispatchHandlers<>(msg, sender, attachmentPtr); \
} \
} \
break; \
}
◆ MESSAGE_HANDLER_DISPATCH
#define MESSAGE_HANDLER_DISPATCH |
( |
|
msg | ) |
|
Value:case msg: \
{ \
(void)processed; \
typedef typename SCommandAttachmentImpl<msg>::ptr_t attahcmentPtr_t; \
attahcmentPtr_t attachmentPtr = SCommandAttachmentImpl<msg>::decode(_currentMsg); \
LOG(
dds::misc::debug) <<
"Dispatching " << g_cmdToString[msg] <<
" received from " << remoteEndIDString(); \
if (!handlerExists(msg)) \
{ \
LOG(
dds::misc::error) <<
"The received message can't be dispatched, it has no registered handler: " \
<< _currentMsg->toString(); \
} \
else \
{ \
dispatchHandlers<>(msg, sender, attachmentPtr); \
} \
break; \
}
◆ RAW_MESSAGE_HANDLER
#define RAW_MESSAGE_HANDLER |
( |
|
theClass, |
|
|
|
func |
|
) |
| |
Value: default: \
break; \
} \
processed = func(_currentMsg); \
if (!processed) \
{ \
{ \
LOG(
dds::misc::error) <<
"The received message was not processed and has no registered handler: " \
<< _currentMsg->toString(); \
} \
else \
{ \
} \
} \
} \
catch (std::exception & _e) \
{ \
} \
}
Definition: ProtocolCommands.h:29
#define BEGIN_MSG_MAP(theClass)
Definition: BaseChannelImpl.h:43
◆ REGISTER_DEFAULT_REMOTE_ID_STRING
#define REGISTER_DEFAULT_REMOTE_ID_STRING |
Value:std::string _remoteEndIDString() \
{ \
return "DDS Server"; \
}