mirror of https://github.com/aria2/aria2
2010-06-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed member variables * src/BtRuntime.hpull/1/head
parent
b33d679618
commit
158d779141
|
@ -1,3 +1,8 @@
|
||||||
|
2010-06-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Renamed member variables
|
||||||
|
* src/BtRuntime.h
|
||||||
|
|
||||||
2010-06-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-06-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Renamed member variables
|
Renamed member variables
|
||||||
|
|
|
@ -42,10 +42,10 @@ namespace aria2 {
|
||||||
|
|
||||||
class BtRuntime {
|
class BtRuntime {
|
||||||
private:
|
private:
|
||||||
uint64_t uploadLengthAtStartup;
|
uint64_t _uploadLengthAtStartup;
|
||||||
uint16_t port;
|
uint16_t _port;
|
||||||
bool halt;
|
bool _halt;
|
||||||
unsigned int connections;
|
unsigned int _connections;
|
||||||
bool _ready;
|
bool _ready;
|
||||||
// Maximum number of peers to hold connections at the same time.
|
// Maximum number of peers to hold connections at the same time.
|
||||||
// 0 means unlimited.
|
// 0 means unlimited.
|
||||||
|
@ -58,10 +58,10 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BtRuntime():
|
BtRuntime():
|
||||||
uploadLengthAtStartup(0),
|
_uploadLengthAtStartup(0),
|
||||||
port(0),
|
_port(0),
|
||||||
halt(false),
|
_halt(false),
|
||||||
connections(0),
|
_connections(0),
|
||||||
_ready(false),
|
_ready(false),
|
||||||
_maxPeers(DEFAULT_MAX_PEERS),
|
_maxPeers(DEFAULT_MAX_PEERS),
|
||||||
_minPeers(DEFAULT_MIN_PEERS)
|
_minPeers(DEFAULT_MIN_PEERS)
|
||||||
|
@ -70,44 +70,44 @@ public:
|
||||||
~BtRuntime() {}
|
~BtRuntime() {}
|
||||||
|
|
||||||
uint64_t getUploadLengthAtStartup() const {
|
uint64_t getUploadLengthAtStartup() const {
|
||||||
return uploadLengthAtStartup;
|
return _uploadLengthAtStartup;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setUploadLengthAtStartup(uint64_t length) {
|
void setUploadLengthAtStartup(uint64_t length) {
|
||||||
this->uploadLengthAtStartup = length;
|
_uploadLengthAtStartup = length;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setListenPort(uint16_t port) {
|
void setListenPort(uint16_t port) {
|
||||||
this->port = port;
|
_port = port;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t getListenPort() const { return port; }
|
uint16_t getListenPort() const { return _port; }
|
||||||
|
|
||||||
bool isHalt() const { return halt; }
|
bool isHalt() const { return _halt; }
|
||||||
|
|
||||||
void setHalt(bool halt) {
|
void setHalt(bool halt) {
|
||||||
this->halt = halt;
|
_halt = halt;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int getConnections() const { return connections; }
|
unsigned int getConnections() const { return _connections; }
|
||||||
|
|
||||||
void increaseConnections() { connections++; }
|
void increaseConnections() { ++_connections; }
|
||||||
|
|
||||||
void decreaseConnections() { connections--; }
|
void decreaseConnections() { --_connections; }
|
||||||
|
|
||||||
bool lessThanMaxPeers() const
|
bool lessThanMaxPeers() const
|
||||||
{
|
{
|
||||||
return _maxPeers == 0 || connections < _maxPeers;
|
return _maxPeers == 0 || _connections < _maxPeers;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lessThanMinPeers() const
|
bool lessThanMinPeers() const
|
||||||
{
|
{
|
||||||
return _minPeers == 0 || connections < _minPeers;
|
return _minPeers == 0 || _connections < _minPeers;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lessThanEqMinPeers() const
|
bool lessThanEqMinPeers() const
|
||||||
{
|
{
|
||||||
return _minPeers == 0 || connections <= _minPeers;
|
return _minPeers == 0 || _connections <= _minPeers;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ready() { return _ready; }
|
bool ready() { return _ready; }
|
||||||
|
|
Loading…
Reference in New Issue