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

Abstract tick-driven task that both receives and sends messages. More...

#include <pitcher.h>

Inheritance diagram for Pitcher:
Collaboration diagram for Pitcher:

Public Member Functions

 Pitcher (Sch::TickClock *pClock)
 Construct the three bases, the TickTask one to run every bar.
virtual ~Pitcher ()
 Inline.
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 ()
virtual void Dispatch (Message *pMsg)
 Accept a message.
virtual void DispatchPriv (Message *pMsg)=0
 Act on a message.
Public Member Functions inherited from MsgSource
virtual ~MsgSource ()
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) const
 Deliver a message to every registered sink, in registration order.
void ClearSinks ()
 Unregister every sink.
Public Member Functions inherited from TickTask
 TickTask (Sch::TickClock *pClock, int nPeriod, int bAligned)
virtual ~TickTask ()
 Withdraw the queued command.
virtual void Print (std::ostream &stream)
 Write the task to a diagnostic stream.
virtual int Tick (int nElapsedTicks)=0
 Run the task.
void Start (int nEpochOffset)
 Post the task on its clock.
void Run ()
 Run Tick() for the run now due and post the next one.
void Stop ()
 Withdraw the queued command and forget its handle.
Public Member Functions inherited from Attachment
 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 Attributes

static constexpr int kBarPeriod = 1920
 The TickTask period, one bar of 1920 ticks.

Additional Inherited Members

Static Public Member Functions inherited from Attachment
static void ReleaseIfSet (Attachment *pAttachment)
 Give back one reference to an object that may be null.
Public Attributes inherited from MsgSource
int mGraphBuilt
 A word no member of this class reads.
Public Attributes inherited from Attachment
int mRefs

Detailed Description

Abstract tick-driven task that both receives and sends messages.

Its RTTI descriptor is at 0x00901c60. It has MsgSink at offset 0, MsgSource at offset 4, and TickTask at offset 24. The class declares no data member, and its destructor tears down only the two subobjects. The object is therefore 0x38 bytes, and every derived class's data starts at +0x38.

Its three tables are at 0x007e1520, 0x007e14f8, and 0x007e14c8. Two slots address the shared pure-virtual stub: MsgSink::DispatchPriv() in the primary table and TickTask::Tick() in the TickTask table. It therefore declares no virtual of its own and leaves two of its bases' pure, which is what makes it abstract.

Voxer, Scratcher, and NotePitcher derive from it and each overrides exactly those two slots. All three override Tick() by dividing the elapsed tick count by a stored divisor, so a Pitcher turns a tick rate into a position within a bar.

g++ 2.9x emitted this class's three tables into each of the three deriving translation units, at 0x007e14c8, 0x007e57e0, and 0x007e61d0, which is a second measurement of how many subclasses there are.

The constructor is inlined into each subclass's constructor and has no out-of-line copy. Each such emission constructs the MsgSource subobject, constructs the TickTask subobject with the clock and a period of 1920 ticks, and then installs this class's three tables before the subclass installs its own.

Constructor & Destructor Documentation

◆ Pitcher()

Pitcher::Pitcher ( Sch::TickClock * pClock)
inlineexplicit

Construct the three bases, the TickTask one to run every bar.

Inline. Each subclass constructor expands it, starting with the finiteness test of the period.

Parameters
pClockThe clock the task is posted against.

◆ ~Pitcher()

virtual Pitcher::~Pitcher ( )
inlinevirtual

Inline.

Identical copies sit at 0x001b3348, 0x001d10b8, and 0x001d9798, one in each deriving translation unit, and the deriving destructors all call the first.

Ghidra address:
NTSC-U/C: 0x001b3348
Ghidra address:
PAL: 0x001b9120

Member Data Documentation

◆ kBarPeriod

int Pitcher::kBarPeriod = 1920
staticconstexpr

The TickTask period, one bar of 1920 ticks.


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