diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-03-19 13:54:09 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-03-19 13:54:09 +0000 |
| commit | 9233a6258f8732aacc903e6cf3eb1d5598a35058 (patch) | |
| tree | 36f4fba944ce1a7e7e47a1e18248065d4153179b /src/CUIDCounter.h | |
| parent | e3ed6adf91180f11edd407432bda16aa5f474dde (diff) | |
2009-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Typedefed cuid_t as int32_t in Command.h
* src/CUIDCounter.h
* src/Command.cc
* src/Command.h
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/PeerStat.h
* src/SegmentMan.cc
* src/SegmentMan.h
Diffstat (limited to 'src/CUIDCounter.h')
| -rw-r--r-- | src/CUIDCounter.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/CUIDCounter.h b/src/CUIDCounter.h index 7d7b94e1..ab6097f7 100644 --- a/src/CUIDCounter.h +++ b/src/CUIDCounter.h @@ -36,22 +36,25 @@ #define _D_CUID_COUNTER_H_ #include "common.h" +#include "Command.h" namespace aria2 { -typedef int32_t CUID; - class CUIDCounter { private: - int32_t count; + cuid_t _count; public: - CUIDCounter():count(0) {} + CUIDCounter():_count(0) {} ~CUIDCounter() {} - CUID newID() + cuid_t newID() { - return ++count; + cuid_t id = ++_count; + if(id == INT32_MAX) { + _count = 0; + } + return id; } }; |
