QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsreadwritelocker.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsreadwritelocker.cpp
3
-------------------------
4
begin : September 2018
5
copyright : (C) 2018 by Matthias Kuhn
6
email : matthias@opengis.ch
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSREADWRITELOCKER_H
19
#define QGSREADWRITELOCKER_H
20
21
#include "qgis_core.h"
22
23
#include <QReadWriteLock>
24
40
class
CORE_EXPORT
QgsReadWriteLocker
41
{
42
public
:
46
enum
Mode
47
{
48
Read
,
49
Write
,
50
Unlocked
51
};
52
56
QgsReadWriteLocker
( QReadWriteLock &lock, Mode mode );
57
62
void
changeMode( Mode mode );
63
68
void
unlock();
69
70
~QgsReadWriteLocker
();
71
72
private
:
73
#ifdef SIP_RUN
74
QgsReadWriteLocker
&operator=(
const
QgsReadWriteLocker
& );
75
#endif
76
77
QReadWriteLock &mLock;
78
Mode mMode = Unlocked;
79
};
80
81
#endif
// QGSREADWRITELOCKER_H
QgsReadWriteLocker
A convenience class that simplifies locking and unlocking QReadWriteLocks.
Definition
qgsreadwritelocker.h:41
QgsReadWriteLocker::Mode
Mode
A QReadWriteLock can be in 3 different modes, read, write or unlocked.
Definition
qgsreadwritelocker.h:47
QgsReadWriteLocker::Unlocked
@ Unlocked
Unlocked.
Definition
qgsreadwritelocker.h:50
QgsReadWriteLocker::Write
@ Write
Lock for write.
Definition
qgsreadwritelocker.h:49
QgsReadWriteLocker::Read
@ Read
Lock for read.
Definition
qgsreadwritelocker.h:48
QgsReadWriteLocker::QgsReadWriteLocker
QgsReadWriteLocker(QReadWriteLock &lock, Mode mode)
Create a new QgsReadWriteLocker for lock and initialize in mode.
Definition
qgsreadwritelocker.cpp:20
Generated on
for QGIS API Documentation by
1.17.0