|
resonance 1.0.1
|
Base of every event the game passes between a MsgSource and a MsgSink. More...
#include <message.h>

Public Member Functions | |
| void * | operator new (size_t nSize) |
| Allocate a message from the tagged heap under the tag MSG. | |
| void | operator delete (void *pBlock) |
| Release a message to the tagged heap under the tag MSG. | |
| virtual | ~Message () |
| Vtable slot 1. | |
| virtual Message * | Clone ()=0 |
| Produce a heap copy of this message. | |
| virtual int | Type ()=0 |
| Report this message's registered identity. | |
| virtual const char * | GetName () const =0 |
| Report this message's class name. | |
| virtual void | PrintExtra (std::ostream &stream) const |
| Write this message's payload to a stream. | |
| virtual void | saveGuts (OBStream &stream) const |
| Write this message's payload to an output stream. | |
| virtual void | restoreGuts (IBStream &stream) |
| Read this message's payload from an input stream. | |
| std::ostream & | Print (std::ostream &stream) const |
| Write this message to a diagnostic stream as {GetName() PrintExtra()}. | |
Static Public Member Functions | |
| static Message * | NewMessage (int nType) |
| Produce a message of the identified class through the factory list. | |
Base of every event the game passes between a MsgSource and a MsgSink.
Its RTTI descriptor is at 0x0086f638. It has no base and no data members. The compiler-generated vptr lands at offset 0 and every derived message adds its payload after it. The RTTI lists 124 derived classes, among them ScriptMsg, GemMsg, LeaveGameMsg, and Packet.
Every vtable in the family is eight entries, and the declaration order below reproduces the order after the compiler-generated slot 0. Each one was read off the concrete implementations rather than off the declaration: a scan of the derived tables found 80 classes that implement Clone(), Type(), and GetName(), while Packet and eight others inherit all three as pure and are therefore abstract themselves.
This class's own table is at 0x007ccbf8, which its destructor stores at offset 0. It has eight entries and a zero terminator at index 8, with slots 2, 3, and 4 addressing the pure-virtual stub. MsgSink's table follows it immediately at 0x007ccc40.
Slots 5, 6, and 7 all address a two-instruction jr ra stub in this class, at 0x001051f0, 0x001051f8, and 0x00105200. Every translation unit that destroys a message emits its own copy of all three stubs after its copy of the destructor, which is a second measurement of the count.
The three pure virtuals follow one pattern per class. LeaveGameMsg at 0x00812078 and GemMsg at 0x00812588 are the two worked examples cited below.
A concrete message also supplies a static New() that returns a default-constructed instance on the heap, and the translation unit at 0x003d9818 registers 92 of them against the identity Type() reports. Each registration constructs one file-scope object of a 4-byte class with the identity word immediately below it, passing the identity and the factory to the MessageFactory constructor, which inserts the pair into a sorted vector and stores nothing in the object.
|
virtual |
Vtable slot 1.
The body is empty.
A second emission at 0x003da2f0, with forty copies in other units, is the same destructor releasing through the class operator delete, OperatorDeleteOverride() under the tag MSG, where 0x001051c0 releases through the scalar free. It has no source of its own.
|
inline |
Allocate a message from the tagged heap under the tag MSG.
Defined in the class, because 69 byte-identical copies exist, one in every translation unit that allocates a message, and no call to any of them remains outside those units. The address below is the first copy.
| nSize | The object size the compiler supplies. |
|
inline |
Release a message to the tagged heap under the tag MSG.
Defined in the class for the same reason as operator new(), with 69 copies.
| pBlock | The block. |
|
pure virtual |
Produce a heap copy of this message.
An implementation allocates the derived size against the tag MSG, installs its own vtable, and copies its payload word by word. GemMsg's copies 0x18 bytes and LeaveGameMsg's copies only the vptr, because that class has no payload. MsgQueue stores the result and its destructor deletes every stored message, so the queue owns the copies.
Implemented in AdvanceSectionMsg, AdvanceSectionToggleMsg, AllNotesOffMsg, AutoCatchMsg, AxeButtonMsg, AxisFXMsg, AxisRegisterMsg, AxisXPowMsg, AxisYPowMsg, BarStatusMsg, BeginGameLocalMsg, BeginPhraseCatchMsg, BSLoadLevelPacket, BumpMsg, BumpPacket, ButtonPowMsg, CatchMsg, CatchProgressPacket, CaughtBarMsg, CaughtPhrasePacket, CaughtPowerbarMsg, ChoosePowerupMsg, ClearGemMsg, ClearGemsMsg, ContCtrlMsg, CrippleMsg, CripplePacket, CSClientStatusPacket, CSInitiatePlayPacket, DeployedPowerupMsg, DisplayPointerMsg, DurGemMsg, EnableFreestyleMsg, EndGameMsg, EraseMsg, EraseOffMsg, FadeGameMsg, FreestyleFXMsg, GameBeginMsg, GameChatPacket, GameConnectFailureMsg, GameConnectionLostMsg, GameConnectSuccessMsg, GameManagerDoPlaybackMsg, GameOverMsg, GemMsg, GemPacket, InvalidateSeekerMsg, InvalidateTrackMsg, IsRecordingMsg, JamEffectMsg, JuiceAmountMsg, LeaveGameMsg, LobbyConnectionLostMsg, LoopToggleMsg, LoopToolMsg, MetFreqEndedMsg, MetStartNetLaunchMsg, MetStartPauseMsg, MetUnlockStagesMsg, MultiMuseMsg, MultiplierMsg, MultiplierStateMsg, NearestTrackMsg, NeutralizeMsg, NoteMsg, NowBarMsg, PauseGameSystemMsg, PhraseCapturedMsg, PhraseMsg, PhraseMuffedMsg, PhrasePacket, PitchMsg, PitchRiffMsg, PlaybackModeMsg, PlaybackToggleMsg, PlayerLeftGameMsg, PlayersTrackNeutralizedMsg, PointAmountMsg, PowerupCountMsg, PowerupFailedMsg, PSJoinRequestPacket, RawControllerMsg, RefreshNetMsg, RemixFXMsg, RemoteTrackSelectMsg, RotLeftMsg, RotRightMsg, SCAllClientsStatusPacket, SCAllPlayersInfoPacket, SCGameOverPacket, SCLoadLevelPacket, SCPlayerJoinedPacket, ScriptMsg, SCStartPlayingPacket, SectionCapturedMsg, SeekerMsg, ShowEraseEffectMsg, SPJoinAcceptPacket, SPJoinDenyPacket, StdMidiMsg, StopRiffMsg, StreakOverMsg, SusGemMsg, SustainNoteMsg, TestArbiterPacket, TextMsg, ToggleGhostMsg, TrackSelectMsg, TrackSelectPacket, TracksOnMsg, UnpauseGameSystemMsg, UpdateScorePacket, and WinMsg.
|
pure virtual |
Report this message's registered identity.
An implementation returns one word from the per-class identity table that spans 0x006d01ac through 0x006d035c. A sink compares the result against the identity it listens for, which is what ScriptSink::DispatchPriv() does against 0x006d024c. The read has no side effect, so the call MsgQueue::DispatchPriv() makes and discards has none either.
Implemented in AdvanceSectionMsg, AdvanceSectionToggleMsg, AllNotesOffMsg, AutoCatchMsg, AxeButtonMsg, AxisFXMsg, AxisRegisterMsg, AxisXPowMsg, AxisYPowMsg, BarStatusMsg, BeginGameLocalMsg, BeginPhraseCatchMsg, BSLoadLevelPacket, BumpMsg, BumpPacket, ButtonPowMsg, CatchMsg, CatchProgressPacket, CaughtBarMsg, CaughtPhrasePacket, CaughtPowerbarMsg, ChoosePowerupMsg, ClearGemMsg, ClearGemsMsg, ContCtrlMsg, CrippleMsg, CripplePacket, CSClientStatusPacket, CSInitiatePlayPacket, DeployedPowerupMsg, DisplayPointerMsg, DurGemMsg, EnableFreestyleMsg, EndGameMsg, EraseMsg, EraseOffMsg, FadeGameMsg, FreestyleFXMsg, GameBeginMsg, GameChatPacket, GameConnectFailureMsg, GameConnectionLostMsg, GameConnectSuccessMsg, GameManagerDoPlaybackMsg, GameOverMsg, GemMsg, GemPacket, InvalidateSeekerMsg, InvalidateTrackMsg, IsRecordingMsg, JamEffectMsg, JuiceAmountMsg, LeaveGameMsg, LobbyConnectionLostMsg, LoopToggleMsg, LoopToolMsg, MetFreqEndedMsg, MetStartNetLaunchMsg, MetStartPauseMsg, MetUnlockStagesMsg, MultiMuseMsg, MultiplierMsg, MultiplierStateMsg, NearestTrackMsg, NeutralizeMsg, NoteMsg, NowBarMsg, PauseGameSystemMsg, PhraseCapturedMsg, PhraseMsg, PhraseMuffedMsg, PhrasePacket, PitchMsg, PitchRiffMsg, PlaybackModeMsg, PlaybackToggleMsg, PlayerLeftGameMsg, PlayersTrackNeutralizedMsg, PointAmountMsg, PowerupCountMsg, PowerupFailedMsg, PSJoinRequestPacket, RawControllerMsg, RefreshNetMsg, RemixFXMsg, RemoteTrackSelectMsg, RotLeftMsg, RotRightMsg, SCAllClientsStatusPacket, SCAllPlayersInfoPacket, SCGameOverPacket, SCLoadLevelPacket, SCPlayerJoinedPacket, ScriptMsg, SCStartPlayingPacket, SectionCapturedMsg, SeekerMsg, ShowEraseEffectMsg, SPJoinAcceptPacket, SPJoinDenyPacket, StdMidiMsg, StopRiffMsg, StreakOverMsg, SusGemMsg, SustainNoteMsg, TestArbiterPacket, TextMsg, ToggleGhostMsg, TrackSelectMsg, TrackSelectPacket, TracksOnMsg, UnpauseGameSystemMsg, UpdateScorePacket, and WinMsg.
|
pure virtual |
Report this message's class name.
An implementation returns its own name as a string literal. LeaveGameMsg returns LeaveGameMsg from 0x008116a8 and GemMsg returns GemMsg from 0x00811570.
Implemented in AdvanceSectionMsg, AdvanceSectionToggleMsg, AllNotesOffMsg, AutoCatchMsg, AxeButtonMsg, AxisFXMsg, AxisRegisterMsg, AxisXPowMsg, AxisYPowMsg, BarStatusMsg, BeginGameLocalMsg, BeginPhraseCatchMsg, BSLoadLevelPacket, BumpMsg, BumpPacket, ButtonPowMsg, CatchMsg, CatchProgressPacket, CaughtBarMsg, CaughtPhrasePacket, CaughtPowerbarMsg, ChoosePowerupMsg, ClearGemMsg, ClearGemsMsg, ContCtrlMsg, CrippleMsg, CripplePacket, CSClientStatusPacket, CSInitiatePlayPacket, DeployedPowerupMsg, DisplayPointerMsg, DurGemMsg, EnableFreestyleMsg, EndGameMsg, EraseMsg, EraseOffMsg, FadeGameMsg, FreestyleFXMsg, GameBeginMsg, GameChatPacket, GameConnectFailureMsg, GameConnectionLostMsg, GameConnectSuccessMsg, GameManagerDoPlaybackMsg, GameOverMsg, GemMsg, GemPacket, InvalidateSeekerMsg, InvalidateTrackMsg, IsRecordingMsg, JamEffectMsg, JuiceAmountMsg, LeaveGameMsg, LobbyConnectionLostMsg, LoopToggleMsg, LoopToolMsg, MetFreqEndedMsg, MetStartNetLaunchMsg, MetStartPauseMsg, MetUnlockStagesMsg, MultiMuseMsg, MultiplierMsg, MultiplierStateMsg, NearestTrackMsg, NeutralizeMsg, NoteMsg, NowBarMsg, PauseGameSystemMsg, PhraseCapturedMsg, PhraseMsg, PhraseMuffedMsg, PhrasePacket, PitchMsg, PitchRiffMsg, PlaybackModeMsg, PlaybackToggleMsg, PlayerLeftGameMsg, PlayersTrackNeutralizedMsg, PointAmountMsg, PowerupCountMsg, PowerupFailedMsg, PSJoinRequestPacket, RawControllerMsg, RefreshNetMsg, RemixFXMsg, RemoteTrackSelectMsg, RotLeftMsg, RotRightMsg, SCAllClientsStatusPacket, SCAllPlayersInfoPacket, SCGameOverPacket, SCLoadLevelPacket, SCPlayerJoinedPacket, ScriptMsg, SCStartPlayingPacket, SectionCapturedMsg, SeekerMsg, ShowEraseEffectMsg, SPJoinAcceptPacket, SPJoinDenyPacket, StdMidiMsg, StopRiffMsg, StreakOverMsg, SusGemMsg, SustainNoteMsg, TestArbiterPacket, TextMsg, ToggleGhostMsg, TrackSelectMsg, TrackSelectPacket, TracksOnMsg, UnpauseGameSystemMsg, UpdateScorePacket, and WinMsg.
|
virtual |
Write this message's payload to a stream.
The default writes nothing. GemMsg's override at 0x003d8830 streams its fields, so the member exists for diagnostics.
| stream | The stream to write to. |
Reimplemented in AutoCatchMsg, AxisFXMsg, AxisRegisterMsg, AxisXPowMsg, AxisYPowMsg, BarStatusMsg, BSLoadLevelPacket, BumpMsg, BumpPacket, ButtonPowMsg, CatchProgressPacket, CaughtPhrasePacket, CaughtPowerbarMsg, ChoosePowerupMsg, ContCtrlMsg, CrippleMsg, CripplePacket, CSClientStatusPacket, DisplayPointerMsg, EraseMsg, EraseOffMsg, GameChatPacket, GameConnectFailureMsg, GameConnectionLostMsg, GameConnectSuccessMsg, GemMsg, GemPacket, InvalidateTrackMsg, IsRecordingMsg, JuiceAmountMsg, LobbyConnectionLostMsg, MetFreqEndedMsg, MetStartNetLaunchMsg, MetStartPauseMsg, MetUnlockStagesMsg, MultiMuseMsg, NearestTrackMsg, NeutralizeMsg, NoteMsg, PhraseCapturedMsg, PhraseMsg, PhraseMuffedMsg, PhrasePacket, PitchRiffMsg, PlayerLeftGameMsg, PlayersTrackNeutralizedMsg, PointAmountMsg, PowerupCountMsg, PSJoinRequestPacket, RawControllerMsg, RefreshNetMsg, RemoteTrackSelectMsg, SCAllClientsStatusPacket, SCAllPlayersInfoPacket, SCGameOverPacket, SCLoadLevelPacket, SCPlayerJoinedPacket, SCStartPlayingPacket, SectionCapturedMsg, SeekerMsg, SPJoinAcceptPacket, SPJoinDenyPacket, StdMidiMsg, StopRiffMsg, SustainNoteMsg, TestArbiterPacket, TrackSelectMsg, TrackSelectPacket, TracksOnMsg, and UpdateScorePacket.
|
virtual |
Write this message's payload to an output stream.
Vtable slot 6. The default does nothing. An override copies each field into a temporary and hands the temporary to OBStream::WriteLE(), chaining on the stream the call returns. PSJoinRequestPacket's override at 0x003e5538 writes its four words this way and then delegates its FreqAppearance member to slot 2 of FreqAppearance.
| stream | The stream to write to. |
Reimplemented in BSLoadLevelPacket, BumpPacket, CatchProgressPacket, CaughtPhrasePacket, CripplePacket, CSClientStatusPacket, GameChatPacket, GemPacket, MultiMuseMsg, NoteMsg, Packet, PhrasePacket, PSJoinRequestPacket, SCAllClientsStatusPacket, SCAllPlayersInfoPacket, SCGameOverPacket, SCLoadLevelPacket, SCPlayerJoinedPacket, SCStartPlayingPacket, SPJoinAcceptPacket, SPJoinDenyPacket, StdMidiMsg, SustainNoteMsg, TestArbiterPacket, TrackSelectPacket, and UpdateScorePacket.
|
virtual |
Read this message's payload from an input stream.
Vtable slot 7. The default does nothing. An override passes the address of each field straight to IBStream::ReadLE() for the transfer to fill the field in place. PSJoinRequestPacket's override at 0x003e5638 reads its four words this way and then delegates its FreqAppearance member to slot 3 of FreqAppearance. Twenty-two of the classes that override this pair are packets and four are MIDI messages. The pair is therefore the wire format rather than a diagnostic.
| stream | The stream to read from. |
Reimplemented in BSLoadLevelPacket, BumpPacket, CatchProgressPacket, CaughtPhrasePacket, CripplePacket, CSClientStatusPacket, GameChatPacket, GemPacket, MultiMuseMsg, NoteMsg, Packet, PhrasePacket, PSJoinRequestPacket, SCAllClientsStatusPacket, SCAllPlayersInfoPacket, SCGameOverPacket, SCLoadLevelPacket, SCPlayerJoinedPacket, SCStartPlayingPacket, SPJoinAcceptPacket, SPJoinDenyPacket, StdMidiMsg, SustainNoteMsg, TestArbiterPacket, TrackSelectPacket, and UpdateScorePacket.
| std::ostream & Message::Print | ( | std::ostream & | stream | ) | const |
Write this message to a diagnostic stream as {GetName() PrintExtra()}.
The payload comes from PrintExtra(). PrintMuseMsgTickObj() is the one caller, and it discards the result.
| stream | The stream to write to. |
|
static |
Produce a message of the identified class through the factory list.
The list is searched with a binary search on the identity, and a hit calls the factory a MessageFactory registered. The shipped program does not call it, and operator>>(IBStream &, Message *&) expands the same search inline.
| nType | The identity to construct for. |