wavelength 1.0.0
Loading...
Searching...
No Matches
MsgSource Class Reference

Sender of engine messages, which stores the list of sinks that receive them. More...

#include <msgsource.h>

Inheritance diagram for MsgSource:

Public Member Functions

 MsgSource ()
 Construct a source with no sinks.
virtual ~MsgSource ()
 Release the list of sinks.
virtual void AddSink (MsgSink *pSink)
 Register a sink, ignoring a sink that is already registered.
virtual void RemoveSink (MsgSink *pSink)
 Unregister the first occurrence of a sink.
void Send (Message *pMsg)
 Deliver a message to every registered sink, in registration order.
bool SendUntilHandled (Message *pMsg)
 Deliver a message to the registered sinks in registration order until one handles it.
 MsgSource ()
 Create a source with no sinks.
virtual ~MsgSource ()
 Free the list of sinks.
virtual void AddSink (MsgSink *sink)
 Add a sink at the end of the list, unless it is already there.
virtual void RemoveSink (MsgSink *sink)
 Remove a sink, which must be in the list.

Public Attributes

int mGraphBuilt

Detailed Description

Sender of engine messages, which stores the list of sinks that receive them.

Sender of messages to a list of sinks.

The RTTI includes the class name and records no base. The data members precede the vptr, which sits at +0x0c. A sink removed while a message is being delivered is first cleared, and the delivery loop removes the cleared entry.

The RTTI records the class. The object is 0xc bytes. The name of the flag at +0x04 follows the game's MsgSource; its meaning here is inferred from RemoveSink().

Constructor & Destructor Documentation

◆ MsgSource() [1/2]

MsgSource::MsgSource ( )

Construct a source with no sinks.

Ghidra address:
NTSC-U/C: 0x0029d150
Ghidra address:
PAL: 0x002a6e18

◆ ~MsgSource() [1/2]

virtual MsgSource::~MsgSource ( )
virtual

Release the list of sinks.

Ghidra address:
NTSC-U/C: 0x003ab3d0
Ghidra address:
PAL: 0x0041a130

◆ MsgSource() [2/2]

MsgSource::MsgSource ( )

Create a source with no sinks.

Ghidra address:
0x100199e0

◆ ~MsgSource() [2/2]

virtual MsgSource::~MsgSource ( )
virtual

Free the list of sinks.

The sinks are not destroyed.

Ghidra address:
0x1000eb50

Member Function Documentation

◆ AddSink() [1/2]

virtual void MsgSource::AddSink ( MsgSink * pSink)
virtual

Register a sink, ignoring a sink that is already registered.

Parameters
pSinkThe sink to register.
Ghidra address:
NTSC-U/C: 0x0029d1d8
Ghidra address:
PAL: 0x002a6ea0

◆ RemoveSink() [1/2]

virtual void MsgSource::RemoveSink ( MsgSink * pSink)
virtual

Unregister the first occurrence of a sink.

During a delivery the entry is cleared instead. A sink that is not registered is ignored.

Parameters
pSinkThe sink to unregister.
Ghidra address:
NTSC-U/C: 0x0029d2a8
Ghidra address:
PAL: 0x002a6f70

◆ Send()

void MsgSource::Send ( Message * pMsg)

Deliver a message to every registered sink, in registration order.

Parameters
pMsgThe message to deliver.
Ghidra address:
NTSC-U/C: 0x0029d338
Ghidra address:
PAL: 0x002a7000

◆ SendUntilHandled()

bool MsgSource::SendUntilHandled ( Message * pMsg)

Deliver a message to the registered sinks in registration order until one handles it.

Parameters
pMsgThe message to deliver.
Returns
Whether a sink handled the message.
Ghidra address:
NTSC-U/C: 0x0029d420
Ghidra address:
PAL: 0x002a70e8

◆ AddSink() [2/2]

virtual void MsgSource::AddSink ( MsgSink * sink)
virtual

Add a sink at the end of the list, unless it is already there.

Parameters
sinkThe sink.
Ghidra address:
0x10019a60

◆ RemoveSink() [2/2]

virtual void MsgSource::RemoveSink ( MsgSink * sink)
virtual

Remove a sink, which must be in the list.

While mGraphBuilt is set, its entry is cleared instead.

Parameters
sinkThe sink.
Ghidra address:
0x10019ae0

Member Data Documentation

◆ mGraphBuilt

int MsgSource::mGraphBuilt

While set, RemoveSink() clears entries instead of erasing them.


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