Stxxl  1.4.0
include/stxxl/bits/io/disk_queued_file.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  include/stxxl/bits/io/disk_queued_file.h
00003  *
00004  *  Part of the STXXL. See http://stxxl.sourceforge.net
00005  *
00006  *  Copyright (C) 2008 Andreas Beckmann <beckmann@cs.uni-frankfurt.de>
00007  *  Copyright (C) 2009 Johannes Singler <singler@ira.uka.de>
00008  *
00009  *  Distributed under the Boost Software License, Version 1.0.
00010  *  (See accompanying file LICENSE_1_0.txt or copy at
00011  *  http://www.boost.org/LICENSE_1_0.txt)
00012  **************************************************************************/
00013 
00014 #ifndef STXXL_HEADER_IO_DISK_QUEUED_FILE
00015 #define STXXL_HEADER_IO_DISK_QUEUED_FILE
00016 
00017 #include <stxxl/bits/io/file.h>
00018 
00019 
00020 __STXXL_BEGIN_NAMESPACE
00021 
00022 //! \addtogroup fileimpl
00023 //! \{
00024 
00025 //! \brief Implementation of some file methods based on serving_request
00026 class disk_queued_file : public virtual file
00027 {
00028     int queue_id, allocator_id;
00029 
00030 public:
00031     disk_queued_file(int queue_id, int allocator_id) : queue_id(queue_id), allocator_id(allocator_id)
00032     { }
00033     request_ptr aread(
00034         void * buffer,
00035         offset_type pos,
00036         size_type bytes,
00037         const completion_handler & on_cmpl);
00038     request_ptr awrite(
00039         void * buffer,
00040         offset_type pos,
00041         size_type bytes,
00042         const completion_handler & on_cmpl);
00043 
00044     virtual int get_queue_id() const
00045     {
00046         return queue_id;
00047     }
00048 
00049     virtual int get_allocator_id() const
00050     {
00051         return allocator_id;
00052     }
00053 };
00054 
00055 //! \}
00056 
00057 __STXXL_END_NAMESPACE
00058 
00059 #endif // !STXXL_HEADER_IO_DISK_QUEUED_FILE
00060 // vim: et:ts=4:sw=4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines