Stxxl  1.4.0
io/disk_queued_file.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002  *  io/disk_queued_file.cpp
00003  *
00004  *  Part of the STXXL. See http://stxxl.sourceforge.net
00005  *
00006  *  Copyright (C) 2008 Andreas Beckmann <beckmann@cs.uni-frankfurt.de>
00007  *
00008  *  Distributed under the Boost Software License, Version 1.0.
00009  *  (See accompanying file LICENSE_1_0.txt or copy at
00010  *  http://www.boost.org/LICENSE_1_0.txt)
00011  **************************************************************************/
00012 
00013 #include <stxxl/bits/io/disk_queued_file.h>
00014 #include <stxxl/bits/io/serving_request.h>
00015 #include <stxxl/bits/io/disk_queues.h>
00016 
00017 
00018 __STXXL_BEGIN_NAMESPACE
00019 
00020 
00021 request_ptr disk_queued_file::aread(
00022     void * buffer,
00023     offset_type pos,
00024     size_type bytes,
00025     const completion_handler & on_cmpl)
00026 {
00027     request_ptr req(new serving_request(on_cmpl, this, buffer, pos, bytes,
00028                                         request::READ));
00029 
00030     disk_queues::get_instance()->add_request(req, get_queue_id());
00031 
00032     return req;
00033 }
00034 
00035 request_ptr disk_queued_file::awrite(
00036     void * buffer,
00037     offset_type pos,
00038     size_type bytes,
00039     const completion_handler & on_cmpl)
00040 {
00041     request_ptr req(new serving_request(on_cmpl, this, buffer, pos, bytes,
00042                                         request::WRITE));
00043 
00044     disk_queues::get_instance()->add_request(req, get_queue_id());
00045 
00046     return req;
00047 }
00048 
00049 __STXXL_END_NAMESPACE
00050 // vim: et:ts=4:sw=4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines