RADLib
RADical C++ application framework
RADCore::RADLockFile Class Reference

Advisory filesystem lock file. More...

#include <RADCore.h>

Public Member Functions

 RADLockFile (std::string fileName)
 Creates a lock file object for fileName. More...
 
 ~RADLockFile ()
 Unlocks on destruction when needed. More...
 
 RADLockFile (const RADLockFile &)=delete
 Lock files cannot be copied. More...
 
RADLockFileoperator= (const RADLockFile &)=delete
 Lock files cannot be copied. More...
 
bool tryLock ()
 Attempts to acquire the lock. More...
 
void unlock ()
 Releases the lock if held. More...
 
bool isLocked () const
 Returns true when this object holds the lock. More...
 
const std::string & fileName () const
 Returns the lock file path. More...
 

Detailed Description

Advisory filesystem lock file.

Constructor & Destructor Documentation

◆ RADLockFile() [1/2]

RADCore::RADLockFile::RADLockFile ( std::string  fileName)
explicit

Creates a lock file object for fileName.

◆ ~RADLockFile()

RADCore::RADLockFile::~RADLockFile ( )

Unlocks on destruction when needed.

◆ RADLockFile() [2/2]

RADCore::RADLockFile::RADLockFile ( const RADLockFile )
delete

Lock files cannot be copied.

Member Function Documentation

◆ fileName()

const std::string& RADCore::RADLockFile::fileName ( ) const

Returns the lock file path.

◆ isLocked()

bool RADCore::RADLockFile::isLocked ( ) const

Returns true when this object holds the lock.

◆ operator=()

RADLockFile& RADCore::RADLockFile::operator= ( const RADLockFile )
delete

Lock files cannot be copied.

◆ tryLock()

bool RADCore::RADLockFile::tryLock ( )

Attempts to acquire the lock.

◆ unlock()

void RADCore::RADLockFile::unlock ( )

Releases the lock if held.


The documentation for this class was generated from the following file: