253 lines
29 KiB
HTML
253 lines
29 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/module/ModuleManager.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&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&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&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('ModuleManager_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">ModuleManager.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>  </div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#pragma once</span></div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  </div>
|
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <mutex></span></div>
|
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <vector></span></div>
|
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  </div>
|
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "core/function/SecureMemoryAllocator.h"</span></div>
|
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include "core/function/basic/GpgFunctionObject.h"</span></div>
|
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include "core/module/Event.h"</span></div>
|
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#include "core/utils/MemoryUtils.h"</span></div>
|
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div>
|
|
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="namespaceGpgFrontend_1_1Thread.html"> 39</a></span> <span class="keyword">namespace </span><a class="code" href="namespaceGpgFrontend_1_1Thread.html">GpgFrontend::Thread</a> {</div>
|
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">class </span><a class="code" href="classGpgFrontend_1_1Thread_1_1TaskRunner.html">TaskRunner</a>;</div>
|
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> }</div>
|
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  </div>
|
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">namespace </span><a class="code" href="namespaceGpgFrontend_1_1Module.html">GpgFrontend::Module</a> {</div>
|
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
|
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">using</span> TaskRunnerPtr = std::shared_ptr<Thread::TaskRunner>;</div>
|
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  </div>
|
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">class </span>Event;</div>
|
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">class </span>Module;</div>
|
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keyword">class </span>GlobalModuleContext;</div>
|
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">class </span>ModuleManager;</div>
|
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">class </span>GlobalRegisterTable;</div>
|
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div>
|
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="keyword">using</span> EventReference = std::shared_ptr<Event>;</div>
|
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="keyword">using</span> ModuleIdentifier = QString;</div>
|
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">using</span> ModulePtr = std::shared_ptr<Module>;</div>
|
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">using</span> ModuleMangerPtr = std::shared_ptr<ModuleManager>;</div>
|
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">using</span> GMCPtr = std::shared_ptr<GlobalModuleContext>;</div>
|
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">using</span> Namespace = QString;</div>
|
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">using</span> Key = QString;</div>
|
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="keyword">using</span> LPCallback = std::function<void(Namespace, Key, <span class="keywordtype">int</span>, std::any)>;</div>
|
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div>
|
|
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1Module_1_1ModuleManager.html"> 62</a></span> <span class="keyword">class </span>GPGFRONTEND_CORE_EXPORT <a class="code" href="classGpgFrontend_1_1Module_1_1ModuleManager.html">ModuleManager</a></div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  : <span class="keyword">public</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html">SingletonFunctionObject</a><ModuleManager> {</div>
|
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keyword">explicit</span> <a class="code" href="classGpgFrontend_1_1Module_1_1ModuleManager.html">ModuleManager</a>(<span class="keywordtype">int</span> channel);</div>
|
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  </div>
|
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keyword">virtual</span> ~<a class="code" href="classGpgFrontend_1_1Module_1_1ModuleManager.html">ModuleManager</a>() <span class="keyword">override</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>  <span class="keyword">auto</span> LoadModule(QString, <span class="keywordtype">bool</span>) -> void;</div>
|
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  </div>
|
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keyword">auto</span> SearchModule(ModuleIdentifier) -> ModulePtr;</div>
|
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  </div>
|
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keyword">auto</span> ListAllRegisteredModuleID() -> QList<ModuleIdentifier>;</div>
|
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  </div>
|
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordtype">void</span> RegisterModule(ModulePtr);</div>
|
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  </div>
|
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keyword">auto</span> IsModuleActivated(ModuleIdentifier) -> bool;</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>  <span class="keyword">auto</span> IsIntegratedModule(ModuleIdentifier) -> bool;</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>  <span class="keywordtype">void</span> ListenEvent(ModuleIdentifier, EventIdentifier);</div>
|
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  </div>
|
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordtype">void</span> TriggerEvent(EventReference);</div>
|
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  </div>
|
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keyword">auto</span> SearchEvent(EventTriggerIdentifier) -> std::optional<EventReference>;</div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  </div>
|
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keyword">auto</span> GetModuleListening(ModuleIdentifier) -> QList<EventIdentifier>;</div>
|
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  </div>
|
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordtype">void</span> ActiveModule(ModuleIdentifier);</div>
|
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  </div>
|
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordtype">void</span> DeactiveModule(ModuleIdentifier);</div>
|
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  </div>
|
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keyword">auto</span> GetTaskRunner(ModuleIdentifier) -> std::optional<TaskRunnerPtr>;</div>
|
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  </div>
|
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="keyword">auto</span> <a class="code" href="namespaceGpgFrontend_1_1Module.html#a5e4614222306688d8c2f36fd4ae23de3">UpsertRTValue</a>(Namespace, Key, std::any) -> bool;</div>
|
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  </div>
|
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keyword">auto</span> RetrieveRTValue(Namespace, Key) -> std::optional<std::any>;</div>
|
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  </div>
|
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keyword">auto</span> ListenRTPublish(QObject*, Namespace, Key, LPCallback) -> bool;</div>
|
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  </div>
|
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keyword">auto</span> <a class="code" href="namespaceGpgFrontend_1_1Module.html#a92a4ccb9246f778143ad3e88d2068d7c">ListRTChildKeys</a>(<span class="keyword">const</span> QString&, <span class="keyword">const</span> QString&) -> std::vector<Key>;</div>
|
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  </div>
|
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keyword">auto</span> GRT() -> <a class="code" href="classGpgFrontend_1_1Module_1_1GlobalRegisterTable.html">GlobalRegisterTable</a>*;</div>
|
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  </div>
|
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keyword">private</span>:</div>
|
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keyword">class </span><a class="code" href="classGpgFrontend_1_1Module_1_1ModuleManager_1_1Impl.html">Impl</a>;</div>
|
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  SecureUniquePtr<Impl> p_;</div>
|
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> };</div>
|
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  </div>
|
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span>... Args></div>
|
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="keywordtype">void</span> RegisterModule(Args&&... args) {</div>
|
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#ac963fee992753970bfb5c81608d4070f">ModuleManager::GetInstance</a>().RegisterModule(</div>
|
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  GpgFrontend::SecureCreateSharedObject<T>(std::forward<Args>(args)...));</div>
|
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> }</div>
|
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  </div>
|
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span>... Args></div>
|
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="keywordtype">void</span> RegisterAndActivateModule(Args&&... args) {</div>
|
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keyword">auto</span>& manager = <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#ac963fee992753970bfb5c81608d4070f">ModuleManager::GetInstance</a>();</div>
|
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keyword">auto</span> module =</div>
|
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  GpgFrontend::SecureCreateSharedObject<T>(std::forward<Args>(args)...);</div>
|
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  manager.RegisterModule(module);</div>
|
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  manager.ActiveModule(module->GetModuleIdentifier());</div>
|
|
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> }</div>
|
|
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  </div>
|
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="keyword">template</span> <<span class="keyword">typename</span>... Args></div>
|
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="keywordtype">void</span> TriggerEvent(<span class="keyword">const</span> EventIdentifier& event_id, Args&&... args,</div>
|
|
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  Event::EventCallback e_cb = <span class="keyword">nullptr</span>) {</div>
|
|
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#ac963fee992753970bfb5c81608d4070f">ModuleManager::GetInstance</a>().TriggerEvent(</div>
|
|
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  std::move(MakeEvent(event_id, std::forward<Args>(args)..., e_cb)));</div>
|
|
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> }</div>
|
|
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  </div>
|
|
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">auto</span> GPGFRONTEND_CORE_EXPORT <a class="code" href="namespaceGpgFrontend_1_1Module.html#ad603c5872c4d356cb59b70b63b99126c">IsModuleActivate</a>(ModuleIdentifier) -> bool;</div>
|
|
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  </div>
|
|
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="keyword">auto</span> GPGFRONTEND_CORE_EXPORT <a class="code" href="namespaceGpgFrontend_1_1Module.html#a5e4614222306688d8c2f36fd4ae23de3">UpsertRTValue</a>(<span class="keyword">const</span> QString& namespace_,</div>
|
|
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keyword">const</span> QString& key,</div>
|
|
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keyword">const</span> std::any& value) -> bool;</div>
|
|
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  </div>
|
|
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="keyword">auto</span> GPGFRONTEND_CORE_EXPORT <a class="code" href="namespaceGpgFrontend_1_1Module.html#af88df9c72a7e6ec8dede9afc7234aca7">ListenRTPublishEvent</a>(QObject*, Namespace, Key,</div>
|
|
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  LPCallback) -> bool;</div>
|
|
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  </div>
|
|
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span> <span class="keyword">auto</span> GPGFRONTEND_CORE_EXPORT <a class="code" href="namespaceGpgFrontend_1_1Module.html#a92a4ccb9246f778143ad3e88d2068d7c">ListRTChildKeys</a>(<span class="keyword">const</span> QString& namespace_,</div>
|
|
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keyword">const</span> QString& key)</div>
|
|
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  -> std::vector<Key>;</div>
|
|
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  </div>
|
|
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span> <span class="keyword">auto</span> RetrieveRTValueTyped(<span class="keyword">const</span> QString& namespace_, <span class="keyword">const</span> QString& key)</div>
|
|
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  -> std::optional<T> {</div>
|
|
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keyword">auto</span> any_value =</div>
|
|
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#ac963fee992753970bfb5c81608d4070f">ModuleManager::GetInstance</a>().RetrieveRTValue(namespace_, key);</div>
|
|
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keywordflow">if</span> (any_value && any_value->type() == <span class="keyword">typeid</span>(T)) {</div>
|
|
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">return</span> std::any_cast<T>(*any_value);</div>
|
|
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  }</div>
|
|
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="keywordflow">return</span> std::nullopt;</div>
|
|
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> }</div>
|
|
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  </div>
|
|
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> <span class="keyword">auto</span> RetrieveRTValueTypedOrDefault(<span class="keyword">const</span> QString& namespace_,</div>
|
|
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keyword">const</span> QString& key, <span class="keyword">const</span> T& defaultValue)</div>
|
|
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  -> T {</div>
|
|
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keyword">auto</span> any_value =</div>
|
|
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html#ac963fee992753970bfb5c81608d4070f">ModuleManager::GetInstance</a>().RetrieveRTValue(namespace_, key);</div>
|
|
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="keywordflow">if</span> (any_value && any_value->type() == <span class="keyword">typeid</span>(T)) {</div>
|
|
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordflow">return</span> std::any_cast<T>(*any_value);</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>  <span class="keywordflow">return</span> defaultValue;</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="l00196"></a><span class="lineno"> 196</span> } <span class="comment">// namespace GpgFrontend::Module</span></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1Module_1_1GlobalRegisterTable_html"><div class="ttname"><a href="classGpgFrontend_1_1Module_1_1GlobalRegisterTable.html">GpgFrontend::Module::GlobalRegisterTable</a></div><div class="ttdef"><b>Definition:</b> GlobalRegisterTable.h:43</div></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1Module_1_1ModuleManager_1_1Impl_html"><div class="ttname"><a href="classGpgFrontend_1_1Module_1_1ModuleManager_1_1Impl.html">GpgFrontend::Module::ModuleManager::Impl</a></div><div class="ttdef"><b>Definition:</b> ModuleManager.cpp:47</div></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1Module_1_1ModuleManager_html"><div class="ttname"><a href="classGpgFrontend_1_1Module_1_1ModuleManager.html">GpgFrontend::Module::ModuleManager</a></div><div class="ttdef"><b>Definition:</b> ModuleManager.h:63</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:57</div></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html_ac963fee992753970bfb5c81608d4070f"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html#ac963fee992753970bfb5c81608d4070f">GpgFrontend::SingletonFunctionObject< ModuleManager >::GetInstance</a></div><div class="ttdeci">static auto GetInstance(int channel=GpgFrontend::kGpgFrontendDefaultChannel) -> ModuleManager &</div><div class="ttdoc">Get the Instance object.</div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:79</div></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1Thread_1_1TaskRunner_html"><div class="ttname"><a href="classGpgFrontend_1_1Thread_1_1TaskRunner.html">GpgFrontend::Thread::TaskRunner</a></div><div class="ttdef"><b>Definition:</b> TaskRunner.h:37</div></div>
|
|
<div class="ttc" id="anamespaceGpgFrontend_1_1Module_html"><div class="ttname"><a href="namespaceGpgFrontend_1_1Module.html">GpgFrontend::Module</a></div><div class="ttdef"><b>Definition:</b> Event.cpp:33</div></div>
|
|
<div class="ttc" id="anamespaceGpgFrontend_1_1Module_html_a5e4614222306688d8c2f36fd4ae23de3"><div class="ttname"><a href="namespaceGpgFrontend_1_1Module.html#a5e4614222306688d8c2f36fd4ae23de3">GpgFrontend::Module::UpsertRTValue</a></div><div class="ttdeci">auto UpsertRTValue(const QString &namespace_, const QString &key, const std::any &value) -> bool</div><div class="ttdef"><b>Definition:</b> ModuleManager.cpp:228</div></div>
|
|
<div class="ttc" id="anamespaceGpgFrontend_1_1Module_html_a92a4ccb9246f778143ad3e88d2068d7c"><div class="ttname"><a href="namespaceGpgFrontend_1_1Module.html#a92a4ccb9246f778143ad3e88d2068d7c">GpgFrontend::Module::ListRTChildKeys</a></div><div class="ttdeci">auto ListRTChildKeys(const QString &namespace_, const QString &key) -> std::vector< Key ></div><div class="ttdef"><b>Definition:</b> ModuleManager.cpp:239</div></div>
|
|
<div class="ttc" id="anamespaceGpgFrontend_1_1Module_html_ad603c5872c4d356cb59b70b63b99126c"><div class="ttname"><a href="namespaceGpgFrontend_1_1Module.html#ad603c5872c4d356cb59b70b63b99126c">GpgFrontend::Module::IsModuleActivate</a></div><div class="ttdeci">auto IsModuleActivate(ModuleIdentifier id) -> bool</div><div class="ttdef"><b>Definition:</b> ModuleManager.cpp:224</div></div>
|
|
<div class="ttc" id="anamespaceGpgFrontend_1_1Module_html_af88df9c72a7e6ec8dede9afc7234aca7"><div class="ttname"><a href="namespaceGpgFrontend_1_1Module.html#af88df9c72a7e6ec8dede9afc7234aca7">GpgFrontend::Module::ListenRTPublishEvent</a></div><div class="ttdeci">auto ListenRTPublishEvent(QObject *o, Namespace n, Key k, LPCallback c) -> bool</div><div class="ttdef"><b>Definition:</b> ModuleManager.cpp:234</div></div>
|
|
<div class="ttc" id="anamespaceGpgFrontend_1_1Thread_html"><div class="ttname"><a href="namespaceGpgFrontend_1_1Thread.html">GpgFrontend::Thread</a></div><div class="ttdef"><b>Definition:</b> ModuleManager.h:39</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"><a class="el" href="dir_c716e90dc5842b86ea85e72f843b3f55.html">module</a></li><li class="navelem"><b>ModuleManager.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>
|