From 048a2cf59737f761876e81a77e8d064c45c752d7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 11 Oct 2007 16:58:24 +0000 Subject: 2007-10-12 Tatsuhiro Tsujikawa Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only. --- src/MultiFileAllocationIterator.h | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/MultiFileAllocationIterator.h (limited to 'src/MultiFileAllocationIterator.h') diff --git a/src/MultiFileAllocationIterator.h b/src/MultiFileAllocationIterator.h new file mode 100644 index 00000000..6f97723e --- /dev/null +++ b/src/MultiFileAllocationIterator.h @@ -0,0 +1,73 @@ +/* */ +#ifndef _D_MULTI_FILE_ALLOCATION_ITERATOR_H_ +#define _D_MULTI_FILE_ALLOCATION_ITERATOR_H_ + +#include "FileAllocationIterator.h" + +class MultiDiskAdaptor; +class FileEntry; +extern typedef SharedHandle FileEntryHandle; +extern typedef deque FileEntries; + +class MultiFileAllocationIterator:public FileAllocationIterator +{ +private: + MultiDiskAdaptor* _diskAdaptor; + FileEntries _entries; + FileEntryHandle _currentEntry; + int64_t _offset; +public: + MultiFileAllocationIterator(MultiDiskAdaptor* diskAdaptor); + + virtual ~MultiFileAllocationIterator(); + + void prepareNextEntry(); + + virtual void allocateChunk(); + + virtual bool finished(); + + virtual int64_t getCurrentLength() + { + return _offset; + } + + virtual int64_t getTotalLength(); +}; + +typedef SharedHandle MultiFileAllocationIteratorHandle; + +#endif // _D_MULTI_FILE_ALLOCATION_ITERATOR_H_ -- cgit