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

Unit of work an owner starts, polls until it reports that it is done, and stops. More...

#include <task.h>

Inheritance diagram for Task:

Public Types

enum  State { kStateIdle = 0 , kStateRunning = 1 , kStateDone = 2 , kStateFailed = 3 }
 Values of mState. More...

Public Member Functions

 Task ()
 Construct an idle task.
virtual ~Task ()
 Release the task.
int Poll ()
 Report the state after giving a running task one poll.
void Start ()
 Enter the running state and call OnStart(), unless the task is already running.
void Stop ()
 Call OnStop() when the task is running, and return to the idle state.
void Finish (bool bSucceeded)
 End the task from outside its poll, and call OnStop() when it was running.
int GetState () const
 Report mState.

Protected Member Functions

virtual void OnStart ()
 Begin the work.
virtual void OnStop ()
 Abandon the work.
virtual void OnPoll ()
 Advance the work, and set mState to kStateDone when it finishes.

Detailed Description

Unit of work an owner starts, polls until it reports that it is done, and stops.

The RTTI includes the class name, and the class has no base. One data word, the state, precedes the vptr.

Member Enumeration Documentation

◆ State

Values of mState.

Enumerator
kStateIdle 

Not started, or stopped.

kStateRunning 

Started and not yet done.

kStateDone 

Done, set by an override of OnPoll() or by Finish().

kStateFailed 

Ended without success by Finish().

Constructor & Destructor Documentation

◆ Task()

Task::Task ( )
inline

Construct an idle task.

The constructor has no out-of-line copy.

◆ ~Task()

virtual Task::~Task ( )
virtual

Release the task.

Ghidra address:
NTSC-U/C: 0x002a0130
Ghidra address:
PAL: 0x002a9de8

Member Function Documentation

◆ Poll()

int Task::Poll ( )

Report the state after giving a running task one poll.

Returns
One of State.
Ghidra address:
NTSC-U/C: 0x002a01a8
Ghidra address:
PAL: 0x002a9e60

◆ Start()

void Task::Start ( )

Enter the running state and call OnStart(), unless the task is already running.

Ghidra address:
NTSC-U/C: 0x002a01f8
Ghidra address:
PAL: 0x002a9eb0

◆ Stop()

void Task::Stop ( )

Call OnStop() when the task is running, and return to the idle state.

Ghidra address:
NTSC-U/C: 0x002a0238
Ghidra address:
PAL: 0x002a9ef0

◆ Finish()

void Task::Finish ( bool bSucceeded)

End the task from outside its poll, and call OnStop() when it was running.

The name is inferred.

Parameters
bSucceededEnter kStateDone rather than kStateFailed.
Ghidra address:
NTSC-U/C: 0x002a0160
Ghidra address:
PAL: 0x002a9e18

◆ GetState()

int Task::GetState ( ) const

Report mState.

Returns
One of State.
Ghidra address:
NTSC-U/C: 0x002a01f0
Ghidra address:
PAL: 0x002a9ea8

◆ OnStart()

virtual void Task::OnStart ( )
inlineprotectedvirtual

Begin the work.

Start() calls this member.

Ghidra address:
NTSC-U/C: 0x003ab810
Ghidra address:
PAL: 0x0041a570

Reimplemented in AccountDeleteTask, AccountGetIDTask, AccountLoginTask, AccountRegistrationTask, AccountUpdatePasswordTask, AccountUpdateStatsTask, AllocateBufferTask, AnonymousLoginTask, BanPlayerTask, ChannelInfoTask, CheckInetTask, ClearGameListFilterTask, ClockSyncTask, CloseMGCLTask, CloseRTTask, CreateChannelTask, DoDNSTask, FileCloseTask, FileCreateTask, FileDeleteTask, FileDownloadTask, FileGetAttributesTask, FileListTask, FileUpdateAttributesTask, FileUploadTask, FindPlayerTask, FinishUpdateGameParamsTask, GetAnnouncementsTask, GetChannelsTask, GetGamePlayersTask, GetGamesTask, GetLobbyPlayersTask, GetPolicyTask, InitMGCLTask, InitRTTask, JoinChannelTask, KillLaunchpadTask, LadderListTask, LadderPosition2Task, LadderPositionFastTask, LadderPositionTask, LoadGameTask, MCCloseTask, MCCreateSaveDirTask, MCDeleteSavedRemixTask, MCDeleteTask, MCFindRemixTask, MCFormatTask, MCGetAllRemixInfosTask, MCGetDirTask, MCGetInfoTask, MCGetRemixNamesTask, MCLoadFreqFilesTask, MCMkDirTask, MCNetConfigTask, MCOpenCurrRemixTask, MCOpenTask, MCReadTask, MCSeekTask, MCUnformatTask, MCWriteTask, MediusConnectTask, MediusJoinGameTask, MediusSendPlayerReportTask, MediusSendWorldReportTask, MGCLAuthenticationTask, MGCLConnectTask, MGCLCreateGameTask, MGCLSendServerReportTask, MGCLSessionBeginTask, MGCLSessionEndTask, NetConnectTask, NetDisconnectTask, NetHostTask, PlayerInfoTask, ScriptTask, SerialTasks, SessionBeginTask, SessionEndTask, SetGameListFilterTask, SetLocParamsTask, SetupLocalPlayerTask, StreamTask, TextFilterTask, UpdateClientStateTask, VersionServerTask, WaitForTaskTask, WaitInteractiveRemixTask, WaitInteractiveTask, and WaitTimeTask.

◆ OnStop()

virtual void Task::OnStop ( )
inlineprotectedvirtual

Abandon the work.

Stop() calls this member for a running task.

Ghidra address:
NTSC-U/C: 0x003ab818
Ghidra address:
PAL: 0x0041a578

Reimplemented in DoDNSTask, InitRTTask, MCCheckRemixSpaceNeededTask, MCCheckSaveSpaceNeededTask, MCLoadFileTask, MediusConnectTask, MemcardSerialTask, MGCLConnectTask, NetConnectTask, NetHostTask, NetTask, SerialTasks, StreamTask, WaitInteractiveRemixTask, and WaitInteractiveTask.

◆ OnPoll()


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