-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_flags_8h_source.html
88 lines (88 loc) · 39.7 KB
/
_flags_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Gamedev Framework (gf): Flags.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="gf_logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Gamedev Framework (gf)
 <span id="projectnumber">0.14.0</span>
</div>
<div id="projectbrief">A C++14 framework for 2D games</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_6d069d519ae9d12fa11dd8e685586b60.html">gf</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Flags.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Gamedev Framework (gf)</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Copyright (C) 2016-2019 Julien Bernard</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * This software is provided 'as-is', without any express or implied</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * warranty. In no event will the authors be held liable for any damages</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * arising from the use of this software.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * Permission is granted to anyone to use this software for any purpose,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * including commercial applications, and to alter it and redistribute it</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * freely, subject to the following restrictions:</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * 1. The origin of this software must not be misrepresented; you must not</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * claim that you wrote the original software. If you use this software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * in a product, an acknowledgment in the product documentation would be</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * appreciated but is not required.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * 2. Altered source versions must be plainly marked as such, and must not be</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * misrepresented as being the original software.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * 3. This notice may not be removed or altered from any source distribution.</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> */</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#ifndef GF_FLAGS_H</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#define GF_FLAGS_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <type_traits></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "Types.h"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">namespace </span><a class="code" href="namespacegf.html">gf</a> {</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#ifndef DOXYGEN_SHOULD_SKIP_THIS</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">inline</span> <span class="keyword">namespace </span>v1 {</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html"> 46</a></span>  <span class="keyword">class </span><a class="code" href="classgf_1_1_flags.html">Flags</a> {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <a class="code" href="classgf_1_1_flags.html">Flags</a>() = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a15eadb1ca64e2d0b86663b5bb1bd11e3"> 56</a></span>  constexpr <a class="code" href="classgf_1_1_flags.html#a15eadb1ca64e2d0b86663b5bb1bd11e3">Flags</a>(<a class="code" href="structgf_1_1_none_type.html">NoneType</a>)</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  : m_data(0)</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  {</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  }</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#aeb4a6661c9a5800d6b8a0ee0c7d8a25a"> 65</a></span>  constexpr <a class="code" href="classgf_1_1_flags.html#aeb4a6661c9a5800d6b8a0ee0c7d8a25a">Flags</a>(<a class="code" href="structgf_1_1_all_type.html">AllType</a>)</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  : m_data(static_cast<<a class="code" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">Type</a>>(~0))</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  {</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  }</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a0b9c091b5cc8f4d1d534bfcb918b63ab"> 76</a></span>  constexpr <a class="code" href="classgf_1_1_flags.html#a0b9c091b5cc8f4d1d534bfcb918b63ab">Flags</a>(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> e)</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  : m_data(static_cast<<a class="code" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">Type</a>>(e))</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  {</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  }</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a68a5382c456d4591d260ebb96c68f8b3"> 87</a></span>  constexpr <a class="code" href="classgf_1_1_flags.html">Flags<E></a> <a class="code" href="classgf_1_1_flags.html#a68a5382c456d4591d260ebb96c68f8b3">operator~</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">Flags</a>(~m_data);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  }</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a9c270212f03b03d3c7e358caad1ddfe5"> 97</a></span>  constexpr <a class="code" href="classgf_1_1_flags.html">Flags</a> <a class="code" href="classgf_1_1_flags.html#a9c270212f03b03d3c7e358caad1ddfe5">operator|</a>(<a class="code" href="classgf_1_1_flags.html">Flags</a> flags)<span class="keyword"> const </span>{</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">Flags</a>(m_data | flags.m_data);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  }</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> </div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a9dbcca8fa649ea76c8a461a2bd243c89"> 107</a></span>  <a class="code" href="classgf_1_1_flags.html">Flags<E></a>& <a class="code" href="classgf_1_1_flags.html#a9dbcca8fa649ea76c8a461a2bd243c89">operator|=</a>(<a class="code" href="classgf_1_1_flags.html">Flags<E></a> flags) {</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  m_data |= flags.m_data;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div><div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#aa140280497e96f5372716c8232d81cd1"> 118</a></span>  constexpr <a class="code" href="classgf_1_1_flags.html">Flags</a> <a class="code" href="classgf_1_1_flags.html#aa140280497e96f5372716c8232d81cd1">operator&</a>(<a class="code" href="classgf_1_1_flags.html">Flags</a> flags)<span class="keyword"> const </span>{</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">Flags</a>(m_data & flags.m_data);</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  }</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#ad1555d20e0d8c89cd990a7e5a6e97938"> 128</a></span>  <a class="code" href="classgf_1_1_flags.html">Flags<E></a>& <a class="code" href="classgf_1_1_flags.html#ad1555d20e0d8c89cd990a7e5a6e97938">operator&=</a>(<a class="code" href="classgf_1_1_flags.html">Flags<E></a> flags) {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  m_data &= flags.m_data;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  }</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> </div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a2cfcdb3b582a0ab20ed132e432fe607b"> 138</a></span>  constexpr <span class="keyword">operator</span> bool()<span class="keyword"> const </span>{</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keywordflow">return</span> m_data != 0;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  }</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> </div><div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#aebb262f6354eaa3af73ea36ce82dcc3b"> 148</a></span>  constexpr <span class="keywordtype">bool</span> <a class="code" href="classgf_1_1_flags.html#aebb262f6354eaa3af73ea36ce82dcc3b">test</a>(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> flag)<span class="keyword"> const </span>{</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordflow">return</span> (m_data & static_cast<Type>(flag)) != 0;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  }</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a7add558107e334c0cfe71893fced16f1"> 157</a></span>  <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> flag) {</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  m_data |= <span class="keyword">static_cast<</span><a class="code" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">Type</a><span class="keyword">></span>(flag);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  }</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span> </div><div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#adde5305aaee77d68eb4f491ef8c10f6d"> 166</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgf_1_1_flags.html#adde5305aaee77d68eb4f491ef8c10f6d">reset</a>(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> flag) {</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  m_data &= ~static_cast<<a class="code" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">Type</a>>(flag);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  }</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> </div><div class="line"><a name="l00173"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e"> 173</a></span>  <span class="keyword">using</span> <a class="code" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">Type</a> = <span class="keyword">typename</span> std::underlying_type<E>::type;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> </div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a6166a51066228d991f34b27e933704cf"> 182</a></span>  <a class="code" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">Type</a> <a class="code" href="classgf_1_1_flags.html#a6166a51066228d991f34b27e933704cf">getValue</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">return</span> m_data;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  constexpr <a class="code" href="classgf_1_1_flags.html">Flags</a>(<a class="code" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">Type</a> data)</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  : m_data(data)</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  {</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span> </div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  }</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span> </div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">Type</a> m_data;</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  };</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span> </div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  constexpr</div><div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a578fc40bf2bc5f6e2f2a73346b01636b"> 206</a></span>  <a class="code" href="classgf_1_1_flags.html">Flags<E></a> <a class="code" href="classgf_1_1_flags.html#a578fc40bf2bc5f6e2f2a73346b01636b">operator|</a>(<a class="code" href="classgf_1_1_flags.html">Flags<E></a> lhs, <a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> rhs) {</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">return</span> lhs | <a class="code" href="classgf_1_1_flags.html">Flags<E></a>(rhs);</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  }</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span> </div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  constexpr</div><div class="line"><a name="l00220"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a7ff4184dad4d3e3b8061e4d0a8361936"> 220</a></span>  <a class="code" href="classgf_1_1_flags.html">Flags<E></a> <a class="code" href="classgf_1_1_flags.html#a7ff4184dad4d3e3b8061e4d0a8361936">operator|</a>(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> lhs, <a class="code" href="classgf_1_1_flags.html">Flags<E></a> rhs) {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">Flags<E></a>(lhs) | rhs;</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  }</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span> </div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  constexpr</div><div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a2864923cdbb543cf11d1b109547d78f7"> 234</a></span>  <a class="code" href="classgf_1_1_flags.html">Flags<E></a> operator&(<a class="code" href="classgf_1_1_flags.html">Flags<E></a> lhs, <a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> rhs) {</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordflow">return</span> lhs & <a class="code" href="classgf_1_1_flags.html">Flags<E></a>(rhs);</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  }</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> </div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  constexpr</div><div class="line"><a name="l00248"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a02435f34f5e6a9738654e7c6b643b691"> 248</a></span>  <a class="code" href="classgf_1_1_flags.html">Flags<E></a> operator&(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> lhs, <a class="code" href="classgf_1_1_flags.html">Flags<E></a> rhs) {</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">Flags<E></a>(lhs) & rhs;</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  }</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span> </div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span> </div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00261"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#aeee3d1b4959f81d8b8518389db7acc96"> 261</a></span>  constexpr <a class="code" href="classgf_1_1_flags.html">Flags<E></a> <a class="code" href="classgf_1_1_flags.html#aeee3d1b4959f81d8b8518389db7acc96">combineFlags</a>(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> flag) {</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">Flags<E></a>(flag);</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  }</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span> </div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keyword">template</span><<span class="keyword">typename</span> <a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a>, <span class="keyword">typename</span> ... <a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a800618943025315f869e4e1f09471012">F</a>></div><div class="line"><a name="l00274"></a><span class="lineno"><a class="line" href="classgf_1_1_flags.html#a01f1db7a1a2b0963fd84327a2c5292eb"> 274</a></span>  constexpr <a class="code" href="classgf_1_1_flags.html">Flags<E></a> <a class="code" href="classgf_1_1_flags.html#a01f1db7a1a2b0963fd84327a2c5292eb">combineFlags</a>(E flag, <a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a800618943025315f869e4e1f09471012">F</a> ... others) {</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">Flags<E></a>(flag) | combineFlags(others ...);</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  }</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span> </div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span> <span class="preprocessor">#ifndef DOXYGEN_SHOULD_SKIP_THIS</span></div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span> }</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span> </div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span> </div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span> <span class="comment">// this traits is not versioned</span></div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> </div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span> <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span> <span class="keyword">struct </span>EnableBitmaskOperators {</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="keyword">static</span> constexpr <span class="keywordtype">bool</span> value = <span class="keyword">false</span>;</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span> };</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span> </div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span> <span class="comment">// these overloads are only available to gf enum types and gf flags</span></div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span> <span class="comment">// unless you add: "using gf::operator|;"</span></div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span> </div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span> <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span> constexpr</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span> <span class="keyword">typename</span> std::enable_if<EnableBitmaskOperators<E>::value, <a class="code" href="classgf_1_1_flags.html">gf::Flags<E></a>>::type</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span> operator|(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> lhs, <a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> rhs) {</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">gf::Flags<E></a>(lhs) | <a class="code" href="classgf_1_1_flags.html">gf::Flags<E></a>(rhs);</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> }</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span> </div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span> <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span> constexpr</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span> <span class="keyword">typename</span> std::enable_if<EnableBitmaskOperators<E>::value, <a class="code" href="classgf_1_1_flags.html">gf::Flags<E></a>>::type</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span> operator&(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> lhs, <a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> rhs) {</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <span class="keywordflow">return</span> <a class="code" href="classgf_1_1_flags.html">gf::Flags<E></a>(lhs) & <a class="code" href="classgf_1_1_flags.html">gf::Flags<E></a>(rhs);</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span> }</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span> </div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span> <span class="keyword">template</span><<span class="keyword">typename</span> E></div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span> constexpr</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span> <span class="keyword">typename</span> std::enable_if<EnableBitmaskOperators<E>::value, <a class="code" href="classgf_1_1_flags.html">gf::Flags<E></a>>::type</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span> operator~(<a class="code" href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">E</a> val) {</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordflow">return</span> ~<a class="code" href="namespacegf.html">gf</a><a class="code" href="classgf_1_1_flags.html">::Flags<E></a>(val);</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span> }</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span> </div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span> }</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span> </div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span> <span class="preprocessor">#endif // GF_FLAGS_H</span></div><div class="ttc" id="classgf_1_1_flags_html_a264a89d5e519c458d6be4e887f3d903e"><div class="ttname"><a href="classgf_1_1_flags.html#a264a89d5e519c458d6be4e887f3d903e">gf::Flags< Flip >::Type</a></div><div class="ttdeci">typename std::underlying_type< Flip >::type Type</div><div class="ttdoc">The underlying type of the enum. </div><div class="ttdef"><b>Definition:</b> Flags.h:173</div></div>
<div class="ttc" id="group__window_html_gga795d7d5e2f2a4f38b16b95e0e78cb626a800618943025315f869e4e1f09471012"><div class="ttname"><a href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a800618943025315f869e4e1f09471012">gf::Scancode::F</a></div></div>
<div class="ttc" id="structgf_1_1_none_type_html"><div class="ttname"><a href="structgf_1_1_none_type.html">gf::NoneType</a></div><div class="ttdoc">Semantic type to represent "none". </div><div class="ttdef"><b>Definition:</b> Types.h:37</div></div>
<div class="ttc" id="classgf_1_1_flags_html"><div class="ttname"><a href="classgf_1_1_flags.html">gf::Flags</a></div><div class="ttdoc">Bitfield relying on an enumeration. </div><div class="ttdef"><b>Definition:</b> Flags.h:46</div></div>
<div class="ttc" id="classgf_1_1_flags_html_ad1555d20e0d8c89cd990a7e5a6e97938"><div class="ttname"><a href="classgf_1_1_flags.html#ad1555d20e0d8c89cd990a7e5a6e97938">gf::Flags::operator &=</a></div><div class="ttdeci">Flags< E > & operator &=(Flags< E > flags)</div><div class="ttdoc">Binary AND and assignment. </div><div class="ttdef"><b>Definition:</b> Flags.h:128</div></div>
<div class="ttc" id="classgf_1_1_flags_html_a01f1db7a1a2b0963fd84327a2c5292eb"><div class="ttname"><a href="classgf_1_1_flags.html#a01f1db7a1a2b0963fd84327a2c5292eb">gf::Flags::combineFlags</a></div><div class="ttdeci">constexpr Flags< E > combineFlags(E flag, F ... others)</div><div class="ttdoc">Combine several enum values into a flag value. </div><div class="ttdef"><b>Definition:</b> Flags.h:274</div></div>
<div class="ttc" id="classgf_1_1_flags_html_adde5305aaee77d68eb4f491ef8c10f6d"><div class="ttname"><a href="classgf_1_1_flags.html#adde5305aaee77d68eb4f491ef8c10f6d">gf::Flags::reset</a></div><div class="ttdeci">void reset(E flag)</div><div class="ttdoc">Reset a flag. </div><div class="ttdef"><b>Definition:</b> Flags.h:166</div></div>
<div class="ttc" id="classgf_1_1_flags_html_a15eadb1ca64e2d0b86663b5bb1bd11e3"><div class="ttname"><a href="classgf_1_1_flags.html#a15eadb1ca64e2d0b86663b5bb1bd11e3">gf::Flags::Flags</a></div><div class="ttdeci">constexpr Flags(NoneType)</div><div class="ttdoc">Constructor with no flag set. </div><div class="ttdef"><b>Definition:</b> Flags.h:56</div></div>
<div class="ttc" id="structgf_1_1_all_type_html"><div class="ttname"><a href="structgf_1_1_all_type.html">gf::AllType</a></div><div class="ttdoc">Semantic type to represent "all". </div><div class="ttdef"><b>Definition:</b> Types.h:53</div></div>
<div class="ttc" id="classgf_1_1_flags_html_aa140280497e96f5372716c8232d81cd1"><div class="ttname"><a href="classgf_1_1_flags.html#aa140280497e96f5372716c8232d81cd1">gf::Flags::operator &</a></div><div class="ttdeci">constexpr Flags operator &(Flags flags) const</div><div class="ttdoc">Binary AND between two bitfields. </div><div class="ttdef"><b>Definition:</b> Flags.h:118</div></div>
<div class="ttc" id="classgf_1_1_flags_html_aeb4a6661c9a5800d6b8a0ee0c7d8a25a"><div class="ttname"><a href="classgf_1_1_flags.html#aeb4a6661c9a5800d6b8a0ee0c7d8a25a">gf::Flags::Flags</a></div><div class="ttdeci">constexpr Flags(AllType)</div><div class="ttdoc">Constructor with all flags set. </div><div class="ttdef"><b>Definition:</b> Flags.h:65</div></div>
<div class="ttc" id="classgf_1_1_flags_html_a68a5382c456d4591d260ebb96c68f8b3"><div class="ttname"><a href="classgf_1_1_flags.html#a68a5382c456d4591d260ebb96c68f8b3">gf::Flags::operator~</a></div><div class="ttdeci">constexpr Flags< E > operator~() const</div><div class="ttdoc">Binary NOT operator. </div><div class="ttdef"><b>Definition:</b> Flags.h:87</div></div>
<div class="ttc" id="classgf_1_1_flags_html_a0b9c091b5cc8f4d1d534bfcb918b63ab"><div class="ttname"><a href="classgf_1_1_flags.html#a0b9c091b5cc8f4d1d534bfcb918b63ab">gf::Flags::Flags</a></div><div class="ttdeci">constexpr Flags(E e)</div><div class="ttdoc">Constructor with an enum value. </div><div class="ttdef"><b>Definition:</b> Flags.h:76</div></div>
<div class="ttc" id="classgf_1_1_flags_html_aebb262f6354eaa3af73ea36ce82dcc3b"><div class="ttname"><a href="classgf_1_1_flags.html#aebb262f6354eaa3af73ea36ce82dcc3b">gf::Flags::test</a></div><div class="ttdeci">constexpr bool test(E flag) const</div><div class="ttdoc">Test if a specified flag is set. </div><div class="ttdef"><b>Definition:</b> Flags.h:148</div></div>
<div class="ttc" id="group__window_html_gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da"><div class="ttname"><a href="group__window.html#gga795d7d5e2f2a4f38b16b95e0e78cb626a3a3ea00cfc35332cedf6e5e9a32e94da">gf::Scancode::E</a></div></div>
<div class="ttc" id="classgf_1_1_flags_html_a6166a51066228d991f34b27e933704cf"><div class="ttname"><a href="classgf_1_1_flags.html#a6166a51066228d991f34b27e933704cf">gf::Flags::getValue</a></div><div class="ttdeci">Type getValue() const</div><div class="ttdoc">Get the underlying value of the flags. </div><div class="ttdef"><b>Definition:</b> Flags.h:182</div></div>
<div class="ttc" id="namespacegf_html"><div class="ttname"><a href="namespacegf.html">gf</a></div><div class="ttdoc">The namespace for gf classes. </div><div class="ttdef"><b>Definition:</b> Action.h:35</div></div>
<div class="ttc" id="classgf_1_1_flags_html_a9dbcca8fa649ea76c8a461a2bd243c89"><div class="ttname"><a href="classgf_1_1_flags.html#a9dbcca8fa649ea76c8a461a2bd243c89">gf::Flags::operator|=</a></div><div class="ttdeci">Flags< E > & operator|=(Flags< E > flags)</div><div class="ttdoc">Binary OR and assignment. </div><div class="ttdef"><b>Definition:</b> Flags.h:107</div></div>
<div class="ttc" id="classgf_1_1_flags_html_a9c270212f03b03d3c7e358caad1ddfe5"><div class="ttname"><a href="classgf_1_1_flags.html#a9c270212f03b03d3c7e358caad1ddfe5">gf::Flags::operator|</a></div><div class="ttdeci">constexpr Flags operator|(Flags flags) const</div><div class="ttdoc">Binary OR between two bitfields. </div><div class="ttdef"><b>Definition:</b> Flags.h:97</div></div>
<div class="ttc" id="classgf_1_1_flags_html_a578fc40bf2bc5f6e2f2a73346b01636b"><div class="ttname"><a href="classgf_1_1_flags.html#a578fc40bf2bc5f6e2f2a73346b01636b">gf::Flags::operator|</a></div><div class="ttdeci">constexpr Flags< E > operator|(Flags< E > lhs, E rhs)</div><div class="ttdoc">Binary OR between a bitfield and a flag. </div><div class="ttdef"><b>Definition:</b> Flags.h:206</div></div>
<div class="ttc" id="classgf_1_1_flags_html_a7ff4184dad4d3e3b8061e4d0a8361936"><div class="ttname"><a href="classgf_1_1_flags.html#a7ff4184dad4d3e3b8061e4d0a8361936">gf::Flags::operator|</a></div><div class="ttdeci">constexpr Flags< E > operator|(E lhs, Flags< E > rhs)</div><div class="ttdoc">Binary OR between a flag and a bitfield. </div><div class="ttdef"><b>Definition:</b> Flags.h:220</div></div>
<div class="ttc" id="classgf_1_1_flags_html_aeee3d1b4959f81d8b8518389db7acc96"><div class="ttname"><a href="classgf_1_1_flags.html#aeee3d1b4959f81d8b8518389db7acc96">gf::Flags::combineFlags</a></div><div class="ttdeci">constexpr Flags< E > combineFlags(E flag)</div><div class="ttdoc">Combine a single enum value into a flag value. </div><div class="ttdef"><b>Definition:</b> Flags.h:261</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>