STXXL
1.4-dev
|
Access point to disks properties. Since 1.4.0: no config files are read automatically!
Public Member Functions | |
Initialization Functions | |
void | check_initialized () |
Check that initialize() was called. More... | |
void | load_config_file (const std::string &config_path) |
Load disk configuration file. More... | |
void | load_default_config () |
Load default configuration. More... | |
config & | add_disk (const disk_config &cfg) |
Add a disk to the configuration list. More... | |
Query Functions | |
size_t | disks_number () |
Returns number of disks available to user. More... | |
std::pair< unsigned, unsigned > | regular_disk_range () const |
Returns contiguous range of regular disks w/o flash devices in the array of all disks. More... | |
std::pair< unsigned, unsigned > | flash_range () const |
Returns contiguous range of flash devices in the array of all disks. More... | |
disk_config & | disk (size_t disk) |
Returns mutable disk_config structure for additional disk parameters. More... | |
const disk_config & | disk (size_t disk) const |
Returns constant disk_config structure for additional disk parameters. More... | |
const std::string & | disk_path (size_t disk) const |
Returns path of disks. More... | |
stxxl::uint64 | disk_size (size_t disk) const |
Returns disk size. More... | |
const std::string & | disk_io_impl (size_t disk) const |
Returns name of I/O implementation of particular disk. More... | |
uint64 | total_size () const |
Returns the total size over all disks. More... | |
Private Types | |
typedef std::vector< disk_config > | disk_list_type |
typedef of list of configured disks More... | |
Private Member Functions | |
config () | |
Constructor: this must be inlined to print the header version string. More... | |
~config () | |
deletes autogrow files More... | |
void | find_config () |
Search several places for a config file. More... | |
void | initialize () |
If disk list is empty, then search different locations for a disk configuration file, or load a default config if everything fails. More... | |
Private Attributes | |
disk_list_type | disks_list |
list of configured disks More... | |
unsigned | first_flash |
In disks_list, flash devices come after all regular disks. More... | |
bool | is_initialized |
Finished initializing config. More... | |
Automatic Disk Enumeration Functions | |
unsigned int | m_max_device_id |
static counter for automatic physical device enumeration More... | |
unsigned int | get_max_device_id () |
Returns automatic physical device id counter. More... | |
unsigned int | get_next_device_id () |
Returns next automatic physical device id counter. More... | |
void | update_max_device_id (unsigned int devid) |
Update the automatic physical device id counter. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from stxxl::singleton< config > | |
static instance_pointer | get_instance () |
|
private |
|
inlineprivate |
Constructor: this must be inlined to print the header version string.
Definition at line 130 of file config.h.
References stxxl::get_version_string_long(), stxxl::print_library_version_mismatch(), and STXXL_MSG.
|
private |
|
inline |
Add a disk to the configuration list.
|
inline |
Check that initialize() was called.
Definition at line 155 of file config.h.
Referenced by stxxl::block_manager::block_manager().
|
inline |
Returns mutable disk_config structure for additional disk parameters.
Definition at line 226 of file config.h.
Referenced by stxxl::block_manager::block_manager().
|
inline |
Returns constant disk_config structure for additional disk parameters.
|
inline |
|
inline |
|
inline |
|
inline |
Returns number of disks available to user.
Definition at line 203 of file config.h.
Referenced by stxxl::block_manager::block_manager(), and stxxl::stable_ksort().
|
private |
Search several places for a config file.
Definition at line 68 of file config.cpp.
References stxxl::exist_file().
|
inline |
unsigned int stxxl::config::get_max_device_id | ( | ) |
Returns automatic physical device id counter.
Definition at line 178 of file config.cpp.
unsigned int stxxl::config::get_next_device_id | ( | ) |
Returns next automatic physical device id counter.
Definition at line 184 of file config.cpp.
|
private |
If disk list is empty, then search different locations for a disk configuration file, or load a default config if everything fails.
Definition at line 55 of file config.cpp.
void stxxl::config::load_config_file | ( | const std::string & | config_path | ) |
Load disk configuration file.
Definition at line 142 of file config.cpp.
References stxxl::disk_config::flash, stxxl::disk_config::parse_line(), and STXXL_THROW.
void stxxl::config::load_default_config | ( | ) |
Load default configuration.
Definition at line 116 of file config.cpp.
References stxxl::disk_config::autogrow, stxxl::disk_config::delete_on_exit, stxxl::disk_config::path, STXXL_ERRMSG, and STXXL_THROW_WIN_LASTERROR.
|
inline |
uint64 stxxl::config::total_size | ( | ) | const |
Returns the total size over all disks.
Definition at line 196 of file config.cpp.
void stxxl::config::update_max_device_id | ( | unsigned int | devid | ) |
Update the automatic physical device id counter.
Definition at line 190 of file config.cpp.
|
private |
|
private |
|
private |
|
protected |