Store and manage the compatibility mode data associated with a FileHandle. More...
#include <compat_mode_manager.hpp>
Public Member Functions | |
CompatModeManager () noexcept=default | |
Construct an empty compatibility mode manager. | |
CompatModeManager (std::string const &file_path, std::string const &flags, mode_t mode, CompatMode compat_mode_requested, FileHandle *file_handle) | |
Construct a compatibility mode manager associated with a FileHandle. More... | |
CompatModeManager (const CompatModeManager &)=default | |
CompatModeManager & | operator= (const CompatModeManager &)=default |
CompatModeManager (CompatModeManager &&) noexcept=default | |
CompatModeManager & | operator= (CompatModeManager &&) noexcept=default |
bool | is_compat_mode_preferred () const noexcept |
Check if the compatibility mode for synchronous I/O of the associated FileHandle is expected to be CompatMode::ON. More... | |
bool | is_compat_mode_preferred_for_async () const noexcept |
Check if the compatibility mode for asynchronous I/O of the associated FileHandle is expected to be CompatMode::ON. More... | |
CompatMode | compat_mode_requested () const noexcept |
Retrieve the original compatibility mode requested. More... | |
void | validate_compat_mode_for_async () const |
Determine if asynchronous I/O can be performed or not (throw exceptions) according to the existing compatibility mode data in the manager. More... | |
Store and manage the compatibility mode data associated with a FileHandle.
Definition at line 31 of file compat_mode_manager.hpp.
kvikio::CompatModeManager::CompatModeManager | ( | std::string const & | file_path, |
std::string const & | flags, | ||
mode_t | mode, | ||
CompatMode | compat_mode_requested, | ||
FileHandle * | file_handle | ||
) |
Construct a compatibility mode manager associated with a FileHandle.
According to the file path, requested compatibility mode, and the system configuration, the compatibility manager:
file_path | Refer to FileHandle::FileHandle(std::string const&, std::string const&, mode_t, CompatMode). |
flags | Same as above. |
mode | Same as above. |
compat_mode_requested | Same as above. |
file_handle | Pointer to the FileHandle object that owns this compatibility mode manager. |
|
noexcept |
Retrieve the original compatibility mode requested.
|
noexcept |
Check if the compatibility mode for synchronous I/O of the associated FileHandle is expected to be CompatMode::ON.
|
noexcept |
Check if the compatibility mode for asynchronous I/O of the associated FileHandle is expected to be CompatMode::ON.
void kvikio::CompatModeManager::validate_compat_mode_for_async | ( | ) | const |
Determine if asynchronous I/O can be performed or not (throw exceptions) according to the existing compatibility mode data in the manager.
Asynchronous I/O cannot be performed, for instance, when compat_mode_requested() is CompatMode::OFF, is_compat_mode_preferred() is CompatMode::OFF, but is_compat_mode_preferred_for_async() is CompatMode::ON (due to missing cuFile stream API or cuFile configuration file).