|
mio 1.1.0
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | basic_mmap |
| class | basic_shared_mmap |
Typedefs | |
| using | file_handle_type = int |
| template<typename ByteT > | |
| using | basic_mmap_source = basic_mmap< access_mode::read, ByteT > |
| template<typename ByteT > | |
| using | basic_mmap_sink = basic_mmap< access_mode::write, ByteT > |
| using | mmap_source = basic_mmap_source< char > |
| using | ummap_source = basic_mmap_source< unsigned char > |
| using | mmap_sink = basic_mmap_sink< char > |
| using | ummap_sink = basic_mmap_sink< unsigned char > |
| template<typename ByteT > | |
| using | basic_shared_mmap_source = basic_shared_mmap< access_mode::read, ByteT > |
| template<typename ByteT > | |
| using | basic_shared_mmap_sink = basic_shared_mmap< access_mode::write, ByteT > |
| using | shared_mmap_source = basic_shared_mmap_source< char > |
| using | shared_ummap_source = basic_shared_mmap_source< unsigned char > |
| using | shared_mmap_sink = basic_shared_mmap_sink< char > |
| using | shared_ummap_sink = basic_shared_mmap_sink< unsigned char > |
Enumerations | |
| enum | { map_entire_file = 0 } |
| enum class | access_mode { read , write } |
Functions | |
| template<access_mode AccessMode, typename ByteT > | |
| bool | operator== (const basic_mmap< AccessMode, ByteT > &a, const basic_mmap< AccessMode, ByteT > &b) |
| template<access_mode AccessMode, typename ByteT > | |
| bool | operator!= (const basic_mmap< AccessMode, ByteT > &a, const basic_mmap< AccessMode, ByteT > &b) |
| template<access_mode AccessMode, typename ByteT > | |
| bool | operator< (const basic_mmap< AccessMode, ByteT > &a, const basic_mmap< AccessMode, ByteT > &b) |
| template<access_mode AccessMode, typename ByteT > | |
| bool | operator<= (const basic_mmap< AccessMode, ByteT > &a, const basic_mmap< AccessMode, ByteT > &b) |
| template<access_mode AccessMode, typename ByteT > | |
| bool | operator> (const basic_mmap< AccessMode, ByteT > &a, const basic_mmap< AccessMode, ByteT > &b) |
| template<access_mode AccessMode, typename ByteT > | |
| bool | operator>= (const basic_mmap< AccessMode, ByteT > &a, const basic_mmap< AccessMode, ByteT > &b) |
| template<typename MMap , typename MappingToken > | |
| MMap | make_mmap (const MappingToken &token, int64_t offset, int64_t length, std::error_code &error) |
| template<typename MappingToken > | |
| mmap_source | make_mmap_source (const MappingToken &token, mmap_source::size_type offset, mmap_source::size_type length, std::error_code &error) |
| template<typename MappingToken > | |
| mmap_source | make_mmap_source (const MappingToken &token, std::error_code &error) |
| template<typename MappingToken > | |
| mmap_sink | make_mmap_sink (const MappingToken &token, mmap_sink::size_type offset, mmap_sink::size_type length, std::error_code &error) |
| template<typename MappingToken > | |
| mmap_sink | make_mmap_sink (const MappingToken &token, std::error_code &error) |
| size_t | page_size () |
| size_t | make_offset_page_aligned (size_t offset) noexcept |
| using mio::basic_mmap_sink = typedef basic_mmap<access_mode::write, ByteT> |
This is the basis for all read-write mmap objects and should be preferred over directly using basic_mmap.
| using mio::basic_mmap_source = typedef basic_mmap<access_mode::read, ByteT> |
This is the basis for all read-only mmap objects and should be preferred over directly using basic_mmap.
| using mio::basic_shared_mmap_sink = typedef basic_shared_mmap<access_mode::write, ByteT> |
This is the basis for all read-write mmap objects and should be preferred over directly using basic_shared_mmap.
| using mio::basic_shared_mmap_source = typedef basic_shared_mmap<access_mode::read, ByteT> |
This is the basis for all read-only mmap objects and should be preferred over directly using basic_shared_mmap.
| using mio::file_handle_type = typedef int |
| using mio::mmap_sink = typedef basic_mmap_sink<char> |
| using mio::mmap_source = typedef basic_mmap_source<char> |
These aliases cover the most common use cases, both representing a raw byte stream (either with a char or an unsigned char/uint8_t).
| using mio::shared_mmap_sink = typedef basic_shared_mmap_sink<char> |
| using mio::shared_mmap_source = typedef basic_shared_mmap_source<char> |
These aliases cover the most common use cases, both representing a raw byte stream (either with a char or an unsigned char/uint8_t).
| using mio::shared_ummap_sink = typedef basic_shared_mmap_sink<unsigned char> |
| using mio::shared_ummap_source = typedef basic_shared_mmap_source<unsigned char> |
| using mio::ummap_sink = typedef basic_mmap_sink<unsigned char> |
| using mio::ummap_source = typedef basic_mmap_source<unsigned char> |
|
strong |
This is used by basic_mmap to determine whether to create a read-only or a read-write memory mapping.
| Enumerator | |
|---|---|
| read | |
| write | |
| MMap mio::make_mmap | ( | const MappingToken & | token, |
| int64_t | offset, | ||
| int64_t | length, | ||
| std::error_code & | error | ||
| ) |
Convenience factory method that constructs a mapping for any basic_mmap or basic_mmap type.
| mmap_sink mio::make_mmap_sink | ( | const MappingToken & | token, |
| mmap_sink::size_type | offset, | ||
| mmap_sink::size_type | length, | ||
| std::error_code & | error | ||
| ) |
Convenience factory method.
MappingToken may be a String (std::string, std::string_view, const char*, std::filesystem::path, std::vector<char>, or similar), or a mmap_sink::handle_type.
| mmap_sink mio::make_mmap_sink | ( | const MappingToken & | token, |
| std::error_code & | error | ||
| ) |
| mmap_source mio::make_mmap_source | ( | const MappingToken & | token, |
| mmap_source::size_type | offset, | ||
| mmap_source::size_type | length, | ||
| std::error_code & | error | ||
| ) |
Convenience factory method.
MappingToken may be a String (std::string, std::string_view, const char*, std::filesystem::path, std::vector<char>, or similar), or a mmap_source::handle_type.
| mmap_source mio::make_mmap_source | ( | const MappingToken & | token, |
| std::error_code & | error | ||
| ) |
|
inlinenoexcept |
Alligns offset to the operating's system page size such that it subtracts the difference until the nearest page boundary before offset, or does nothing if offset is already page aligned.
| bool mio::operator!= | ( | const basic_mmap< AccessMode, ByteT > & | a, |
| const basic_mmap< AccessMode, ByteT > & | b | ||
| ) |
| bool mio::operator< | ( | const basic_mmap< AccessMode, ByteT > & | a, |
| const basic_mmap< AccessMode, ByteT > & | b | ||
| ) |
| bool mio::operator<= | ( | const basic_mmap< AccessMode, ByteT > & | a, |
| const basic_mmap< AccessMode, ByteT > & | b | ||
| ) |
| bool mio::operator== | ( | const basic_mmap< AccessMode, ByteT > & | a, |
| const basic_mmap< AccessMode, ByteT > & | b | ||
| ) |
| bool mio::operator> | ( | const basic_mmap< AccessMode, ByteT > & | a, |
| const basic_mmap< AccessMode, ByteT > & | b | ||
| ) |
| bool mio::operator>= | ( | const basic_mmap< AccessMode, ByteT > & | a, |
| const basic_mmap< AccessMode, ByteT > & | b | ||
| ) |
|
inline |
Determines the operating system's page allocation granularity. On the first call to this function, it invokes the operating system specific syscall to determine the page size, caches the value, and returns it. Any subsequent call to this function serves the cached value, so no further syscalls are made.