resonance 1.0.1
Loading...
Searching...
No Matches
TimeTask Class Referenceabstract

Task the scheduler runs again every fixed number of nanoseconds. More...

#include <timetask.h>

Inheritance diagram for TimeTask:
Collaboration diagram for TimeTask:

Public Member Functions

 TimeTask (Sch::TimeClock *pClock, long long nPeriodNs)
virtual ~TimeTask ()
 Withdraw the queued command.
virtual void Print (std::ostream &stream)
 Write the literal {TimeTask} to a diagnostic stream.
virtual int Tick (long long nElapsedNs)=0
 Run the task.
void Start (long long nEpochOffsetNs)
 Start the task now and run it at once.
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 long long kNoEpochOffset = -1000000
 The epoch offset Start() treats as an epoch at zero.

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 Attachment
int mRefs

Detailed Description

Task the scheduler runs again every fixed number of nanoseconds.

It has Attachment as its one base, and it is named after AppTimeTask.cpp, the translation unit its file-local Cmd class records. It is the nanosecond counterpart of TickTask. Its vtable is at 0x007d31a8, and slot 4, Tick(), is pure. Synth::Setup::SynthFade is the one recovered subclass.

The object is 0x28 bytes. The Attachment base supplies the reference count at +0x00 and the vptr at +0x04.

Constructor & Destructor Documentation

◆ TimeTask()

TimeTask::TimeTask ( Sch::TimeClock * pClock,
long long nPeriodNs )
Parameters
pClockThe clock the task is posted against.
nPeriodNsNanoseconds between one run and the next.
Ghidra address:
NTSC-U/C: 0x0013b100
Ghidra address:
PAL: 0x0013ba48

◆ ~TimeTask()

virtual TimeTask::~TimeTask ( )
virtual

Withdraw the queued command.

Ghidra address:
NTSC-U/C: 0x0013b138
Ghidra address:
PAL: 0x0013ba80

Member Function Documentation

◆ Print()

virtual void TimeTask::Print ( std::ostream & stream)
virtual

Write the literal {TimeTask} to a diagnostic stream.

Table slot 3.

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

◆ Tick()

virtual int TimeTask::Tick ( long long nElapsedNs)
pure virtual

Run the task.

Table slot 4, and the one pure member of the class.

Parameters
nElapsedNsNanoseconds between the epoch and the run now due.
Returns
1 to be run again after mPeriodNs further nanoseconds, anything else to stop.

◆ Start()

void TimeTask::Start ( long long nEpochOffsetNs)

Start the task now and run it at once.

Reads the clock into mNextNs and measures mEpochNs from it, then runs Run(). The title is inferred.

Parameters
nEpochOffsetNsNanoseconds the epoch lies before now, or kNoEpochOffset for an epoch at zero.
Ghidra address:
NTSC-U/C: 0x0013b180
Ghidra address:
PAL: 0x0013bac8

◆ Run()

void TimeTask::Run ( )

Run Tick() for the run now due and post the next one.

The file-local Cmd's Execute() is the caller. The title is inferred.

Ghidra address:
NTSC-U/C: 0x0013ae70
Ghidra address:
PAL: 0x0013b7b8

◆ Stop()

void TimeTask::Stop ( )

Withdraw the queued command and forget its handle.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x0013b1f0
Ghidra address:
PAL: 0x0013bb38

Member Data Documentation

◆ kNoEpochOffset

long long TimeTask::kNoEpochOffset = -1000000
staticconstexpr

The epoch offset Start() treats as an epoch at zero.


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