NDEVR
API Documentation
CommandLock.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Design
28File: CommandLock
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/TranslatedString.h>
35#include <NDEVR/UUID.h>
36namespace NDEVR
37{
38 class WLock;
102}
103
104
105
void tryLock()
Attempts to acquire the lock without blocking.
CommandLockObject(DesignCommandManager *manager, const TranslatedString &title=TranslatedString())
Constructs a CommandLockObject associated with the given command manager.
void unlock()
Releases the lock so other operations may proceed.
bool isLocked() const
Checks whether this lock is currently held.
~CommandLockObject()
Destroys the CommandLockObject, releasing the lock if held.
void lock()
Acquires the lock, blocking until it is available.
const TranslatedString title() const
Returns the title string for this lock.
void setTitle(const TranslatedString &title)
Sets the user-facing title describing the locked operation.
const TranslatedString hint() const
Returns the hint string for this lock.
TranslatedString m_title
User-facing title describing the locked operation.
Definition CommandLock.h:99
void setHint(const TranslatedString &hint)
Sets a hint string providing additional context about the locked operation.
UUID m_id
Unique identifier for this lock instance.
Definition CommandLock.h:97
DesignCommandManager * m_manager
The command manager that owns and coordinates this lock.
Definition CommandLock.h:98
TranslatedString m_hint
Additional hint text providing context about the locked operation.
Stores logic for performing, undoing, or redoing DesignCommands.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
Used to lock a particular variable for writing.
Definition RWLock.h:272
The primary namespace for the NDEVR SDK.