/* */ #ifndef _D_FILE_ALLOCATION_ENTRY_H_ #define _D_FILE_ALLOCATION_ENTRY_H_ #include "RequestGroupEntry.h" class FileAllocationEntry : public RequestGroupEntry { private: int64_t _offset; public: FileAllocationEntry(int cuid, const RequestHandle& currentRequest, RequestGroup* requestGroup, DownloadCommand* nextDownloadCommand = 0, int64_t offset = 0): RequestGroupEntry(cuid, currentRequest, requestGroup, nextDownloadCommand), _offset(offset) {} virtual ~FileAllocationEntry() {} virtual int64_t getCurrentLength() const { return _offset; } virtual bool finished() const { return _requestGroup->getTotalLength() <= _offset; } void allocateChunk(); }; typedef SharedHandle FileAllocationEntryHandle; typedef deque FileAllocationEntries; #endif // _D_FILE_ALLOCATION_ENTRY_H_