EXTENSION: RAII holder a locked extent of bytes in a file.
More...
#include "lockable_byte_io_handle.hpp"
|
|
class | lockable_byte_io_handle |
EXTENSION: RAII holder a locked extent of bytes in a file.
◆ extent_guard() [1/3]
157 : _h(h)
158 , _offset(offset)
160 , _kind(kind)
161 {
162 }
result< section_handle::extent_type > length(const section_handle &self) noexcept
Return the current maximum permitted extent of the memory section.
Definition map_handle.hpp:996
◆ extent_guard() [2/3]
| llfio_v2_xxx::lockable_byte_io_handle::extent_guard::extent_guard |
( |
| ) |
|
|
inlineconstexpr |
◆ extent_guard() [3/3]
| llfio_v2_xxx::lockable_byte_io_handle::extent_guard::extent_guard |
( |
extent_guard && | o | ) |
|
|
inlinenoexcept |
Move constructor.
172 : _h(o._h)
173 , _offset(o._offset)
174 , _length(o._length)
175 , _kind(o._kind)
176 {
177 o.release();
178 }
◆ ~extent_guard()
| llfio_v2_xxx::lockable_byte_io_handle::extent_guard::~extent_guard |
( |
| ) |
|
|
inline |
195 {
196 if(_h != nullptr)
197 {
199 }
200 }
void unlock() noexcept
Unlocks the locked extent immediately.
Definition lockable_byte_io_handle.hpp:212
◆ extent()
The extent to be unlocked.
209{ return std::make_tuple(_offset, _length, _kind); }
◆ handle()
The lockable_byte_io_handle to be unlocked.
◆ operator bool()
| llfio_v2_xxx::lockable_byte_io_handle::extent_guard::operator bool |
( |
| ) |
const |
|
inlineexplicitnoexcept |
True if extent guard is valid.
202{ return _h != nullptr; }
◆ operator=()
Move assign.
181 {
182 if(this == &o)
183 {
184 return *this;
185 }
187 _h = o._h;
188 _offset = o._offset;
189 _length = o._length;
190 _kind = o._kind;
191 o.release();
192 return *this;
193 }
◆ release()
| void llfio_v2_xxx::lockable_byte_io_handle::extent_guard::release |
( |
| ) |
|
|
inlinenoexcept |
Detach this RAII unlocker from the locked state.
223 {
224 _h = nullptr;
225 _offset = 0;
226 _length = 0;
228 }
@ unlocked
Exclude none.
Definition lockable_byte_io_handle.hpp:44
◆ set_handle()
Sets the lockable_byte_io_handle to be unlocked.
◆ unlock()
| void llfio_v2_xxx::lockable_byte_io_handle::extent_guard::unlock |
( |
| ) |
|
|
inlinenoexcept |
Unlocks the locked extent immediately.
213 {
214 if(_h != nullptr)
215 {
216 _h->unlock_file_range(_offset, _length);
218 }
219 }
void release() noexcept
Detach this RAII unlocker from the locked state.
Definition lockable_byte_io_handle.hpp:222
The documentation for this class was generated from the following file: