Stxxl
1.3.1
|
00001 /*************************************************************************** 00002 * include/stxxl/bits/io/request_interface.h 00003 * 00004 * Part of the STXXL. See http://stxxl.sourceforge.net 00005 * 00006 * Copyright (C) 2002 Roman Dementiev <dementiev@mpi-sb.mpg.de> 00007 * Copyright (C) 2008, 2009, 2011 Andreas Beckmann <beckmann@cs.uni-frankfurt.de> 00008 * Copyright (C) 2009 Johannes Singler <singler@ira.uka.de> 00009 * 00010 * Distributed under the Boost Software License, Version 1.0. 00011 * (See accompanying file LICENSE_1_0.txt or copy at 00012 * http://www.boost.org/LICENSE_1_0.txt) 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 // HACK! 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 // vim: et:ts=4:sw=4