File locker.
More...
#include <FileLocker.h>
◆ FileLocker()
sese::system::FileLocker::FileLocker |
( |
int32_t | fd | ) |
|
|
inlineexplicit |
Initialize a file lock based on the file descriptor
- Parameters
-
◆ lock()
bool sese::system::FileLocker::lock |
( |
int64_t | start, |
|
|
int64_t | len ) |
|
nodiscard |
Apply a lock to the current file
- Parameters
-
start | Starting offset |
len | Length |
- Returns
- Whether the lock was successfully applied
Referenced by lockWrite().
◆ lockRead()
bool sese::system::FileLocker::lockRead |
( |
int64_t | start, |
|
|
int64_t | len ) |
|
nodiscard |
Apply a read lock to the current file
- Parameters
-
start | Starting offset |
len | Length |
- Returns
- Whether the lock was successfully applied
◆ lockWrite()
bool sese::system::FileLocker::lockWrite |
( |
int64_t | start, |
|
|
int64_t | len ) |
|
nodiscard |
Apply a write lock to the current file
- Parameters
-
start | Starting offset |
len | Length |
- Returns
- Whether the lock was successfully applied
References fd, and lock().
◆ unlock()
bool sese::system::FileLocker::unlock |
( |
| ) |
|
|
nodiscard |
Unlock the current file
- Returns
- Whether the unlock operation was successful
◆ fd
int32_t sese::system::FileLocker::fd {} |
|
private |
The documentation for this class was generated from the following files: