resonance 1.0.1
Loading...
Searching...
No Matches
Sequencer< T > Class Template Reference

Dispatcher of one range of timed messages against a clock. More...

#include <sequencer.h>

Inheritance diagram for Sequencer< T >:
Collaboration diagram for Sequencer< T >:

Public Member Functions

 Sequencer (T begin, T finish)
 Prepare a sequencer over a range, before any post.
virtual ~Sequencer ()
 Withdraw the queued command, release it, and free the sequencer.
virtual void Dispatch ()
 Send a copy of the message at the cursor stamped with its tick, then schedule the next.
void Post (Sch::TickClock *pClock, MsgSink *pSink)
 Record the clock and the sink and start sending the range.
void ScheduleNext ()
 Queue or send the message at the cursor.
Public Member Functions inherited from GenericSequencer
 GenericSequencer ()
 Prepare a sequencer before any post.
virtual ~GenericSequencer ()
 Release the sequencer.
void Withdraw ()
 Withdraw every command queued under the handle.

Static Public Member Functions

static void * operator new (size_t nSize)
 Allocate a sequencer under the tag Sequencer.
static void operator delete (void *pBlock)
 Release a sequencer under the tag Sequencer.

Public Attributes

T mCursor
 The next object to send.
T mBegin
T mFinish

Additional Inherited Members

Protected Types inherited from GenericSequencer
enum  { kUnallocatedCommand = -2 }
Protected Attributes inherited from GenericSequencer
Sch::CmdID mCmdId
SequencerCmd * mCommand
Sch::TickClock * mClock
Sch::Tick mStartTick
Sch::Tick mOffset
MsgSink * mSink

Detailed Description

template<typename T>
class Sequencer< T >

Dispatcher of one range of timed messages against a clock.

The one instantiation in the image is Sequencer<TickObj<MuseMsg *> const *>, whose descriptor is at 0x008eec48 with GenericSequencer as its one base at offset 0 and whose table is at 0x007cc7e8. MultiMusePlayer::Start() and BarSequencer::Tick() construct it, each taking 0x2c bytes under the tag Sequencer.

Post() records the clock and the sink and sends the range in order, each message at its own position relative to the clock's position at the post. A message due at once is sent immediately, and a later one waits for SequencerCmd. The bodies are template code, and the one instantiation's out-of-line copies sit in the Sequencer unit with further per-unit copies elsewhere.

Constructor & Destructor Documentation

◆ Sequencer()

template<typename T>
Sequencer< T >::Sequencer ( T begin,
T finish )
inline

Prepare a sequencer over a range, before any post.

Inline, and expanded into both allocations. The next tick starts at kTickInfinity.

Parameters
beginFirst object of the range.
finishOne past the last object of the range.

◆ ~Sequencer()

template<typename T>
virtual Sequencer< T >::~Sequencer ( )
inlinevirtual

Withdraw the queued command, release it, and free the sequencer.

Ghidra address:
NTSC-U/C: 0x00100df8
Ghidra address:
PAL: 0x00100df8

Member Function Documentation

◆ operator new()

template<typename T>
void * Sequencer< T >::operator new ( size_t nSize)
inlinestatic

Allocate a sequencer under the tag Sequencer.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ operator delete()

template<typename T>
void Sequencer< T >::operator delete ( void * pBlock)
inlinestatic

Release a sequencer under the tag Sequencer.

Parameters
pBlockThe block.

◆ Dispatch()

template<typename T>
virtual void Sequencer< T >::Dispatch ( )
inlinevirtual

Send a copy of the message at the cursor stamped with its tick, then schedule the next.

The copy is deleted once the sink has handled it.

Ghidra address:
NTSC-U/C: 0x00100e70
Ghidra address:
PAL: 0x00100e70

Implements GenericSequencer.

◆ Post()

template<typename T>
void Sequencer< T >::Post ( Sch::TickClock * pClock,
MsgSink * pSink )
inline

Record the clock and the sink and start sending the range.

The title is inferred.

Parameters
pClockThe clock to post against.
pSinkThe sink every message goes to.
Ghidra address:
NTSC-U/C: 0x00100ef8
Ghidra address:
PAL: 0x00100ef8

◆ ScheduleNext()

template<typename T>
void Sequencer< T >::ScheduleNext ( )
inline

Queue or send the message at the cursor.

Does nothing at the end of the range. The message's tick is the start tick plus its own position less mOffset, each sum brought into the finite range. A tick equal to the start tick is dispatched at once, and any other is posted, creating SequencerCmd on the first post. The title is inferred.

Ghidra address:
NTSC-U/C: 0x00100970
Ghidra address:
PAL: 0x00100970

Member Data Documentation

◆ mCursor

template<typename T>
T Sequencer< T >::mCursor

The next object to send.

Public because MultiMusePlayer::PlayerFinished() compares it against mFinish from outside the hierarchy and the image exposes no accessor.

◆ mBegin

template<typename T>
T Sequencer< T >::mBegin

First object of the range.

◆ mFinish

template<typename T>
T Sequencer< T >::mFinish

One past the last object of the range.


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