DDS  ver. 3.6
Classes | Namespaces | Macros | Typedefs
BaseChannelImpl.h File Reference
#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.

Classes

class  dds::protocol_api::CClientChannelImpl< T >
 
class  dds::protocol_api::CServerChannelImpl< T >
 
struct  dds::protocol_api::SBinaryAttachmentInfo
 
class  dds::protocol_api::CBaseChannelImpl< T >
 

Namespaces

 dds
 Miscellaneous functions and helpers are located here.
 
 dds::protocol_api
 

Macros

#define BEGIN_MSG_MAP(theClass)
 
#define MESSAGE_HANDLER(msg, func)
 
#define MESSAGE_HANDLER_DISPATCH(msg)
 
#define END_MSG_MAP()
 
#define RAW_MESSAGE_HANDLER(theClass, func)
 
#define REGISTER_DEFAULT_REMOTE_ID_STRING
 

Typedefs

typedef std::shared_ptr< SBinaryAttachmentInfo > dds::protocol_api::binaryAttachmentInfoPtr_t
 

Macro Definition Documentation

◆ BEGIN_MSG_MAP

#define BEGIN_MSG_MAP (   theClass)

◆ END_MSG_MAP

#define 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(); \
} \
}
Definition: def.h:149

◆ 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; \
}
Definition: def.h:146
Definition: def.h:149

◆ 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; \
}
Definition: def.h:146
Definition: def.h:149

◆ RAW_MESSAGE_HANDLER

#define RAW_MESSAGE_HANDLER (   theClass,
  func 
)
Value:
BEGIN_MSG_MAP(theClass) \
default: \
break; \
} \
processed = func(_currentMsg); \
if (!processed) \
{ \
if (!handlerExists(ECmdType::cmdRAW_MSG)) \
{ \
LOG(dds::misc::error) << "The received message was not processed and has no registered handler: " \
<< _currentMsg->toString(); \
} \
else \
{ \
dispatchHandlers(ECmdType::cmdRAW_MSG, sender, _currentMsg); \
} \
} \
} \
catch (std::exception & _e) \
{ \
LOG(dds::misc::error) << "Channel processMessage: " << _e.what(); \
} \
}
Definition: ProtocolCommands.h:29
Definition: def.h:149
#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"; \
}