#include <task.h>
- Author
- Joris Guisson joris.nosp@m..gui.nosp@m.sson@.nosp@m.gmai.nosp@m.l.com
Performs a task on K nodes provided by a KClosestNodesSearch. This is a base class for all tasks.
Definition at line 46 of file task.h.
◆ Task()
dht::Task::Task |
( |
RPCServer * |
rpc, |
|
|
Node * |
node, |
|
|
QObject * |
parent |
|
) |
| |
Create a task.
- Parameters
-
rpc | The RPC server to do RPC calls |
node | The node |
parent | The parent object |
◆ addDHTNode()
void dht::Task::addDHTNode |
( |
const QString & |
ip, |
|
|
bt::Uint16 |
port |
|
) |
| |
Add a node to the todo list
- Parameters
-
ip | The ip or hostname of the node |
port | The port |
◆ callFinished()
virtual void dht::Task::callFinished |
( |
RPCCall * |
c, |
|
|
RPCMsg::Ptr |
rsp |
|
) |
| |
|
pure virtual |
◆ callTimeout()
virtual void dht::Task::callTimeout |
( |
RPCCall * |
c | ) |
|
|
pure virtual |
◆ dataReady
void dht::Task::dataReady |
( |
Task * |
t | ) |
|
|
signal |
Called by the task when data is ready. Can be overrided if wanted.
- Parameters
-
◆ emitDataReady()
void dht::Task::emitDataReady |
( |
| ) |
|
Tell listeners data is ready.
◆ finished
void dht::Task::finished |
( |
Task * |
t | ) |
|
|
signal |
The task is finsihed.
- Parameters
-
◆ rpcCall()
bool dht::Task::rpcCall |
( |
RPCMsg::Ptr |
req | ) |
|
Do a call to the rpc server, increments the outstanding_reqs variable.
- Parameters
-
- Returns
- true if call was made, false if not
◆ start() [1/2]
void dht::Task::start |
( |
| ) |
|
Start the task, to be used when a task is queued.
◆ start() [2/2]
This will copy the results from the KClosestNodesSearch object into the todo list. And call update if the task is not queued.
- Parameters
-
◆ update()
virtual void dht::Task::update |
( |
| ) |
|
|
pure virtual |
Will continue the task, this will be called every time we have rpc slots available for this task. Should be implemented by derived classes.
Implemented in dht::AnnounceTask, and dht::NodeLookup.
The documentation for this class was generated from the following file: