/* */ #ifndef _D_FILE_ALLOCATION_MAN_H_ #define _D_FILE_ALLOCATION_MAN_H_ #include "common.h" #include "Request.h" #include "RequestGroup.h" #include "FileAllocationEntry.h" class FileAllocationMan { private: FileAllocationEntries _fileAllocationEntries; FileAllocationEntryHandle _currentFileAllocationEntry; public: FileAllocationMan():_currentFileAllocationEntry(0) {} bool isFileAllocationBeingExecuted() const { return _currentFileAllocationEntry.get() != 0; } FileAllocationEntryHandle getCurrentFileAllocationEntry() { return _currentFileAllocationEntry; } void markCurrentFileAllocationEntryDone() { _currentFileAllocationEntry = 0; } bool nextFileAllocationEntryExists() const { return !_fileAllocationEntries.empty(); } FileAllocationEntryHandle popNextFileAllocationEntry() { if(!nextFileAllocationEntryExists()) { return 0; } FileAllocationEntryHandle entry = _fileAllocationEntries.front(); _fileAllocationEntries.pop_front(); _currentFileAllocationEntry = entry; return entry; } void pushFileAllocationEntry(const FileAllocationEntryHandle& entry) { _fileAllocationEntries.push_back(entry); } }; typedef SharedHandle FileAllocationManHandle; #endif // _D_FILE_ALLOCATION_MAN_H_