GpgFrontend-Doxygen/docs/html/GpgFunctionObject_8h_source.html

259 lines
40 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GpgFrontend Project: src/core/GpgFunctionObject.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>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GpgFrontend Project
</div>
<div id="projectbrief">A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('GpgFunctionObject_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">GpgFunctionObject.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#ifndef GPGFRONTEND_ZH_CN_TS_FUNCTIONOBJECT_H</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#define GPGFRONTEND_ZH_CN_TS_FUNCTIONOBJECT_H</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;GpgConstants.h&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceGpgFrontend.html">GpgFrontend</a> {</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1ChannelObject.html"> 40</a></span>&#160;<span class="keyword">class </span>GPGFRONTEND_CORE_EXPORT <a class="code" href="classGpgFrontend_1_1ChannelObject.html">ChannelObject</a> {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1ChannelObject.html#aedbf32eddc701e521bd8e790ef208da0"> 46</a></span>&#160; <a class="code" href="classGpgFrontend_1_1ChannelObject.html#aedbf32eddc701e521bd8e790ef208da0">ChannelObject</a>() noexcept;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <a class="code" href="classGpgFrontend_1_1ChannelObject.html">ChannelObject</a>(<span class="keywordtype">int</span> channel);</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; static <span class="keywordtype">int</span> GetDefaultChannel();</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; [[nodiscard]] <span class="keywordtype">int</span> GetChannel() const;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordtype">void</span> SetChannel(<span class="keywordtype">int</span> channel);</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; private:</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1ChannelObject.html#aee5f8a5575adbdf522da4dd195c091ee"> 77</a></span>&#160; <span class="keywordtype">int</span> channel_ = _default_channel; </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1ChannelObject.html#a66295bb572e98fc2fad3afce763ac311"> 78</a></span>&#160; static constexpr <span class="keywordtype">int</span> _default_channel = 0; </div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;};</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonStorage.html"> 81</a></span>&#160;<a class="code" href="classclass.html">class</a> GPGFRONTEND_CORE_EXPORT <a class="code" href="classGpgFrontend_1_1SingletonStorage.html">SingletonStorage</a> {</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordtype">void</span> ReleaseChannel(<span class="keywordtype">int</span> channel);</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <a class="code" href="classGpgFrontend_1_1ChannelObject.html">ChannelObject</a>* FindObjectInChannel(<span class="keywordtype">int</span> channel);</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; std::vector&lt;int&gt; GetAllChannelId();</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <a class="code" href="classGpgFrontend_1_1ChannelObject.html">ChannelObject</a>* SetObjectInChannel(<span class="keywordtype">int</span> channel,</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; std::unique_ptr&lt;ChannelObject&gt; p_obj);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonStorage.html#a15161d0afafec602018a89266dab5641"> 116</a></span>&#160; std::shared_mutex <a class="code" href="classGpgFrontend_1_1SingletonStorage.html#a15161d0afafec602018a89266dab5641">instances_mutex_</a>; </div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; std::map&lt;int, std::unique_ptr&lt;ChannelObject&gt;&gt;</div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonStorage.html#a6181f2b5af39c6b86de89e1ba9eeff1c"> 118</a></span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonStorage.html#a6181f2b5af39c6b86de89e1ba9eeff1c">instances_map_</a>; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;};</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonStorageCollection.html"> 121</a></span>&#160;<span class="keyword">class </span>GPGFRONTEND_CORE_EXPORT <a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html">SingletonStorageCollection</a> {</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keyword">static</span> <a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html">SingletonStorageCollection</a>* GetInstance(<span class="keywordtype">bool</span> force_refresh);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonStorage.html">SingletonStorage</a>* GetSingletonStorage(<span class="keyword">const</span> std::type_info&amp;);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; </div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonStorageCollection.html#ab648cb257beb2475eb5fca6453c331f9"> 139</a></span>&#160; std::shared_mutex <a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#ab648cb257beb2475eb5fca6453c331f9">storages_mutex_</a>; </div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; std::map&lt;size_t, std::unique_ptr&lt;SingletonStorage&gt;&gt; storages_map_;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;};</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html"> 148</a></span>&#160;<span class="keyword">class </span><a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html">SingletonFunctionObject</a> : <span class="keyword">public</span> <a class="code" href="classGpgFrontend_1_1ChannelObject.html">ChannelObject</a> {</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a194e49b07d46345bdad386505d743a61"> 154</a></span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a194e49b07d46345bdad386505d743a61">SingletonFunctionObject</a>(<span class="keyword">const</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html">SingletonFunctionObject&lt;T&gt;</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#aabb190a60f7a5d4ded43cae16ab8f59e"> 161</a></span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html">SingletonFunctionObject</a>&amp; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#aabb190a60f7a5d4ded43cae16ab8f59e">operator=</a>(<span class="keyword">const</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html">SingletonFunctionObject&lt;T&gt;</a>&amp;) =</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a70484d7cfe9f9dcbcd5f8bb749250f36"> 170</a></span>&#160; <span class="keyword">static</span> T&amp; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a70484d7cfe9f9dcbcd5f8bb749250f36">GetInstance</a>(</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordtype">int</span> channel = GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL) {</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; static_assert(std::is_base_of&lt;<a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html">SingletonFunctionObject&lt;T&gt;</a>, T&gt;::value,</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="stringliteral">&quot;T not derived from SingletonFunctionObject&lt;T&gt;&quot;</span>);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keyword">auto</span> p_storage =</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#ac56d19e0d4b99e7b8a86a017721f3db1">SingletonStorageCollection::GetInstance</a>(<span class="keyword">false</span>)-&gt;<a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#a6f933390c54b7f55d5ffb4624074725f">GetSingletonStorage</a>(</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keyword">typeid</span>(T));</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keyword">auto</span>* _p_pbj = (T*)(p_storage-&gt;FindObjectInChannel(channel));</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; </div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordflow">if</span> (_p_pbj == <span class="keyword">nullptr</span>) {</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keyword">auto</span> new_obj = std::unique_ptr&lt;ChannelObject&gt;(<span class="keyword">new</span> T(channel));</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">return</span> *(T*)(p_storage-&gt;SetObjectInChannel(channel, std::move(new_obj)));</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">return</span> *_p_pbj;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; }</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; }</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; </div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a083807ff8cec58dc0aa732844edaf518"> 196</a></span>&#160; <span class="keyword">static</span> T&amp; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a083807ff8cec58dc0aa732844edaf518">CreateInstance</a>(</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordtype">int</span> channel,</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; std::function&lt;std::unique_ptr&lt;ChannelObject&gt;(<span class="keywordtype">void</span>)&gt; factory) {</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; static_assert(std::is_base_of&lt;<a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html">SingletonFunctionObject&lt;T&gt;</a>, T&gt;::value,</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="stringliteral">&quot;T not derived from SingletonFunctionObject&lt;T&gt;&quot;</span>);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keyword">auto</span> p_storage =</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#ac56d19e0d4b99e7b8a86a017721f3db1">SingletonStorageCollection::GetInstance</a>(<span class="keyword">false</span>)-&gt;<a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#a6f933390c54b7f55d5ffb4624074725f">GetSingletonStorage</a>(</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keyword">typeid</span>(T));</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keyword">auto</span> _p_pbj = (T*)(p_storage-&gt;FindObjectInChannel(channel));</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; </div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keywordflow">if</span> (_p_pbj == <span class="keyword">nullptr</span>) {</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordflow">return</span> *(</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; T*)(p_storage-&gt;SetObjectInChannel(channel, std::move(factory())));</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keywordflow">return</span> *_p_pbj;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; }</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; </div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#ab49b1d50252e1934691a9483a6df2106"> 221</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#ab49b1d50252e1934691a9483a6df2106">ReleaseChannel</a>(<span class="keywordtype">int</span> channel) {</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#ac56d19e0d4b99e7b8a86a017721f3db1">SingletonStorageCollection::GetInstance</a>(<span class="keyword">false</span>)</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; -&gt;<a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#a6f933390c54b7f55d5ffb4624074725f">GetSingletonStorage</a>(<span class="keyword">typeid</span>(T))</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; -&gt;<a class="code" href="classGpgFrontend_1_1SingletonStorage.html#adb22cc80a1ab040b6e4bce962625edfd">ReleaseChannel</a>(channel);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; }</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a50e2b3794d6553f4231eaec72d9d0a50"> 232</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a50e2b3794d6553f4231eaec72d9d0a50">GetDefaultChannel</a>() { <span class="keywordflow">return</span> <a class="code" href="classGpgFrontend_1_1ChannelObject.html#aece9c525c49900734bc1bebf85b644ef">ChannelObject::GetDefaultChannel</a>(); }</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; </div>
<div class="line"><a name="l00239"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#aa99440b9177f5d0c18840f08a40d64b7"> 239</a></span>&#160; [[nodiscard]] <span class="keywordtype">int</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#aa99440b9177f5d0c18840f08a40d64b7">GetChannel</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classGpgFrontend_1_1ChannelObject.html#a0e13a4bff1cfb679f68a3a2590a3b1b8">ChannelObject::GetChannel</a>(); }</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a5f2f0474871971f86ff91fb6a2408621"> 246</a></span>&#160; <span class="keyword">static</span> std::vector&lt;int&gt; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a5f2f0474871971f86ff91fb6a2408621">GetAllChannelId</a>() {</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#ac56d19e0d4b99e7b8a86a017721f3db1">SingletonStorageCollection::GetInstance</a>(<span class="keyword">false</span>)</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; -&gt;<a class="code" href="classGpgFrontend_1_1SingletonStorageCollection.html#a6f933390c54b7f55d5ffb4624074725f">GetSingletonStorage</a>(<span class="keyword">typeid</span>(T))</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; -&gt;<a class="code" href="classGpgFrontend_1_1SingletonStorage.html#a3f09424ebdc097fbdab77564a7d723ea">GetAllChannelId</a>();</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; }</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; </div>
<div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#aabc5fe8e5a372ac276a265286457cb9a"> 256</a></span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#aabc5fe8e5a372ac276a265286457cb9a">SingletonFunctionObject</a>(T&amp;&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; </div>
<div class="line"><a name="l00262"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a7090636bed6f4bad5b99f28f6872c645"> 262</a></span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a7090636bed6f4bad5b99f28f6872c645">SingletonFunctionObject</a>(<span class="keyword">const</span> T&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; </div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> T&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00275"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a02e76b42ab51d77588b01c7508bed258"> 275</a></span>&#160; <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a02e76b42ab51d77588b01c7508bed258">SingletonFunctionObject</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; </div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a4aa7f1eb1d3281bb1fccfcbb1b416251"> 282</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a4aa7f1eb1d3281bb1fccfcbb1b416251">SingletonFunctionObject</a>(<span class="keywordtype">int</span> channel) : <a class="code" href="classGpgFrontend_1_1ChannelObject.html">ChannelObject</a>(channel) {}</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; </div>
<div class="line"><a name="l00288"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1SingletonFunctionObject.html#a8296be8c449f88175285186831b995bc"> 288</a></span>&#160; <span class="keyword">virtual</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#a8296be8c449f88175285186831b995bc">~SingletonFunctionObject</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;};</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;} <span class="comment">// namespace GpgFrontend</span></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; </div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// GPGFRONTEND_ZH_CN_TS_FUNCTIONOBJECT_H</span></div>
<div class="ttc" id="aclassGpgFrontend_1_1ChannelObject_html"><div class="ttname"><a href="classGpgFrontend_1_1ChannelObject.html">GpgFrontend::ChannelObject</a></div><div class="ttdoc">object which in channel system</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:40</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1ChannelObject_html_a0e13a4bff1cfb679f68a3a2590a3b1b8"><div class="ttname"><a href="classGpgFrontend_1_1ChannelObject.html#a0e13a4bff1cfb679f68a3a2590a3b1b8">GpgFrontend::ChannelObject::GetChannel</a></div><div class="ttdeci">int GetChannel() const</div><div class="ttdoc">Get the Channel object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.cpp:41</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1ChannelObject_html_aece9c525c49900734bc1bebf85b644ef"><div class="ttname"><a href="classGpgFrontend_1_1ChannelObject.html#aece9c525c49900734bc1bebf85b644ef">GpgFrontend::ChannelObject::GetDefaultChannel</a></div><div class="ttdeci">static int GetDefaultChannel()</div><div class="ttdoc">Get the Default Channel object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.cpp:43</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1ChannelObject_html_aedbf32eddc701e521bd8e790ef208da0"><div class="ttname"><a href="classGpgFrontend_1_1ChannelObject.html#aedbf32eddc701e521bd8e790ef208da0">GpgFrontend::ChannelObject::ChannelObject</a></div><div class="ttdeci">ChannelObject() noexcept</div><div class="ttdoc">Construct a new Default Channel Object object.</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html">GpgFrontend::SingletonFunctionObject</a></div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:148</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a02e76b42ab51d77588b01c7508bed258"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a02e76b42ab51d77588b01c7508bed258">GpgFrontend::SingletonFunctionObject::SingletonFunctionObject</a></div><div class="ttdeci">SingletonFunctionObject()=default</div><div class="ttdoc">Construct a new Singleton Function Object object.</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a083807ff8cec58dc0aa732844edaf518"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a083807ff8cec58dc0aa732844edaf518">GpgFrontend::SingletonFunctionObject::CreateInstance</a></div><div class="ttdeci">static T &amp; CreateInstance(int channel, std::function&lt; std::unique_ptr&lt; ChannelObject &gt;(void)&gt; factory)</div><div class="ttdoc">Create a Instance object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:196</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a194e49b07d46345bdad386505d743a61"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a194e49b07d46345bdad386505d743a61">GpgFrontend::SingletonFunctionObject::SingletonFunctionObject</a></div><div class="ttdeci">SingletonFunctionObject(const SingletonFunctionObject&lt; T &gt; &amp;)=delete</div><div class="ttdoc">prohibit copy</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a4aa7f1eb1d3281bb1fccfcbb1b416251"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a4aa7f1eb1d3281bb1fccfcbb1b416251">GpgFrontend::SingletonFunctionObject::SingletonFunctionObject</a></div><div class="ttdeci">SingletonFunctionObject(int channel)</div><div class="ttdoc">Construct a new Singleton Function Object object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:282</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a50e2b3794d6553f4231eaec72d9d0a50"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a50e2b3794d6553f4231eaec72d9d0a50">GpgFrontend::SingletonFunctionObject::GetDefaultChannel</a></div><div class="ttdeci">static int GetDefaultChannel()</div><div class="ttdoc">Get the Default Channel object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:232</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a5f2f0474871971f86ff91fb6a2408621"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a5f2f0474871971f86ff91fb6a2408621">GpgFrontend::SingletonFunctionObject::GetAllChannelId</a></div><div class="ttdeci">static std::vector&lt; int &gt; GetAllChannelId()</div><div class="ttdoc">Get all the channel ids.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:246</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a70484d7cfe9f9dcbcd5f8bb749250f36"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a70484d7cfe9f9dcbcd5f8bb749250f36">GpgFrontend::SingletonFunctionObject::GetInstance</a></div><div class="ttdeci">static T &amp; GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)</div><div class="ttdoc">Get the Instance object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:170</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a7090636bed6f4bad5b99f28f6872c645"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a7090636bed6f4bad5b99f28f6872c645">GpgFrontend::SingletonFunctionObject::SingletonFunctionObject</a></div><div class="ttdeci">SingletonFunctionObject(const T &amp;)=delete</div><div class="ttdoc">Construct a new Singleton Function Object object.</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_a8296be8c449f88175285186831b995bc"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#a8296be8c449f88175285186831b995bc">GpgFrontend::SingletonFunctionObject::~SingletonFunctionObject</a></div><div class="ttdeci">virtual ~SingletonFunctionObject()=default</div><div class="ttdoc">Destroy the Singleton Function Object object.</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_aa99440b9177f5d0c18840f08a40d64b7"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#aa99440b9177f5d0c18840f08a40d64b7">GpgFrontend::SingletonFunctionObject::GetChannel</a></div><div class="ttdeci">int GetChannel() const</div><div class="ttdoc">Get the Channel object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:239</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_aabb190a60f7a5d4ded43cae16ab8f59e"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#aabb190a60f7a5d4ded43cae16ab8f59e">GpgFrontend::SingletonFunctionObject::operator=</a></div><div class="ttdeci">SingletonFunctionObject &amp; operator=(const SingletonFunctionObject&lt; T &gt; &amp;)=delete</div><div class="ttdoc">prohibit copy</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_aabc5fe8e5a372ac276a265286457cb9a"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#aabc5fe8e5a372ac276a265286457cb9a">GpgFrontend::SingletonFunctionObject::SingletonFunctionObject</a></div><div class="ttdeci">SingletonFunctionObject(T &amp;&amp;)=delete</div><div class="ttdoc">Construct a new Singleton Function Object object.</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_ab49b1d50252e1934691a9483a6df2106"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#ab49b1d50252e1934691a9483a6df2106">GpgFrontend::SingletonFunctionObject::ReleaseChannel</a></div><div class="ttdeci">static void ReleaseChannel(int channel)</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:221</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorageCollection_html"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorageCollection.html">GpgFrontend::SingletonStorageCollection</a></div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:121</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorageCollection_html_a6f933390c54b7f55d5ffb4624074725f"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorageCollection.html#a6f933390c54b7f55d5ffb4624074725f">GpgFrontend::SingletonStorageCollection::GetSingletonStorage</a></div><div class="ttdeci">SingletonStorage * GetSingletonStorage(const std::type_info &amp;)</div><div class="ttdoc">Get the Singleton Storage object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.cpp:97</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorageCollection_html_ab648cb257beb2475eb5fca6453c331f9"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorageCollection.html#ab648cb257beb2475eb5fca6453c331f9">GpgFrontend::SingletonStorageCollection::storages_mutex_</a></div><div class="ttdeci">std::shared_mutex storages_mutex_</div><div class="ttdoc">mutex for storages_map_</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:139</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorageCollection_html_ac56d19e0d4b99e7b8a86a017721f3db1"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorageCollection.html#ac56d19e0d4b99e7b8a86a017721f3db1">GpgFrontend::SingletonStorageCollection::GetInstance</a></div><div class="ttdeci">static SingletonStorageCollection * GetInstance(bool force_refresh)</div><div class="ttdoc">Get the Instance object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.cpp:122</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorage_html"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorage.html">GpgFrontend::SingletonStorage</a></div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:81</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorage_html_a15161d0afafec602018a89266dab5641"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorage.html#a15161d0afafec602018a89266dab5641">GpgFrontend::SingletonStorage::instances_mutex_</a></div><div class="ttdeci">std::shared_mutex instances_mutex_</div><div class="ttdoc">mutex for _instances_map</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:116</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorage_html_a3f09424ebdc097fbdab77564a7d723ea"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorage.html#a3f09424ebdc097fbdab77564a7d723ea">GpgFrontend::SingletonStorage::GetAllChannelId</a></div><div class="ttdeci">std::vector&lt; int &gt; GetAllChannelId()</div><div class="ttdoc">Get all the channel ids.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.cpp:69</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorage_html_a6181f2b5af39c6b86de89e1ba9eeff1c"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorage.html#a6181f2b5af39c6b86de89e1ba9eeff1c">GpgFrontend::SingletonStorage::instances_map_</a></div><div class="ttdeci">std::map&lt; int, std::unique_ptr&lt; ChannelObject &gt; &gt; instances_map_</div><div class="ttdoc">map of singleton instances</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:118</div></div>
<div class="ttc" id="aclassGpgFrontend_1_1SingletonStorage_html_adb22cc80a1ab040b6e4bce962625edfd"><div class="ttname"><a href="classGpgFrontend_1_1SingletonStorage.html#adb22cc80a1ab040b6e4bce962625edfd">GpgFrontend::SingletonStorage::ReleaseChannel</a></div><div class="ttdeci">void ReleaseChannel(int channel)</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.cpp:45</div></div>
<div class="ttc" id="aclassclass_html"><div class="ttname"><a href="classclass.html">class</a></div><div class="ttdoc">Executive files related to the basic operations that are provided by GpgBasicOperator.</div></div>
<div class="ttc" id="anamespaceGpgFrontend_html"><div class="ttname"><a href="namespaceGpgFrontend.html">GpgFrontend</a></div><div class="ttdef"><b>Definition:</b> CoreCommonUtil.cpp:31</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.html">core</a></li><li class="navelem"><b>GpgFunctionObject.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>