/* */ #ifndef _D_FILE_ALLOCATOR_H_ #define _D_FILE_ALLOCATOR_H_ #include "common.h" #include "FileAllocationMonitor.h" #include "NullFileAllocationMonitor.h" class FileAllocator { protected: FileAllocationMonitorHandle fileAllocationMonitor; public: FileAllocator():fileAllocationMonitor(new NullFileAllocationMonitor()) {} virtual ~FileAllocator() {} virtual void allocate(int fd, int64_t totalLength) = 0; void setFileAllocationMonitor(const FileAllocationMonitorHandle& monitor) { this->fileAllocationMonitor = monitor; } }; typedef SharedHandle FileAllocatorHandle; #endif // _D_FILE_ALLOCATOR_H_