15 #ifndef STXXL_MNG_CONFIG_HEADER
16 #define STXXL_MNG_CONFIG_HEADER
63 void parse_line(
const std::string& line);
69 std::string fileio_string()
const;
84 enum direct_type { DIRECT_OFF = 0, DIRECT_TRY = 1, DIRECT_ON = 2 } direct;
131 : is_initialized(false)
133 logger::get_instance();
157 if (!is_initialized) initialize();
161 void load_config_file(
const std::string& config_path);
164 void load_default_config();
172 disks_list.push_back(cfg);
187 unsigned int get_max_device_id();
190 unsigned int get_next_device_id();
193 void update_max_device_id(
unsigned int devid);
206 return disks_list.size();
213 assert(is_initialized);
214 return std::pair<unsigned, unsigned>(0, first_flash);
221 assert(is_initialized);
222 return std::pair<unsigned, unsigned>(first_flash, (unsigned)disks_list.size());
229 return disks_list[disk];
235 assert(is_initialized);
236 return disks_list[disk];
244 assert(is_initialized);
245 return disks_list[disk].path;
253 assert(is_initialized);
254 return disks_list[disk].size;
261 assert(is_initialized);
262 return disks_list[disk].io_impl;
266 uint64 total_size()
const;
275 #endif // !STXXL_MNG_CONFIG_HEADER
int queue
select request queue for disk. Use different queues for files on different disks. queue=-1 -> default...
unsigned long long int uint64
direct_type
tristate variable: direct=0 -> force direct OFF, direct=1 -> try direct ON, if fails print warning an...
disk_config & disk(size_t disk)
Returns mutable disk_config structure for additional disk parameters.
void check_initialized()
Check that initialize() was called.
unsigned first_flash
In disks_list, flash devices come after all regular disks.
std::vector< disk_config > disk_list_type
typedef of list of configured disks
unsigned int m_max_device_id
static counter for automatic physical device enumeration
bool unlink_on_open
unlink file immediately after opening (available on most Unix)
stxxl::uint64 disk_size(size_t disk) const
Returns disk size.
const disk_config & disk(size_t disk) const
Returns constant disk_config structure for additional disk parameters.
const char * get_version_string_long()
Return longer "X.Y.Z (feature) (version)" version string (of headers)
disk_list_type disks_list
list of configured disks
void print_library_version_mismatch()
Check and print mismatch between header and library versions.
bool delete_on_exit
delete file on program exit (default for autoconfigurated files)
std::string path
the file path used by the io implementation
Encapsulate the configuration of one "disk". The disk is actually a file I/O object which block_manag...
const std::string & disk_io_impl(size_t disk) const
Returns name of I/O implementation of particular disk.
size_t disks_number()
Returns number of disks available to user.
bool autogrow
autogrow file if more disk space is needed, automatically set if size == 0.
config & add_disk(const disk_config &cfg)
Add a disk to the configuration list.
const std::string & disk_path(size_t disk) const
Returns path of disks.
#define STXXL_BEGIN_NAMESPACE
unsigned int device_id
the selected physical device id (e.g. for calculating prefetching sequences). If -1 then the device i...
bool is_initialized
Finished initializing config.
int queue_length
desired queue length for linuxaio_file and linuxaio_queue
Access point to disks properties. Since 1.4.0: no config files are read automatically! ...
config()
Constructor: this must be inlined to print the header version string.
bool raw_device
turned on by syscall fileio when the path points to a raw block device
std::pair< unsigned, unsigned > flash_range() const
Returns contiguous range of flash devices in the array of all disks.
bool flash
marks flash drives (configuration entries with flash= instead of disk=)
std::pair< unsigned, unsigned > regular_disk_range() const
Returns contiguous range of regular disks w/o flash devices in the array of all disks.
std::string io_impl
io implementation to access file
uint64 size
file size to initially allocate
#define STXXL_END_NAMESPACE