00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef STXXL_IO__REQUEST_INTERFACE_H_
00016 #define STXXL_IO__REQUEST_INTERFACE_H_
00017
00018 #include <ostream>
00019
00020 #include <stxxl/bits/namespace.h>
00021 #include <stxxl/bits/noncopyable.h>
00022 #include <stxxl/bits/common/types.h>
00023
00024
00025 __STXXL_BEGIN_NAMESPACE
00026
00029
00030 class onoff_switch;
00031
00033
00037 class request_interface : private noncopyable
00038 {
00039 public:
00040 typedef stxxl::external_size_type offset_type;
00041 typedef stxxl::internal_size_type size_type;
00042 enum request_type { READ, WRITE };
00043
00044 public:
00045 virtual bool add_waiter(onoff_switch * sw) = 0;
00046 virtual void delete_waiter(onoff_switch * sw) = 0;
00047
00048 protected:
00049 virtual void notify_waiters() = 0;
00050
00051 public:
00052
00053 virtual void serve() = 0;
00054
00055 protected:
00056 virtual void completed() = 0;
00057
00058 public:
00060 virtual void wait(bool measure_time = true) = 0;
00061
00069 virtual bool cancel() = 0;
00070
00073 virtual bool poll() = 0;
00074
00077 virtual const char * io_type() const = 0;
00078
00080 virtual std::ostream & print(std::ostream & out) const = 0;
00081
00082 virtual ~request_interface()
00083 { }
00084 };
00085
00087
00088 __STXXL_END_NAMESPACE
00089
00090 #endif // !STXXL_IO__REQUEST_INTERFACE_H_
00091