31 int options,
int physical_device_id,
int disk_allocator_id)
35 cfg.
queue = physical_device_id;
41 return create_file(cfg, options, disk_allocator_id);
77 tlx::make_counting<syscall_file>(
87 "a raw block device, but it is a normal file!" 104 else if (cfg.
io_impl ==
"fileperblock_syscall")
107 tlx::make_counting<fileperblock_file<syscall_file> >(
113 else if (cfg.
io_impl ==
"memory")
116 tlx::make_counting<memory_file>(
122 #if FOXXLL_HAVE_LINUXAIO_FILE 124 else if (cfg.
io_impl ==
"linuxaio")
130 tlx::make_counting<linuxaio_file>(
131 cfg.
path, mode, cfg.
queue, disk_allocator_id,
142 "a raw block device, but it is a normal file!" 160 #if FOXXLL_HAVE_MMAP_FILE 161 else if (cfg.
io_impl ==
"mmap")
164 tlx::make_counting<mmap_file>(
174 else if (cfg.
io_impl ==
"fileperblock_mmap")
177 tlx::make_counting<fileperblock_file<mmap_file> >(
184 #if FOXXLL_HAVE_WINCALL_FILE 185 else if (cfg.
io_impl ==
"wincall")
188 tlx::make_counting<wincall_file>(
194 else if (cfg.
io_impl ==
"fileperblock_wincall")
197 tlx::make_counting<fileperblock_file<wincall_file> >(
207 "Unsupported disk I/O implementation '" << cfg.
io_impl <<
"'." external_size_type size
file size to initially allocate
void update_max_device_id(unsigned int devid)
Update the automatic physical device id counter.
unsigned int next_device_id()
Returns next automatic physical device id counter.
std::string path
the file path used by the io implementation
static const unsigned int DEFAULT_DEVICE_ID
#define FOXXLL_THROW(exception_type, error_message)
Throws exception_type with "Error in [function] : [error_message]".
bool unlink_on_open
unlink file immediately after opening (available on most Unix)
std::string io_impl
io implementation to access file
implies DIRECT, fail if opening with DIRECT flag does not work.
file_ptr create_file(const std::string &io_impl, const std::string &filename, int options, int physical_device_id, int disk_allocator_id)
create fileio object from io_impl string and a few parameters
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
static instance_pointer get_instance()
return instance or create base instance if empty
High-performance smart pointer used as a wrapping reference counting pointer.
bool is_device() const
return true if file is special device node
bool raw_device
turned on by syscall fileio when the path points to a raw block device
int queue_length
desired queue length for linuxaio_file and linuxaio_queue
static const int DEFAULT_LINUXAIO_QUEUE
void lock() final
Locks file for reading and writing (acquires a lock in the file system).
void lock() final
Locks file for reading and writing (acquires a lock in the file system).
bool delete_on_exit
delete file on program exit (default for autoconfigurated files)
bool autogrow
autogrow file if more disk space is needed, automatically set if size == 0.
enum foxxll::disk_config::direct_type direct
void unlink()
unlink file without closing it.