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

Reference-counted root of the engine's polymorphic object graph. More...

#include <attachment.h>

Inheritance diagram for Attachment:

Public Member Functions

 Attachment ()
virtual ~Attachment ()
int Release ()
 Give back one reference and destroy the object once the last one is gone.
virtual void Destroy ()
 Destroy the object.

Static Public Member Functions

static void ReleaseIfSet (Attachment *pAttachment)
 Give back one reference to an object that may be null.

Public Attributes

int mRefs

Detailed Description

Reference-counted root of the engine's polymorphic object graph.

Its RTTI descriptor is at 0x0086f5a0. It has no base. The class supplies the virtual destructor that every derived class shares. A derived class that declares further virtuals receives a second vptr rather than extending this vtable. The one data word is declared first. The vptr therefore sits after it at +0x04, and the class is eight bytes. The destructor is declared ahead of Destroy(). The table at 0x00821728 runs GetTypeInfo, the destructor, then Destroy().

A fresh object starts with one reference. Release() gives one back, and the last release dispatches Destroy(), which deletes the object through the virtual destructor.

Callers increment mRefs directly rather than through a method, because the image declares no AddRef. Task::Start() does so on its own object when it hands a task to the run ring. Sch::TimedCommand's constructor at 0x005d32f8 instead increments the count of a separate Sch::Command that it stores, and Sch::Command does not derive from Sch::TimedCommand. Access from an unrelated class is why the field is public rather than protected.

Sch::Command, Sch::TempoMap, Sch::TimedCommand, Source, Task, TickTask, TimeTask, MultiMuse, and Phrase all derive from this class. Task derives virtually.

Constructor & Destructor Documentation

◆ Attachment()

Attachment::Attachment ( )
inline

◆ ~Attachment()

virtual Attachment::~Attachment ( )
virtual
Ghidra address:
NTSC-U/C: 0x004bfe30
Ghidra address:
PAL: 0x004fded0

Member Function Documentation

◆ Release()

int Attachment::Release ( )

Give back one reference and destroy the object once the last one is gone.

Returns
The remaining reference count, or zero once the object has been destroyed.
Ghidra address:
NTSC-U/C: 0x004bfe60
Ghidra address:
PAL: 0x004fdf00

◆ Destroy()

virtual void Attachment::Destroy ( )
virtual

Destroy the object.

The default implementation deletes the object through the virtual destructor.

Ghidra address:
NTSC-U/C: 0x004bfea8
Ghidra address:
PAL: 0x004fdf48

◆ ReleaseIfSet()

void Attachment::ReleaseIfSet ( Attachment * pAttachment)
inlinestatic

Give back one reference to an object that may be null.

Passed as a function to std::for_each by the command scheduler, the phrase database, and the playback reader. The body is inline. Its units emit identical copies, at 0x001b8d40 and 0x004ac5e8. The title is inferred.

Parameters
pAttachmentThe object, or null.
Ghidra address:
NTSC-U/C: 0x001b8d40
Ghidra address:
PAL: 0x001beb18

Member Data Documentation

◆ mRefs

int Attachment::mRefs

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