DDS  ver. 3.4
Classes | Namespaces | Macros
BaseEventHandlersImpl.h File Reference
#include <boost/signals2/signal.hpp>

Go to the source code of this file.

Classes

struct  dds::protocol_api::SSenderInfo
 
struct  dds::protocol_api::SHandlerHlpFunc
 Helpers for event dispatching. More...
 
struct  dds::protocol_api::SHandlerHlpBaseFunc< T >
 
class  dds::protocol_api::CBaseEventHandlersImpl< Event_t >
 

Namespaces

 dds
 
 dds::protocol_api
 

Macros

#define DDS_BEGIN_EVENT_HANDLERS(eventType)
 
#define DDS_END_EVENT_HANDLERS
 
#define DDS_REGISTER_EVENT_HANDLER(eventType, eventID, funcType)
 
#define DDS_DECLARE_EVENT_HANDLER_CLASS(theClass)
 

Macro Definition Documentation

◆ DDS_BEGIN_EVENT_HANDLERS

#define DDS_BEGIN_EVENT_HANDLERS (   eventType)
Value:
public: \
template <class... Args> \
void dispatchHandlers(eventType _cmd, const SSenderInfo& _sender, Args&... args) \
{ \
CBaseEventHandlersImpl<eventType>::dispatchHandlersImpl<>(_cmd, _sender, std::forward<Args>(args)...); \
} \
\
public: \
bool handlerExists(eventType _cmd) const \
{ \
return CBaseEventHandlersImpl<eventType>::handlerExistsImpl(_cmd); \
}

◆ DDS_DECLARE_EVENT_HANDLER_CLASS

#define DDS_DECLARE_EVENT_HANDLER_CLASS (   theClass)
Value:
using theClass::registerHandler; \
using theClass::dispatchHandlers; \
using theClass::handlerExists;

◆ DDS_END_EVENT_HANDLERS

#define DDS_END_EVENT_HANDLERS

◆ DDS_REGISTER_EVENT_HANDLER

#define DDS_REGISTER_EVENT_HANDLER (   eventType,
  eventID,
  funcType 
)
Value:
public: \
template <eventType _cmd, typename func_t> \
void registerHandler( \
func_t _handler, \
typename std::enable_if<std::is_same<std::integral_constant<eventType, _cmd>, \
std::integral_constant<eventType, eventID>>::value && \
std::is_convertible<func_t, std::function<funcType>>::value>::type* = nullptr) \
{ \
std::function<funcType> funcHandler(_handler); \
CBaseEventHandlersImpl<eventType>::registerHandlerImpl<_cmd>(funcHandler); \
}