QGIS API Documentation
3.14.0-Pi (9f7028fd23)
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
t
u
v
w
z
Variables
a
b
c
d
e
f
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
qgsoptional.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsoptional.h - QgsOptional
3
4
---------------------
5
begin : 7.9.2016
6
copyright : (C) 2016 by Matthias Kuhn
7
email : matthias@opengis.ch
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
#ifndef QGSOPTIONAL_H
17
#define QGSOPTIONAL_H
18
19
#include "qgis_core.h"
20
21
35
template
<
typename
T>
36
class
CORE_EXPORT
QgsOptional
37
{
38
public
:
39
43
QgsOptional
() =
default
;
44
48
QgsOptional
(
const
T &data )
49
: mEnabled(
true
)
50
, mData( data )
51
{
52
}
53
57
QgsOptional
(
const
T &data,
bool
enabled )
58
: mEnabled( enabled )
59
, mData( data )
60
{
61
}
62
71
bool
operator==
(
const
QgsOptional<T>
&other )
const
72
{
73
return
mEnabled == other.mEnabled && mData == other.mData;
74
}
75
79
operator
bool()
const
80
{
81
return
mEnabled;
82
}
83
89
bool
enabled()
const
90
{
91
return
mEnabled;
92
}
93
99
void
setEnabled(
bool
enabled )
100
{
101
mEnabled = enabled;
102
}
103
109
const
T *operator->()
const
110
{
111
return
&mData;
112
}
113
119
T data()
const
120
{
121
return
mData;
122
}
123
129
void
setData(
const
T &data )
130
{
131
mData = data;
132
}
133
134
private
:
135
bool
mEnabled =
false
;
136
T mData;
137
};
138
139
#endif // QGSOPTIONAL_H
QgsOptional
QgsOptional is a container for other classes and adds an additional enabled/disabled flag.
Definition:
qgsoptional.h:36
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition:
qgsfeatureiterator.h:399
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17