VR-Engage  2.2
Loading...
Searching...
No Matches
vreMessageManager.h File Reference
Include dependency graph for vreMessageManager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  makVre::DtVreMessageManager
 
struct  makVre::DtVreMessageManager::EventStats
 

Namespaces

namespace  makVre
 

Macros

Message Type Assertion Macros
#define ASSERT_TYPE(msg, MsgType, msgCast)
 
#define ASSERT_TYPE_NO_CAST(msg, MsgType)
 

Detailed Description

This file contains the DtVreMessageManager abstract base class which serves as the central hub for message routing and dispatching in the VREngage system. It provides a thread-safe mechanism for registering message handlers, queuing messages, and dispatching messages to appropriate handlers across multiple threads.

Macro Definition Documentation

◆ ASSERT_TYPE

#define ASSERT_TYPE ( msg,
MsgType,
msgCast )
Value:
DtASSERT(dynamic_cast<MsgType*>(msg), "Message is incorrect type"); \
MsgType* msgCast = static_cast<MsgType*>(msg);
#define DtASSERT(exp, description)
Primary assertion macro for runtime validation.
Definition assert.h:53

Asserts that a message is of the expected type and casts it.

Parameters
msgPointer to the message to check and cast
MsgTypeExpected message type (class name)
msgCastVariable name for the cast message pointer

This macro checks that a message is of the expected type using dynamic_cast, and then creates a properly typed pointer to the message using static_cast. It should be used when handling messages for which you have registered a handler with the exact message type (no wildcards).

◆ ASSERT_TYPE_NO_CAST

#define ASSERT_TYPE_NO_CAST ( msg,
MsgType )
Value:
DtASSERT(dynamic_cast<MsgType*>(msg), "Message is incorrect type");

Asserts that a message is of the expected type without casting it.

Parameters
msgPointer to the message to check
MsgTypeExpected message type (class name)

This macro checks that a message is of the expected type using dynamic_cast, but does not create a cast pointer. It should be used when handling messages for which you have registered a handler with the exact message type (no wildcards) and you don't need to access type-specific members of the message.