QGIS API Documentation
3.10.0-A Coruña (6c816b4204)
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
+
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
+
Related Functions
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
u
v
w
z
+
Variables
a
b
c
d
e
g
h
i
l
n
o
p
q
r
s
t
u
w
+
Typedefs
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
+
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
core
qgsreadwritelocker.cpp
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
#include "
qgsreadwritelocker.h
"
19
20
QgsReadWriteLocker::QgsReadWriteLocker
( QReadWriteLock &lock,
QgsReadWriteLocker::Mode
mode )
21
: mLock( lock )
22
, mMode( mode )
23
{
24
if
( mode ==
Read
)
25
mLock.lockForRead();
26
else
if
( mode ==
Write
)
27
mLock.lockForWrite();
28
}
29
30
void
QgsReadWriteLocker::changeMode
(
QgsReadWriteLocker::Mode
mode )
31
{
32
if
( mode == mMode )
33
return
;
34
35
unlock
();
36
37
mMode = mode;
38
39
if
( mMode ==
Read
)
40
mLock.lockForRead();
41
else
if
( mMode ==
Write
)
42
mLock.lockForWrite();
43
}
44
45
void
QgsReadWriteLocker::unlock
()
46
{
47
if
( mMode !=
Unlocked
)
48
mLock.unlock();
49
50
mMode =
Unlocked
;
51
}
52
53
QgsReadWriteLocker::~QgsReadWriteLocker
()
54
{
55
unlock
();
56
}
qgsreadwritelocker.h
QgsReadWriteLocker::Unlocked
Unlocked.
Definition:
qgsreadwritelocker.h:51
QgsReadWriteLocker::Mode
Mode
A QReadWriteLock can be in 3 different modes, read, write or unlocked.
Definition:
qgsreadwritelocker.h:47
QgsReadWriteLocker::QgsReadWriteLocker
QgsReadWriteLocker(QReadWriteLock &lock, Mode mode)
Create a new QgsReadWriteLocker for lock and initialize in mode.
Definition:
qgsreadwritelocker.cpp:20
QgsReadWriteLocker::Read
Lock for read.
Definition:
qgsreadwritelocker.h:49
QgsReadWriteLocker::~QgsReadWriteLocker
~QgsReadWriteLocker()
Definition:
qgsreadwritelocker.cpp:53
QgsReadWriteLocker::Write
Lock for write.
Definition:
qgsreadwritelocker.h:50
QgsReadWriteLocker::unlock
void unlock()
Unlocks the lock.
Definition:
qgsreadwritelocker.cpp:45
QgsReadWriteLocker::changeMode
void changeMode(Mode mode)
Change the mode of the lock to mode.
Definition:
qgsreadwritelocker.cpp:30
Generated on Sun Oct 27 2019 00:43:28 for QGIS API Documentation by
1.8.13