wavelength 1.0.0
Loading...
Searching...
No Matches
nettask.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
6#include "os/task.h"
7
8class NetMultiTask;
9
17class NetTask : public Task {
18public:
24 NetTask() : mParent(nullptr) {
25 }
26
35 void Finish(bool bSucceeded, int nResult);
36
45 static void MakeTag(NetTask *pTask, char *pszTag);
46
54 static void RemoveTag(NetTask *pTask);
55
64 static NetTask *FindTag(const char *pszTag);
65
68 return mParent;
69 }
70
76 void SetParent(NetMultiTask *pParent) {
77 mParent = pParent;
78 }
79
85 static std::list<NetTaskTag> sTags;
86
93 static int sNextTag;
94
95protected:
102 void OnStop() override;
103
104private:
105 NetMultiTask *mParent;
106};
A request to the online library, as the NetTask steps that run one after another.
Definition netmultitask.h:14
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
Definition nettask.h:67
static int sNextTag
The number the next tag takes.
Definition nettask.h:93
static NetTask * FindTag(const char *pszTag)
Find the task of a tag.
static std::list< NetTaskTag > sTags
The tags MakeTag() created and RemoveTag() has not removed.
Definition nettask.h:85
void OnStop() override
Remove the tag of the task.
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.
void SetParent(NetMultiTask *pParent)
Set the NetMultiTask that runs the task.
Definition nettask.h:76
NetTask()
Construct a task outside any NetMultiTask.
Definition nettask.h:24
Task()
Construct an idle task.
Definition task.h:24