Posix file lock C++ wrapping class Following RAII, the lock is acquired on creation and released on destruction. Releasing the locks works even if the process crashes with a segfault or using SIGKILL. 'lslocks' can be used to display all system-wide locks (see man page)
More...
#include <file_lock.hpp>
|
using | FileName_t = cxx::string< 250 > |
|
using | PathName_t = cxx::string< 1024 > |
|
using | CreationPattern_t = Creation< FileLock, FileLockError > |
|
using | result_t = iox::cxx::expected< FileLock, FileLockError > |
|
using | errorType_t = FileLockError |
|
|
static constexpr int32_t | ERROR_CODE = -1 |
|
static constexpr int32_t | INVALID_FD = -1 |
|
|
class | DesignPattern::Creation< FileLock, FileLockError > |
|
|
static result_t | create (Targs &&... args) noexcept |
| factory method which guarantees that either a working object is produced or an error value describing the error during construction More...
|
|
static result_t | verify (FileLock &&newObject) noexcept |
| verifies if a class was created successfully More...
|
|
static iox::cxx::expected< FileLockError > | placementCreate (void *const memory, Targs &&... args) noexcept |
| factory method which guarantees that either a working object is produced or an error value describing the error during construction More...
|
|
bool | m_isInitialized |
|
FileLockError | m_errorValue |
|
Posix file lock C++ wrapping class Following RAII, the lock is acquired on creation and released on destruction. Releasing the locks works even if the process crashes with a segfault or using SIGKILL. 'lslocks' can be used to display all system-wide locks (see man page)
.and_then([] { std::cout << "We aquired the lock!" << std::endl; })
.or_else([](auto& error) {
if (error == FileLockError::LOCKED_BY_OTHER_PROCESS)
{
std::cout << "Some other process is running and holds the lock!" << std::endl;
}
});
static result_t create(Targs &&... args) noexcept
factory method which guarantees that either a working object is produced or an error value describing...
Definition: creation.inl:41
The documentation for this class was generated from the following file: