resonance 1.0.1
Loading...
Searching...
No Matches
SpewTable Class Reference

Registry that routes each source file's diagnostic stream to a named output channel. More...

#include <spewtable.h>

Classes

struct  Channel
 Output channel, 0xc bytes, created by Connect() and destroyed by the destructor. More...
struct  Connection
 One source file's registration, 0x10 bytes. More...

Public Member Functions

 SpewTable ()
 Construct an empty registry.
 ~SpewTable ()
 Close every channel and release both lists.
void Register (std::ostream **ppStream, const char *pszFile)
 Register a source file's stream pointer.
void Connect (const HxStr &file, const HxStr &channel)
 Point the registered streams of a source file at a channel.
void PrintConnections (std::ostream &stream)
 Write every registration and its channel name, one per line.

Static Public Member Functions

static SpewTable & shared ()
 Report the one registry, constructing it on first use.

Detailed Description

Registry that routes each source file's diagnostic stream to a named output channel.

The class emits no RTTI. Its name comes from the debugging symbols of the North American demo release. The one instance is a function-local static of shared() at 0x00894df8, 0x18 bytes, destroyed at exit through the thunk at 0x004b4660.

A source file registers the address of its stream pointer under its own base name through SpewRegister. Connect() then points every registered stream of a file at a channel, creating the channel on first use. A channel is the console, nothing, or a file of that name.

Constructor & Destructor Documentation

◆ SpewTable()

SpewTable::SpewTable ( )

Construct an empty registry.

Ghidra address:
NTSC-U/C: 0x004b32b8
Ghidra address:
PAL: 0x004f14f8

◆ ~SpewTable()

SpewTable::~SpewTable ( )

Close every channel and release both lists.

Ghidra address:
NTSC-U/C: 0x004b32e8
Ghidra address:
PAL: 0x004f1528

Member Function Documentation

◆ shared()

SpewTable & SpewTable::shared ( )
inlinestatic

Report the one registry, constructing it on first use.

The body is inline. SpewRegister's constructor expands it, and the script binding calls the out-of-line copy.

Returns
The registry.
Ghidra address:
NTSC-U/C: 0x004b4470
Ghidra address:
PAL: 0x004f2780

◆ Register()

void SpewTable::Register ( std::ostream ** ppStream,
const char * pszFile )

Register a source file's stream pointer.

The file name loses its extension and its directory, is lower-cased, and is appended with no channel.

Parameters
ppStreamThe file's stream pointer.
pszFileThe source file name.
Ghidra address:
NTSC-U/C: 0x004b3528
Ghidra address:
PAL: 0x004f1790

◆ Connect()

void SpewTable::Connect ( const HxStr & file,
const HxStr & channel )

Point the registered streams of a source file at a channel.

The channel name is lower-cased and the channel created on first use. The file name is lower-cased, and the first registration of that name receives the channel's stream. A file that was never registered only creates the channel.

Parameters
fileThe source file's base name.
channelThe channel name: off, console, debug, or a file to write.
Ghidra address:
NTSC-U/C: 0x004b36b8
Ghidra address:
PAL: 0x004f1960

◆ PrintConnections()

void SpewTable::PrintConnections ( std::ostream & stream)

Write every registration and its channel name, one per line.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x004b4550
Ghidra address:
PAL: 0x004f2860

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