CoreComponents 3.0.0
A Modern C++ Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Modules
ReadLock Class Reference

Advisory file lock for shared access. More...

#include <cc/FileLock>

Inheritance diagram for ReadLock:

Public Member Functions

 ReadLock (const File &file, long long start=0, long long length=0, Seek whence=Seek::Begin)
 Create a shared file lock for a file area.
 
 ReadLock (const File &file, long long start=0, Seek whence=Seek::Begin)
 Create a shared file lock for a file area.
 
- Public Member Functions inherited from FileLock
 FileLock (const File &file, FileContention type, long long start=0, long long length=0, Seek whence=Seek::Begin)
 Create an advisory file lock for a file area.
 
 FileLock (const File &file, FileContention type, long long start, Seek whence=Seek::Begin)
 Create an advisory file lock for a file area.
 
bool tryAcquire ()
 Try to acquire the file lock.
 
void acquire ()
 Wait and acquire lock.
 
void release ()
 Release lock.
 

Detailed Description

Advisory file lock for shared access.

Constructor & Destructor Documentation

◆ ReadLock() [1/2]

ReadLock ( const File & file,
long long start = 0,
long long length = 0,
Seek whence = Seek::Begin )
explicit

Create a shared file lock for a file area.

Parameters
fileFile to lock
startStart offset of the file area
lengthLength of the file area
whenceInterpretation of start offset

◆ ReadLock() [2/2]

ReadLock ( const File & file,
long long start = 0,
Seek whence = Seek::Begin )
explicit

Create a shared file lock for a file area.

Parameters
fileFile to lock
startStart offset of the file area
whenceInterpretation of start offset