kget
net::NetworkThread Class Reference
#include <networkthread.h>

Detailed Description
Base class for the 2 networking threads. Handles the socket groups.
Definition at line 39 of file networkthread.h.
Public Member Functions | |
| void | addGroup (Uint32 gid, Uint32 limit, Uint32 assured_rate) |
| virtual bool | doGroup (SocketGroup *g, Uint32 &allowance, bt::TimeStamp now)=0 |
| bool | isRunning () const |
| NetworkThread (SocketMonitor *sm) | |
| void | removeGroup (Uint32 gid) |
| void | run () |
| void | setGroupAssuredRate (Uint32 gid, Uint32 as) |
| void | setGroupLimit (Uint32 gid, Uint32 limit) |
| void | stop () |
| virtual void | update ()=0 |
| virtual | ~NetworkThread () |
Protected Member Functions | |
| void | doGroups (Uint32 num_ready, bt::TimeStamp now, bt::Uint32 limit) |
Protected Attributes | |
| bt::PtrMap< Uint32, SocketGroup > | groups |
| bt::TimeStamp | prev_run_time |
| bool | running |
| SocketMonitor * | sm |
Constructor & Destructor Documentation
| net::NetworkThread::NetworkThread | ( | SocketMonitor * | sm | ) |
Definition at line 32 of file networkthread.cpp.
| net::NetworkThread::~NetworkThread | ( | ) | [virtual] |
Definition at line 40 of file networkthread.cpp.
Member Function Documentation
| void net::NetworkThread::addGroup | ( | Uint32 | gid, | |
| Uint32 | limit, | |||
| Uint32 | assured_rate | |||
| ) |
Add a new group with a given limit.
- Parameters:
-
gid The group ID (cannot be 0, 0 is the default group) limit The limit in bytes per sec assured_rate The assured rate for this group in bytes per second
Definition at line 51 of file networkthread.cpp.
| virtual bool net::NetworkThread::doGroup | ( | SocketGroup * | g, | |
| Uint32 & | allowance, | |||
| bt::TimeStamp | now | |||
| ) | [pure virtual] |
Do one SocketGroup.
- Parameters:
-
g The group allowance The groups allowance now The current time
- Returns:
- true if the group can go again
| void net::NetworkThread::doGroups | ( | Uint32 | num_ready, | |
| bt::TimeStamp | now, | |||
| bt::Uint32 | limit | |||
| ) | [protected] |
Go over all groups and do them.
- Parameters:
-
num_ready The number of ready sockets now The current time limit The global limit in bytes per sec
Definition at line 128 of file networkthread.cpp.
| bool net::NetworkThread::isRunning | ( | ) | const [inline] |
| void net::NetworkThread::removeGroup | ( | Uint32 | gid | ) |
| void net::NetworkThread::run | ( | ) |
The main function of the thread.
Reimplemented from QThread.
Definition at line 43 of file networkthread.cpp.
| void net::NetworkThread::setGroupAssuredRate | ( | Uint32 | gid, | |
| Uint32 | as | |||
| ) |
Set the assured rate for a group.
- Parameters:
-
gid The group ID as The assured rate
Definition at line 83 of file networkthread.cpp.
| void net::NetworkThread::setGroupLimit | ( | Uint32 | gid, | |
| Uint32 | limit | |||
| ) |
Set the limit for a group.
- Parameters:
-
gid The group ID limit The limit
Definition at line 74 of file networkthread.cpp.
| void net::NetworkThread::stop | ( | ) | [inline] |
| virtual void net::NetworkThread::update | ( | ) | [pure virtual] |
Subclasses must implement this function.
Member Data Documentation
bt::PtrMap<Uint32,SocketGroup> net::NetworkThread::groups [protected] |
Definition at line 44 of file networkthread.h.
bt::TimeStamp net::NetworkThread::prev_run_time [protected] |
Definition at line 45 of file networkthread.h.
bool net::NetworkThread::running [protected] |
Definition at line 43 of file networkthread.h.
SocketMonitor* net::NetworkThread::sm [protected] |
Definition at line 42 of file networkthread.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference