Base Framework
|
A lockable file region. More...
#include <base/io/LockableRegion.h>
Inherits Object.
Public Member Functions | |
LockableRegion (const File &file, const FileRegion ®ion, bool exclusive) | |
const FileRegion & | getRegion () const noexcept |
void | lock (const FileRegion ®ion, bool exclusive=true) |
~LockableRegion () | |
A lockable file region.
A lockable file region.
LockableRegion::LockableRegion | ( | const File & | file, |
const FileRegion & | region, | ||
bool | exclusive | ||
) |
Initializes the file region lock.
file | The file. |
region | The file region to be locked. |
exclusive | Specifies that the region should be locked exclusively (if false the region is locked shared). This argument is true by default. |
LockableRegion::~LockableRegion | ( | ) |
Destroys the file region lock (unlocks the region).
|
inlinenoexcept |
Returns the locked file region.
void LockableRegion::lock | ( | const FileRegion & | region, |
bool | exclusive = true |
||
) |
Lock the specified file region (the old region is unlocked first).
region | The new file region to be locked. |
exclusive | Specifies that the region should be locked exclusively (if false the region is locked shared). This argument is true by default. |