NDEVR
API Documentation
CommandLockObject

Used with DesignObjectLookups to lock the application for a critical process. More...

Collaboration diagram for CommandLockObject:
[legend]

Public Member Functions

 CommandLockObject (DesignCommandManager *manager, const TranslatedString &title=TranslatedString())
 Constructs a CommandLockObject associated with the given command manager.
 ~CommandLockObject ()
 Destroys the CommandLockObject, releasing the lock if held.
const TranslatedString hint () const
 Returns the hint string for this lock.
bool isLocked () const
 Checks whether this lock is currently held.
void lock ()
 Acquires the lock, blocking until it is available.
void setHint (const TranslatedString &hint)
 Sets a hint string providing additional context about the locked operation.
void setTitle (const TranslatedString &title)
 Sets the user-facing title describing the locked operation.
const TranslatedString title () const
 Returns the title string for this lock.
void tryLock ()
 Attempts to acquire the lock without blocking.
void unlock ()
 Releases the lock so other operations may proceed.

Protected Attributes

TranslatedString m_hint
 Additional hint text providing context about the locked operation.
UUID m_id
 Unique identifier for this lock instance.
DesignCommandManagerm_manager
 The command manager that owns and coordinates this lock.
TranslatedString m_title
 User-facing title describing the locked operation.

Detailed Description

Used with DesignObjectLookups to lock the application for a critical process.


Will potentially display the title to the end user.

Definition at line 45 of file CommandLock.h.

Constructor & Destructor Documentation

◆ CommandLockObject()

CommandLockObject::CommandLockObject ( DesignCommandManager * manager,
const TranslatedString & title = TranslatedString() )

Constructs a CommandLockObject associated with the given command manager.

Parameters
[in]managerThe DesignCommandManager that owns this lock.
[in]titleAn optional user-facing title describing the locked operation.

References title().

Member Function Documentation

◆ hint()

const TranslatedString CommandLockObject::hint ( ) const

Returns the hint string for this lock.

Returns
The translated hint describing the locked operation.

Referenced by setHint().

◆ isLocked()

bool CommandLockObject::isLocked ( ) const

Checks whether this lock is currently held.

Returns
True if the lock is acquired, false otherwise.

◆ setHint()

void CommandLockObject::setHint ( const TranslatedString & hint)

Sets a hint string providing additional context about the locked operation.

Parameters
[in]hintThe translated hint string.

References hint().

◆ setTitle()

void CommandLockObject::setTitle ( const TranslatedString & title)

Sets the user-facing title describing the locked operation.

Parameters
[in]titleThe translated title string to display.

References title().

◆ title()

const TranslatedString CommandLockObject::title ( ) const

Returns the title string for this lock.

Returns
The translated title describing the locked operation.

Referenced by CommandLockObject(), and setTitle().

◆ tryLock()

void CommandLockObject::tryLock ( )

Attempts to acquire the lock without blocking.

Does nothing if the lock cannot be acquired.


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