/* */ #ifndef D_ADAPTIVE_FILE_ALLOCATION_ITERATOR_H #define D_ADAPTIVE_FILE_ALLOCATION_ITERATOR_H #include "FileAllocationIterator.h" #include namespace aria2 { class BinaryStream; class AdaptiveFileAllocationIterator : public FileAllocationIterator { private: std::unique_ptr allocator_; BinaryStream* stream_; int64_t offset_; int64_t totalLength_; public: AdaptiveFileAllocationIterator(BinaryStream* stream, int64_t offset, int64_t totalLength); virtual ~AdaptiveFileAllocationIterator(); virtual void allocateChunk() CXX11_OVERRIDE; virtual bool finished() CXX11_OVERRIDE; virtual int64_t getCurrentLength() CXX11_OVERRIDE; virtual int64_t getTotalLength() CXX11_OVERRIDE; }; } // namespace aria2 #endif // D_ADAPTIVE_FILE_ALLOCATION_ITERATOR_H