kget
dht::Task Class Reference
#include <task.h>
List of all members.
Detailed Description
- Author:
- Joris Guisson <joris.guisson@gmail.com>
Performs a task on K nodes provided by a KClosestNodesSearch. This is a base class for all tasks.
Definition at line 48 of file task.h.
Constructor & Destructor Documentation
Create a task.
- Parameters:
-
| rpc | The RPC server to do RPC calls |
| node | The node |
Definition at line 31 of file task.cpp.
| dht::Task::~Task |
( |
|
) |
[virtual] |
Member Function Documentation
Add a node to the todo list.
- Parameters:
-
| ip | The ip or hostname of the node |
| port | The port |
Definition at line 118 of file task.cpp.
| virtual void dht::Task::callFinished |
( |
RPCCall * |
c, |
|
|
MsgBase * |
rsp | |
|
) |
| | [pure virtual] |
| virtual void dht::Task::callTimeout |
( |
RPCCall * |
c |
) |
[pure virtual] |
| bool dht::Task::canDoRequest |
( |
|
) |
const [inline] |
See if we can do a request.
Definition at line 107 of file task.h.
| void dht::Task::dataReady |
( |
Task * |
t |
) |
[signal] |
Called by the task when data is ready.
Can be overrided if wanted.
- Parameters:
-
| void dht::Task::done |
( |
|
) |
[protected] |
| void dht::Task::emitDataReady |
( |
|
) |
|
Tell listeners data is ready.
Definition at line 107 of file task.cpp.
| void dht::Task::finished |
( |
Task * |
t |
) |
[signal] |
The task is finsihed.
- Parameters:
-
| bt::Uint32 dht::Task::getNumOutstandingRequests |
( |
|
) |
const [inline] |
Get the number of outstanding requests.
Definition at line 119 of file task.h.
| bt::Uint32 dht::Task::getTaskID |
( |
|
) |
const [inline] |
Get the task ID.
Definition at line 116 of file task.h.
| bool dht::Task::isFinished |
( |
|
) |
const [inline] |
Is the task finished.
Definition at line 110 of file task.h.
| bool dht::Task::isQueued |
( |
|
) |
const [inline] |
Kills the task.
Definition at line 112 of file task.cpp.
| void dht::Task::onResolverResults |
( |
KNetwork::KResolverResults |
res |
) |
[protected, slot] |
| void dht::Task::onTimeout |
( |
RPCCall * |
c |
) |
[virtual] |
| bool dht::Task::rpcCall |
( |
MsgBase * |
req |
) |
|
Do a call to the rpc server, increments the outstanding_reqs variable.
- Parameters:
-
- Returns:
- true if call was made, false if not
Definition at line 90 of file task.cpp.
| void dht::Task::setTaskID |
( |
bt::Uint32 |
tid |
) |
[inline] |
Set the task ID.
Definition at line 113 of file task.h.
| void dht::Task::start |
( |
|
) |
|
Start the task, to be used when a task is queued.
Definition at line 52 of file task.cpp.
This will copy the results from the KClosestNodesSearch object into the todo list.
And call update if the task is not queued.
- Parameters:
-
Definition at line 42 of file task.cpp.
| 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.
Member Data Documentation
The documentation for this class was generated from the following files: