16 #ifndef STXXL_IO_FILE_HEADER
17 #define STXXL_IO_FILE_HEADER
21 #if defined (__linux__)
22 #define STXXL_CHECK_BLOCK_ALIGNING
46 class completion_handler;
60 file() : request_ref_cnt(0) { }
86 static const int DEFAULT_QUEUE = -1;
87 static const int NO_QUEUE = -2;
88 static const int NO_ALLOCATOR = -1;
119 assert(request_ref_cnt > 0);
126 return request_ref_cnt;
131 virtual void set_size(offset_type newsize) = 0;
135 virtual offset_type size() = 0;
140 virtual int get_queue_id()
const = 0;
144 virtual int get_allocator_id()
const = 0;
148 return get_queue_id();
152 virtual void lock() = 0;
174 int nr = get_request_nref();
176 STXXL_ERRMSG(
"stxxl::file is being deleted while there are still " << nr <<
" (unfinished) requests referencing it");
191 static int unlink(
const char* path);
210 #endif // !STXXL_IO_FILE_HEADER
virtual void discard(offset_type offset, offset_type size)
Discard a region of the file (mark it unused). Some specialized file types may need to know freed reg...
static const int bytes
number of bytes in uint_pair
Completion handler class (Loki-style).
request::size_type size_type
the size of a request
Defines interface of file.
virtual const char * io_type() const
Identifies the type of I/O implementation.
Aquire a lock that's valid until the end of scope.
#define STXXL_BEGIN_NAMESPACE
void STXXL_UNUSED(const U &)
virtual void export_files(offset_type offset, offset_type length, std::string prefix)
open_mode
Definition of acceptable file open modes.
stxxl::internal_size_type size_type
file()
Initializes file object.
uint64 external_size_type
mutex request_ref_cnt_mutex
virtual int get_physical_device_id() const
request::offset_type offset_type
the offset of a request, also the size of the file
Request with basic properties like file and offset.
virtual void close_remove()
close and remove file
void delete_request_ref()
#define STXXL_END_NAMESPACE