/* */ #ifndef _D_CUID_COUNTER_H_ #define _D_CUID_COUNTER_H_ #include "common.h" #include "Command.h" namespace aria2 { class CUIDCounter { private: cuid_t _count; public: CUIDCounter():_count(0) {} ~CUIDCounter() {} cuid_t newID() { cuid_t id = ++_count; if(id == INT32_MAX) { _count = 0; } return id; } }; } #endif // _D_CUID_COUNTER_H_