wavelength 1.0.0
Loading...
Searching...
No Matches
PeriodicTask Class Reference

A task that runs again a fixed time after each run ends. More...

#include <periodictask.h>

Public Member Functions

 PeriodicTask (float fPeriod)
 Construct a schedule with no task.
 ~PeriodicTask ()
 Stop and delete the task.
void SetTask (Task *pTask)
 Set the task, which the schedule then deletes.
int Poll ()
 Start the task once its time comes, poll it, and schedule the next run once it ends.
void RunNow ()
 Run the task at the next Poll().
void Suspend ()
 Stop the schedule from starting the task.
Task * GetTask () const
float GetPeriod () const
float GetNextTime () const
void SetNextTime (float fNextTime)
 Set when the task starts next.

Static Public Attributes

static constexpr float kNever = 1.0e30f
 The time a schedule that waits for nothing records.

Detailed Description

A task that runs again a fixed time after each run ends.

The class has no RTTI, and the name is inferred. The object is 0xc bytes.

Constructor & Destructor Documentation

◆ PeriodicTask()

PeriodicTask::PeriodicTask ( float fPeriod)
explicit

Construct a schedule with no task.

Parameters
fPeriodThe wait after each run, in milliseconds.
Ghidra address:
NTSC-U/C: 0x0026a588
Ghidra address:
PAL: 0x00274118

◆ ~PeriodicTask()

PeriodicTask::~PeriodicTask ( )

Stop and delete the task.

Ghidra address:
NTSC-U/C: 0x0026a5a8
Ghidra address:
PAL: 0x00274138

Member Function Documentation

◆ SetTask()

void PeriodicTask::SetTask ( Task * pTask)

Set the task, which the schedule then deletes.

Parameters
pTaskThe task.
Ghidra address:
NTSC-U/C: 0x0026a618
Ghidra address:
PAL: 0x002741a8

◆ Poll()

int PeriodicTask::Poll ( )

Start the task once its time comes, poll it, and schedule the next run once it ends.

Returns
The state of the task, or 0 with no task.
Ghidra address:
NTSC-U/C: 0x0026a620
Ghidra address:
PAL: 0x002741b0

◆ RunNow()

void PeriodicTask::RunNow ( )

Run the task at the next Poll().

Ghidra address:
NTSC-U/C: 0x0026a710
Ghidra address:
PAL: 0x002742a0

◆ Suspend()

void PeriodicTask::Suspend ( )

Stop the schedule from starting the task.

Ghidra address:
NTSC-U/C: 0x0026a718
Ghidra address:
PAL: 0x002742a8

◆ GetTask()

Task * PeriodicTask::GetTask ( ) const
inline
Returns
The task, or null.

◆ GetPeriod()

float PeriodicTask::GetPeriod ( ) const
inline
Returns
The wait after each run, in milliseconds.

◆ GetNextTime()

float PeriodicTask::GetNextTime ( ) const
inline
Returns
When the task starts next, from SystemMs(), or kNever.

◆ SetNextTime()

void PeriodicTask::SetNextTime ( float fNextTime)
inline

Set when the task starts next.

Parameters
fNextTimeThe time, from SystemMs(), or kNever.

Member Data Documentation

◆ kNever

float PeriodicTask::kNever = 1.0e30f
staticconstexpr

The time a schedule that waits for nothing records.


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