Seamly2D
Code documentation
VLockGuard< Guarded > Class Template Reference

#include <vlockguard.h>

Collaboration diagram for VLockGuard< Guarded >:

Public Member Functions

 VLockGuard (const QString &lockName, int stale=0, int timeout=0)
 
template<typename Alloc >
 VLockGuard (const QString &lockName, Alloc a, int stale=0, int timeout=0)
 
template<typename Alloc , typename Delete >
 VLockGuard (const QString &lockName, Alloc a, Delete d, int stale=0, int timeout=0)
 
const std::shared_ptr< Guarded > & GetProtected () const
 
int GetLockError () const
 
bool IsLocked () const
 
QString GetLockFile () const
 

Private Member Functions

bool TryLock (const QString &lockName, int stale, int timeout)
 

Private Attributes

std::shared_ptr< Guarded > holder
 
int lockError
 
QString lockFile
 
std::shared_ptr< QLockFile > lock
 

Detailed Description

template<typename Guarded>
class VLockGuard< Guarded >

Definition at line 76 of file vlockguard.h.

Constructor & Destructor Documentation

◆ VLockGuard() [1/3]

template<typename Guarded >
VLockGuard< Guarded >::VLockGuard ( const QString &  lockName,
int  stale = 0,
int  timeout = 0 
)
explicit

◆ VLockGuard() [2/3]

template<typename Guarded >
template<typename Alloc >
VLockGuard< Guarded >::VLockGuard ( const QString &  lockName,
Alloc  a,
int  stale = 0,
int  timeout = 0 
)

◆ VLockGuard() [3/3]

template<typename Guarded >
template<typename Alloc , typename Delete >
VLockGuard< Guarded >::VLockGuard ( const QString &  lockName,
Alloc  a,
Delete  d,
int  stale = 0,
int  timeout = 0 
)

Member Function Documentation

◆ GetLockError()

template<typename Guarded >
int VLockGuard< Guarded >::GetLockError

Definition at line 148 of file vlockguard.h.

◆ GetLockFile()

template<typename Guarded >
QString VLockGuard< Guarded >::GetLockFile

Definition at line 162 of file vlockguard.h.

◆ GetProtected()

template<typename Guarded >
const std::shared_ptr< Guarded > & VLockGuard< Guarded >::GetProtected

Definition at line 141 of file vlockguard.h.

Referenced by VApplication::ClearOldLogs().

◆ IsLocked()

template<typename Guarded >
bool VLockGuard< Guarded >::IsLocked

◆ TryLock()

template<typename Guarded >
bool VLockGuard< Guarded >::TryLock ( const QString &  lockName,
int  stale,
int  timeout 
)
private

Definition at line 169 of file vlockguard.h.

References NoError.

Referenced by VLockGuard< Guarded >::VLockGuard().

Member Data Documentation

◆ holder

template<typename Guarded >
std::shared_ptr<Guarded> VLockGuard< Guarded >::holder
private

Definition at line 95 of file vlockguard.h.

Referenced by VLockGuard< Guarded >::VLockGuard().

◆ lock

template<typename Guarded >
std::shared_ptr<QLockFile> VLockGuard< Guarded >::lock
private

Definition at line 98 of file vlockguard.h.

◆ lockError

template<typename Guarded >
int VLockGuard< Guarded >::lockError
private

Definition at line 96 of file vlockguard.h.

◆ lockFile

template<typename Guarded >
QString VLockGuard< Guarded >::lockFile
private

Definition at line 97 of file vlockguard.h.


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