/* */ #ifndef _D_MULTI_FILE_ALLOCATION_ITERATOR_H_ #define _D_MULTI_FILE_ALLOCATION_ITERATOR_H_ #include "FileAllocationIterator.h" class MultiDiskAdaptor; class DiskWriterEntry; typedef SharedHandle DiskWriterEntryHandle; typedef deque DiskWriterEntries; class SingleFileAllocationIterator; typedef SharedHandle SingleFileAllocationIteratorHandle; class MultiFileAllocationIterator:public FileAllocationIterator { private: MultiDiskAdaptor* _diskAdaptor; DiskWriterEntries _entries; SingleFileAllocationIteratorHandle _fileAllocationIterator; int64_t _offset; DiskWriterEntries makeDiskWriterEntries(const DiskWriterEntries& srcEntries, int32_t pieceLength) const; public: MultiFileAllocationIterator(MultiDiskAdaptor* diskAdaptor); virtual ~MultiFileAllocationIterator(); virtual void allocateChunk(); virtual bool finished(); virtual int64_t getCurrentLength(); virtual int64_t getTotalLength(); const DiskWriterEntries& getDiskWriterEntries() const; }; typedef SharedHandle MultiFileAllocationIteratorHandle; #endif // _D_MULTI_FILE_ALLOCATION_ITERATOR_H_