ezEngine  Milestone 7
ezMessage Class Referenceabstract

Base class for all message types. Each message type has it's own id which is used to dispatch messages efficiently. More...

#include <Message.h>

Inheritance diagram for ezMessage:

Public Member Functions

virtual ezMessageClone (ezAllocatorBase *pAllocator) const =0
 Returns a copy of this allocated with the given allocator. This method is automatically implemented by adding EZ_DECLARE_MESSAGE_TYPE.
 
EZ_FORCE_INLINE ezMessageId GetId () const
 Returns the id for this message type.
 
EZ_FORCE_INLINE ezUInt16 GetSize () const
 Returns the size in byte of this message.
 
EZ_FORCE_INLINE ezUInt32 GetHash () const
 Calculates a murmur hash of the message.
 

Static Protected Member Functions

static EZ_FORCE_INLINE ezMessageId GetNextMsgId ()
 

Protected Attributes

ezMessageId m_Id
 
ezUInt16 m_uiSize
 

Static Protected Attributes

static ezMessageId s_uiNextMsgId = 0
 

Detailed Description

Base class for all message types. Each message type has it's own id which is used to dispatch messages efficiently.

To implement a custom message type derive from ezMessage and add EZ_DECLARE_MESSAGE_TYPE to the type declaration. EZ_IMPLEMENT_MESSAGE_TYPE needs to be added to a cpp.

See Also
ezRTTI
Todo:
implement serialization

The documentation for this class was generated from the following files: