33 MapMode mapMode, std::error_code& ec);
40 : m_size(rhs.m_size), m_mapping(rhs.m_mapping) {
41 rhs.m_mapping =
nullptr;
43 m_fileHandle = rhs.m_fileHandle;
44 rhs.m_fileHandle =
nullptr;
53 m_mapping = rhs.m_mapping;
54 rhs.m_mapping =
nullptr;
56 m_fileHandle = rhs.m_fileHandle;
57 rhs.m_fileHandle =
nullptr;
62 explicit operator bool()
const {
63 return m_mapping !=
nullptr;
73 return static_cast<uint8_t*
>(m_mapping);
76 return static_cast<const uint8_t*
>(m_mapping);
86 void* m_mapping =
nullptr;
Definition: MappedFileRegion.h:23
MappedFileRegion(fs::file_t f, uint64_t length, uint64_t offset, MapMode mapMode, std::error_code &ec)
~MappedFileRegion()
Definition: MappedFileRegion.h:34
MappedFileRegion(MappedFileRegion &&rhs)
Definition: MappedFileRegion.h:39
MappedFileRegion & operator=(const MappedFileRegion &)=delete
MappedFileRegion & operator=(MappedFileRegion &&rhs)
Definition: MappedFileRegion.h:48
static size_t GetAlignment()
Returns required alignment.
uint8_t * data() const
Definition: MappedFileRegion.h:72
MappedFileRegion(const MappedFileRegion &)=delete
MapMode
Definition: MappedFileRegion.h:25
@ kPriv
May modify via data, but changes are lost on destruction.
Definition: MappedFileRegion.h:28
@ kReadOnly
May only access map via const_data as read only.
Definition: MappedFileRegion.h:26
@ kReadWrite
May access map via data and modify it. Written to path.
Definition: MappedFileRegion.h:27
const uint8_t * const_data() const
Definition: MappedFileRegion.h:75
MappedFileRegion()=default
uint64_t size() const
Definition: MappedFileRegion.h:69
::uint64_t uint64_t
Definition: Meta.h:58
::uint8_t uint8_t
Definition: Meta.h:52
int file_t
Definition: fs.h:58
/file This file defines the SmallVector class.
Definition: AprilTagFieldLayout.h:18