MessageData Class Reference

abstract

#include <c4d_messagedata.h>

Inheritance diagram for MessageData:
Inheritance graph
[ legend ]

详细描述

A data class for creating message plugins.
使用 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)); }

公共成员函数

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)

成员函数文档编制

◆  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.

返回
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.

另请参阅
The article Core Messages 了解更多信息。
参数
[in] id The core message ID: EVMSG
[in] bc The core message container.
返回
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
定义: c4d_messagedata.h:64
String
定义: c4d_string.h:38
MSG_TIMER
#define MSG_TIMER
定义: c4d_messageplugin.h:19
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
NewObj
#define NewObj(T,...)
定义: newobj.h:108
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53
MessageData::GetTimer
virtual Int32 GetTimer(void)
BaseContainer
定义: c4d_basecontainer.h:46