|
resonance 1.0.1
|
Message sink that runs the script text a message supplies. More...
#include <scriptsink.h>


Public Member Functions | |
| ScriptSink (Globals *pOwner) | |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the tagged heap under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Release a sink to the tagged heap. | |
| virtual | ~MsgSink () |
| virtual void | Dispatch (Message *pMsg) |
| Accept a message. | |
Static Public Member Functions | |
| static ScriptSink * | CreateInstance (Globals *pOwner) |
| Build a sink on the heap. | |
Protected Member Functions | |
| virtual void | DispatchPriv (Message *pMsg) |
| Run the message's script text when the message is a ScriptMsg. | |
Message sink that runs the script text a message supplies.
Its RTTI descriptor is at 0x00901e60. It has MsgSink as its one base. The object is eight bytes. The compiler-generated vptr lands at offset 0, and the Globals back pointer occupies +0x04. Globals::InitServices() at 0x001170d0 allocates eight bytes, stores the Globals pointer at +0x04, and writes the vptr, and CreateInstance() does the same. The table at 0x007cee50 runs GetTypeInfo, the destructor, the inherited MsgSink::Dispatch(), then the override below.
Globals creates the single instance in Init() and destroys it in Shutdown(). The sink accepts every message, acts only on one identity, and is registered broadly. The allocation tag on both construction paths reads MsgSink rather than ScriptSink, because a tag names the class that declares the operator and this class inherits the pair from its base.
The Globals back pointer is private, because no recovered routine reads it. The constructor stores it and nothing else recovered so far uses it.
| ScriptSink::ScriptSink | ( | Globals * | pOwner | ) |
| pOwner | The globals this sink belongs to. |
|
static |
Build a sink on the heap.
The body is the same allocation and construction Globals::InitServices() inlines. No caller is recovered. The name is inferred.
| pOwner | The globals the sink belongs to. |
|
protectedvirtual |
Run the message's script text when the message is a ScriptMsg.
Ignores every message whose identity is not g_nScriptMsgType. For a ScriptMsg it builds an HxStr from ScriptMsg::mScript, substituting the program-wide empty string for a null buffer, and passes it to RunScript().
| pMsg | The message. |
Implements MsgSink.