block_driver_base.hpp
00001 #if !defined(__BLOCK_DRIVER_BASE_HPP__)
00002 #define __BLOCK_DRIVER_BASE_HPP__
00003
00004
00005
00006
00007 #include "block_driver.hpp"
00008
00012 struct block_driver_base : public block_driver
00013 {
00014 protected:
00015 const string driver_name;
00016 state_flags flags;
00017
00018 public:
00019 inline block_driver_base(const string &driver_name, const state_flags flags=0)
00020 : driver_name(driver_name), flags(flags)
00021 {}
00022
00023
00024
00025
00026 virtual inline const char *name(void) const
00027 {
00028 return driver_name.c_str();
00029 }
00030
00031
00032
00033
00034 virtual inline bool is(const state_flags flags) const
00035 {
00036 return this->flags.is(flags);
00037 }
00038
00039 virtual inline const state_flags state(void) const
00040 {
00041 return flags;
00042 }
00043
00044
00045
00046
00047 virtual inline int reset(void)
00048 {
00049
00050 return 0;
00051 }
00052
00053 virtual inline int flush_sectors(void)
00054 {
00055
00056 return 0;
00057 }
00058 };
00059
00060 #endif
00061
00062
00063