resonance 1.0.1
Loading...
Searching...
No Matches
RendererBase::Router Class Reference

Sink that forwards every message it receives to one other sink. More...

#include <rendererbase.h>

Inheritance diagram for RendererBase::Router:
Collaboration diagram for RendererBase::Router:

Public Member Functions

virtual void Dispatch (Message *pMsg)
 Forward the message to the target sink.
virtual void DispatchPriv (Message *pMsg)
 Receive a message directly, which this class ignores.
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 ()

Public Attributes

MsgSink * mTarget
 The sink every message is handed to.

Detailed Description

Sink that forwards every message it receives to one other sink.

Its RTTI descriptor is at 0x00901fa0, recorded as single inheritance from MsgSink at offset 0. The object is eight bytes: the four-byte MsgSink subobject, whose table pointer sits at offset 0, followed by the target at +0x04.

172 tables in the image place the shared MsgSink::Dispatch() body at slot 2. This class and RendererBase are the two that override it, and the tables of RendererBase's subclasses inherit RendererBase's override.

The destructor at 0x00139d70 is implicitly declared. It is byte-identical to MsgSink's, because a trivial derived destructor stores only the base table pointer.

Member Function Documentation

◆ Dispatch()

virtual void RendererBase::Router::Dispatch ( Message * pMsg)
virtual

Forward the message to the target sink.

The body reads the target from +0x04, takes the delta and the function pointer of that target's own table slot 3, and dispatches with the adjusted receiver. The message itself is never touched: it stays in the argument register the caller placed it in and passes through to the target unchanged. Dispatching slot 3 rather than slot 2 means the target's DispatchPriv() runs directly, so a chain of routers cannot form.

Parameters
pMsgThe message to forward.
Ghidra address:
NTSC-U/C: 0x00139f50
Ghidra address:
PAL: 0x0013a898

Reimplemented from MsgSink.

◆ DispatchPriv()

virtual void RendererBase::Router::DispatchPriv ( Message * pMsg)
virtual

Receive a message directly, which this class ignores.

The body is empty. The class exists to forward through Dispatch(), so the slot that would consume a message has nothing to do. MsgSink declares it pure, so an override has to exist for the class to be concrete.

Parameters
pMsgThe message, which the body does not read.
Ghidra address:
NTSC-U/C: 0x00139f48
Ghidra address:
PAL: 0x0013a890

Implements MsgSink.

Member Data Documentation

◆ mTarget

MsgSink* RendererBase::Router::mTarget

The sink every message is handed to.

+0x04

Public because RendererBase's constructor writes it directly, and an enclosing class has no access to a nested class's private members. A friend declaration fits equally well.


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