15 #ifndef STXXL_MNG_CONFIG_HEADER
16 #define STXXL_MNG_CONFIG_HEADER
64 void parse_line(
const std::string& line);
70 std::string fileio_string()
const;
85 enum direct_type { DIRECT_OFF = 0, DIRECT_TRY = 1, DIRECT_ON = 2 } direct;
125 : is_initialized(false)
127 logger::get_instance();
151 if (!is_initialized) initialize();
155 void load_config_file(
const std::string& config_path);
158 void load_default_config();
166 disks_list.push_back(cfg);
181 return disks_list.size();
188 assert(is_initialized);
189 return std::pair<unsigned, unsigned>(0, first_flash);
196 assert(is_initialized);
197 return std::pair<unsigned, unsigned>(first_flash, (unsigned)disks_list.size());
204 return disks_list[disk];
210 assert(is_initialized);
211 return disks_list[disk];
219 assert(is_initialized);
220 return disks_list[disk].path;
228 assert(is_initialized);
229 return disks_list[disk].size;
236 assert(is_initialized);
237 return disks_list[disk].io_impl;
241 uint64 total_size()
const;
250 #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
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
bool is_initialized
Finished initializing config.
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