dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages

Provides a mechanism to ensure only one instance runs Based on https://stackoverflow.com/a/28172162. More...

Classes

class  RunGuard
 

Functions

static RunGuardRunGuard::instance (const QString &key)
 Get instance of this singleton. More...
 
bool RunGuard::tryToRun ()
 Attempt to run and fail if another instance is running. More...
 
quint64 RunGuard::secondaryAttempts ()
 Number of secondary instances attempted to start. More...
 

Detailed Description

Provides a mechanism to ensure only one instance runs Based on https://stackoverflow.com/a/28172162.

Provides a mechanism to ensure only one instance runs.

Function Documentation

RunGuard & RunGuard::instance ( const QString &  key)
static

Get instance of this singleton.

Parameters
keyA key that is unique to your application
Returns
The single instance

Definition at line 70 of file runguard.cpp.

quint64 RunGuard::secondaryAttempts ( )

Number of secondary instances attempted to start.

Returns
number of attempts

Definition at line 110 of file runguard.cpp.

bool RunGuard::tryToRun ( )

Attempt to run and fail if another instance is running.

Returns
false on failure

Definition at line 92 of file runguard.cpp.