MessageData Class Referenceabstract

#include <c4d_messagedata.h>

Inheritance diagram for MessageData:

Detailed Description

A data class for creating message plugins.
Use RegisterMessagePlugin() to register a message plugin.

Here is an example of a message plugin, which CoreMessage() method is called each 100 ms:

#include "c4d.h"
#include "c4d_symbols.h"
class TimerMessage : public MessageData
{
virtual Int32 GetTimer(void);
virtual Bool CoreMessage(Int32 id, const BaseContainer &bc);
};
Int32 TimerMessage::GetTimer()
{
return 100;
}
Bool TimerMessage::CoreMessage(Int32 id, const BaseContainer &bc)
{
if (id==MSG_TIMER)
{
// Do something
}
return true;
}
Bool RegisterTimerMessage(void)
{
return RegisterMessagePlugin(1234567, String(), 0, NewObj(TimerMessage));
}

Public Member Functions

virtual Int32 GetTimer (void)
 
virtual Bool CoreMessage (Int32 id, const BaseContainer &bc)=0
 
- Public Member Functions inherited from BaseData
 BaseData ()
 
virtual ~BaseData (void)
 
void Destructor (void)
 

Member Function Documentation

◆ GetTimer()

virtual Int32 GetTimer ( void  )
virtual

Called to return a time in milliseconds to receive timer messages (MSG_TIMER) with that interval in .\n This method is queried again after each message.

Returns
The timer interval in milliseconds, or 0 for no timer messages.

◆ CoreMessage()

virtual Bool CoreMessage ( Int32  id,
const BaseContainer bc 
)
pure virtual

Called to receive core messages.

See also
The article Core Messages for more information.
Parameters
[in]idThe core message ID: EVMSG
[in]bcThe core message container.
Returns
Currently not used.
MessageData::CoreMessage
virtual Bool CoreMessage(Int32 id, const BaseContainer &bc)=0
RegisterMessagePlugin
Bool RegisterMessagePlugin(Int32 id, const maxon::String &str, Int32 info, MessageData *dat)
MessageData
Definition: c4d_messagedata.h:64
String
Definition: c4d_string.h:38
MSG_TIMER
#define MSG_TIMER
Definition: c4d_messageplugin.h:19
Int32
maxon::Int32 Int32
Definition: ge_sys_math.h:60
NewObj
#define NewObj(T,...)
Definition: newobj.h:108
Bool
maxon::Bool Bool
Definition: ge_sys_math.h:55
MessageData::GetTimer
virtual Int32 GetTimer(void)
BaseContainer
Definition: c4d_basecontainer.h:46