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

A step of a request to the online library, run by a NetMultiTask. More...

#include <nettask.h>

Inheritance diagram for NetTask:
Collaboration diagram for NetTask:

Public Member Functions

 NetTask ()
 Construct a task outside any NetMultiTask.
void Finish (bool bSucceeded, int nResult)
 End the task, and record a failure in the result of the NetMultiTask that runs it.
NetMultiTask * GetParent () const
void SetParent (NetMultiTask *pParent)
 Set the NetMultiTask that runs the task.
Public Member Functions inherited from Task
 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.

Static Public Member Functions

static void MakeTag (NetTask *pTask, char *pszTag)
 Create the next tag of a task and copy its text.
static void RemoveTag (NetTask *pTask)
 Remove the first tag of a task.
static NetTask * FindTag (const char *pszTag)
 Find the task of a tag.

Static Public Attributes

static std::list< NetTaskTag > sTags
 The tags MakeTag() created and RemoveTag() has not removed.
static int sNextTag
 The number the next tag takes.

Protected Member Functions

void OnStop () override
 Remove the tag of the task.
Protected Member Functions inherited from Task
virtual void OnStart ()
 Begin the work.
virtual void OnPoll ()
 Advance the work, and set mState to kStateDone when it finishes.

Additional Inherited Members

Public Types inherited from Task
enum  State { kStateIdle = 0 , kStateRunning = 1 , kStateDone = 2 , kStateFailed = 3 }
 Values of mState. More...

Detailed Description

A step of a request to the online library, run by a NetMultiTask.

The RTTI includes the name and records Task as the base. A task that waits for a callback of the library passes the callback a tag from MakeTag(), and the callback finds the task again with FindTag().

Constructor & Destructor Documentation

◆ NetTask()

NetTask::NetTask ( )
inline

Construct a task outside any NetMultiTask.

The constructor has no out-of-line copy.

Member Function Documentation

◆ Finish()

void NetTask::Finish ( bool bSucceeded,
int nResult )

End the task, and record a failure in the result of the NetMultiTask that runs it.

Parameters
bSucceededWhether the step succeeded.
nResultThe result the NetMultiTask records after a failure.
Ghidra address:
NTSC-U/C: 0x0026a450
Ghidra address:
PAL: 0x00273fe0

◆ MakeTag()

void NetTask::MakeTag ( NetTask * pTask,
char * pszTag )
static

Create the next tag of a task and copy its text.

Parameters
pTaskThe task.
pszTagReceives the text of the tag.
Ghidra address:
NTSC-U/C: 0x0026a270
Ghidra address:
PAL: 0x00273e00

◆ RemoveTag()

void NetTask::RemoveTag ( NetTask * pTask)
static

Remove the first tag of a task.

Parameters
pTaskThe task.
Ghidra address:
NTSC-U/C: 0x0026a398
Ghidra address:
PAL: 0x00273f28

◆ FindTag()

NetTask * NetTask::FindTag ( const char * pszTag)
static

Find the task of a tag.

Parameters
pszTagThe text of the tag.
Returns
The task, or null when the tag was removed.
Ghidra address:
NTSC-U/C: 0x0026a480
Ghidra address:
PAL: 0x00274010

◆ GetParent()

NetMultiTask * NetTask::GetParent ( ) const
inline
Returns
The NetMultiTask that runs the task, or null.

◆ SetParent()

void NetTask::SetParent ( NetMultiTask * pParent)
inline

Set the NetMultiTask that runs the task.

Parameters
pParentThe NetMultiTask, or null.

◆ OnStop()

void NetTask::OnStop ( )
overrideprotectedvirtual

Remove the tag of the task.

Ghidra address:
NTSC-U/C: 0x0026a430
Ghidra address:
PAL: 0x00273fc0

Reimplemented from Task.

Member Data Documentation

◆ sTags

std::list<NetTaskTag> NetTask::sTags
static

The tags MakeTag() created and RemoveTag() has not removed.

Ghidra address:
NTSC-U/C: 0x0043e608

◆ sNextTag

int NetTask::sNextTag
static

The number the next tag takes.

Ghidra address:
NTSC-U/C: 0x003b0bd4
Ghidra address:
PAL: 0x0042faa4

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