DDS  ver. 3.4
Classes | Namespaces | Macros | Enumerations
BaseSMChannelImpl.h File Reference
#include <chrono>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <mutex>
#include <boost/asio.hpp>
#include <boost/date_time.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
#include <boost/noncopyable.hpp>
#include <boost/thread/thread.hpp>
#include "ChannelEventHandlersImpl.h"
#include "ChannelMessageHandlersImpl.h"
#include "CommandAttachmentImpl.h"
#include "Logger.h"

Go to the source code of this file.

Classes

class  dds::protocol_api::CBaseSMChannelImpl< T >
 

Namespaces

 dds
 
 dds::protocol_api
 

Macros

#define BEGIN_SM_MSG_MAP(theClass)
 
#define SM_MESSAGE_HANDLER(msg, func)
 
#define SM_MESSAGE_HANDLER_DISPATCH(msg)
 
#define END_SM_MSG_MAP()
 
#define SM_RAW_MESSAGE_HANDLER(theClass, func)
 

Enumerations

enum  dds::protocol_api::EMQOpenType { dds::protocol_api::EMQOpenType::CreateOnly, dds::protocol_api::EMQOpenType::OpenOrCreate, dds::protocol_api::EMQOpenType::OpenOnly }
 

Macro Definition Documentation

◆ BEGIN_SM_MSG_MAP

#define BEGIN_SM_MSG_MAP (   theClass)
Value:
public: \
friend protocol_api::CBaseSMChannelImpl<theClass>; \
void processMessage(protocol_api::CProtocolMessage::protocolMessagePtr_t _currentMsg) \
{ \
if (!m_started) \
return; \
\
using namespace dds; \
using namespace dds::protocol_api; \
bool processed = true; \
ECmdType currentCmd = static_cast<ECmdType>(_currentMsg->header().m_cmd); \
SSenderInfo sender; \
sender.m_ID = _currentMsg->header().m_ID; \
\
try \
{ \
switch (currentCmd) \
{
Definition: AgentsInfoCmd.h:12
Definition: AgentConnectionManager.h:13

◆ END_SM_MSG_MAP

#define END_SM_MSG_MAP ( )
Value:
default: \
LOG(MiscCommon::error) << "The received SM message doesn't have a handler: " << _currentMsg->toString(); \
} \
} \
catch (std::exception & _e) \
{ \
LOG(MiscCommon::error) << "SMChannel processMessage: " << _e.what(); \
} \
}
Definition: def.h:152

◆ SM_MESSAGE_HANDLER

#define SM_MESSAGE_HANDLER (   msg,
  func 
)
Value:
case msg: \
{ \
typedef typename SCommandAttachmentImpl<msg>::ptr_t attahcmentPtr_t; \
attahcmentPtr_t attachmentPtr = SCommandAttachmentImpl<msg>::decode(_currentMsg); \
processed = func(attachmentPtr, sender); \
if (!processed) \
{ \
if (!handlerExists(msg)) \
{ \
LOG(MiscCommon::error) << "The received message was not processed and has no registered handler: " \
<< _currentMsg->toString(); \
} \
else \
{ \
dispatchHandlers(msg, sender, attachmentPtr); \
} \
} \
break; \
}
std::shared_ptr< SEmptyCmd > ptr_t
Definition: CommandAttachmentImpl.h:64
static ptr_t decode(CProtocolMessage::protocolMessagePtr_t _msg)
Definition: CommandAttachmentImpl.h:66
Definition: def.h:152

◆ SM_MESSAGE_HANDLER_DISPATCH

#define SM_MESSAGE_HANDLER_DISPATCH (   msg)
Value:
case msg: \
{ \
processed = false; \
typedef typename SCommandAttachmentImpl<msg>::ptr_t attahcmentPtr_t; \
attahcmentPtr_t attachmentPtr = SCommandAttachmentImpl<msg>::decode(_currentMsg); \
LOG(MiscCommon::debug) << "Dispatching " << g_cmdToString[msg]; \
if (!handlerExists(msg)) \
{ \
LOG(MiscCommon::error) << "The received message can't be dispatched, it has no registered handler: " \
<< _currentMsg->toString(); \
} \
else \
{ \
dispatchHandlers<>(msg, sender, attachmentPtr); \
} \
break; \
}
std::shared_ptr< SEmptyCmd > ptr_t
Definition: CommandAttachmentImpl.h:64
static ptr_t decode(CProtocolMessage::protocolMessagePtr_t _msg)
Definition: CommandAttachmentImpl.h:66
Definition: def.h:152
Definition: def.h:149

◆ SM_RAW_MESSAGE_HANDLER

#define SM_RAW_MESSAGE_HANDLER (   theClass,
  func 
)