• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List

request_state_impl_basic.h

00001 /***************************************************************************
00002  *  include/stxxl/bits/io/request_state_impl_basic.h
00003  *
00004  *  UNIX file system file base
00005  *
00006  *  Part of the STXXL. See http://stxxl.sourceforge.net
00007  *
00008  *  Copyright (C) 2008 Andreas Beckmann <beckmann@cs.uni-frankfurt.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_HEADER_IO_REQUEST_STATE_IMPL_BASIC
00016 #define STXXL_HEADER_IO_REQUEST_STATE_IMPL_BASIC
00017 
00018 #include <stxxl/bits/common/state.h>
00019 #include <stxxl/bits/io/request.h>
00020 #include <stxxl/bits/io/request_waiters_impl_basic.h>
00021 
00022 
00023 __STXXL_BEGIN_NAMESPACE
00024 
00027 
00029 class request_state_impl_basic : public request, public request_waiters_impl_basic
00030 {
00031 protected:
00034     enum request_state { OP = 0, DONE = 1, READY2DIE = 2 };
00035 
00036     state<request_state> _state;
00037 
00038 protected:
00039     request_state_impl_basic(
00040         const completion_handler & on_cmpl,
00041         file * f,
00042         void * buf,
00043         offset_type off,
00044         size_type b,
00045         request_type t) :
00046         request(on_cmpl, f, buf, off, b, t),
00047         _state(OP)
00048     { }
00049 
00050 public:
00051     virtual ~request_state_impl_basic();
00052     void wait(bool measure_time = true);
00053     bool poll();
00054     bool cancel();
00055 };
00056 
00058 
00059 __STXXL_END_NAMESPACE
00060 
00061 #endif // !STXXL_HEADER_IO_REQUEST_STATE_IMPL_BASIC
00062 // vim: et:ts=4:sw=4

Generated on Sun Oct 17 2010 06:13:44 for Stxxl by  doxygen 1.7.1