/* */ #ifndef _D_CONSOLE_FILE_ALLOCATION_MONITOR_H_ #define _D_CONSOLE_FILE_ALLOCATION_MONITOR_H_ #include "FileAllocationMonitor.h" class ConsoleFileAllocationMonitor : public FileAllocationMonitor { private: string filename; int64_t min; int64_t max; int64_t current; public: ConsoleFileAllocationMonitor():min(0), max(0), current(0) {} virtual ~ConsoleFileAllocationMonitor() {} virtual void setFilename(const string& filename) { this->filename = filename; } virtual void setMinValue(const int64_t& min) { if(max < min) { this->min = max; } else { this->min = min; } } int64_t getMinValue() const { return min; } virtual void setMaxValue(const int64_t& max) { if(max < min) { this->max = min; } else { this->max = max; } } int64_t getMaxValue() const { return max; } virtual void setCurrentValue(const int64_t& current) { if(current > max) { this->current = max; } else { this->current = current; } } int64_t getCurrentValue() const { return current; } virtual void showProgress(); }; class ConsoleFileAllocationMonitorFactory : public FileAllocationMonitorFactory { public: ConsoleFileAllocationMonitorFactory() {} virtual FileAllocationMonitorHandle createNewMonitor() { return new ConsoleFileAllocationMonitor(); } }; typedef SharedHandle ConsoleFileAllocationMonitorFactoryHandle; #endif // _D_CONSOLE_FILE_ALLOCATION_MONITOR_H_