You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
107 lines
57 KiB
107 lines
57 KiB
<!-- HTML header for doxygen 1.8.13-->
|
|
<!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.14"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>QtMvvm: serviceregistry.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="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" style="display: inline;">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">QtMvvm
|
|
 <span id="projectnumber">1.1.0</span>
|
|
</div>
|
|
<div id="projectbrief">A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a style="float: right;" target="_blank" href="https://github.com/Skycoder42/QtMvvm">
|
|
<img style="padding: 10px;" src="GitHub_Logo.png"/>
|
|
</a>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.14 -->
|
|
<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');
|
|
/* @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>
|
|
<!-- 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 id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_8373e943c4cd41f1987d0cef0f366888.html">mvvmcore</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">serviceregistry.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="preprocessor">#ifndef QTMVVM_SERVICEREGISTRY_H</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define QTMVVM_SERVICEREGISTRY_H</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> </div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="preprocessor">#include <functional></span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> </div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include <QtCore/qscopedpointer.h></span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include <QtCore/qvariant.h></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include <QtCore/qexception.h></span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> </div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include "QtMvvmCore/qtmvvmcore_global.h"</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include "QtMvvmCore/injection.h"</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">namespace </span><a class="code" href="namespace_qt_mvvm.html">QtMvvm</a> {</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">class </span>ServiceRegistryPrivate;</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html"> 17</a></span> <span class="keyword">class </span>Q_MVVMCORE_EXPORT <a class="code" href="class_qt_mvvm_1_1_service_registry.html">ServiceRegistry</a> <span class="comment">//MAJOR make a QObject for invokable methods and Q_ENUM</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> {</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276"> 21</a></span>  <span class="keyword">enum</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">DestructionScope</a> {</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276a7aac3331077c91c6ae5fe677b91b35c6"> 22</a></span>  DestroyOnAppQuit = 1, </div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276a7a43a0e97844c62bf966b828fb2b7b45"> 23</a></span>  DestroyOnAppDestroy = 2, </div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276a2cf5729a4b8c072676f052b361c6397b"> 24</a></span>  DestroyOnRegistryDestroy = 3, </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276aab3fbc747b7a7ba03fa19fe2d50704f7"> 26</a></span>  DestroyNever = 127 </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> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <a class="code" href="class_qt_mvvm_1_1_service_registry.html">ServiceRegistry</a>(ServiceRegistryPrivate *d_ptr);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  ~<a class="code" href="class_qt_mvvm_1_1_service_registry.html">ServiceRegistry</a>();</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keyword">static</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html">ServiceRegistry</a>* instance();</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TInterface></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="keywordtype">bool</span> isRegistered() <span class="keyword">const</span>;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordtype">bool</span> isRegistered(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &iid) <span class="keyword">const</span>;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TInterface, <span class="keyword">typename</span> TService></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keywordtype">void</span> registerInterface(DestructionScope scope = DestroyOnAppDestroy, <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TInterface, <span class="keyword">typename</span> TService, <span class="keyword">typename</span> TFunc></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordtype">void</span> registerInterface(TFunc fn, DestructionScope scope = DestroyOnAppDestroy, <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TInterface, <span class="keyword">typename</span> TService></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordtype">void</span> registerInterface(TService *service, DestructionScope scope = DestroyOnAppDestroy, <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TService></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordtype">void</span> registerObject(DestructionScope scope = DestroyOnAppDestroy, <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TService, <span class="keyword">typename</span> TFunc></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordtype">void</span> registerObject(TFunc fn, DestructionScope scope = DestroyOnAppDestroy, <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TService></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordtype">void</span> registerObject(TService *service, DestructionScope scope = DestroyOnAppDestroy, <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TInterface></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordtype">void</span> registerPlugin(<a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qstring.html">QString</a> pluginType = {}, <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qstring.html">QString</a> pluginKey = {}, DestructionScope scope = DestroyOnAppDestroy, <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordtype">void</span> registerService(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &iid,</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qmetaobject.html">QMetaObject</a> *metaObject,</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  DestructionScope scope = DestroyOnAppDestroy,</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  Q_DECL_DEPRECATED <span class="keywordtype">void</span> registerService(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &iid,</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qmetaobject.html">QMetaObject</a> *metaObject,</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordtype">bool</span> weak);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordtype">void</span> registerService(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &iid,</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keyword">const</span> std::function<<a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a>*(<span class="keyword">const</span> QObjectList &)> &fn,</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearraylist.html">QByteArrayList</a> injectables,</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  DestructionScope scope = DestroyOnAppDestroy,</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  Q_DECL_DEPRECATED <span class="keywordtype">void</span> registerService(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &iid,</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keyword">const</span> std::function<<a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a>*(<span class="keyword">const</span> QObjectList &)> &fn,</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearraylist.html">QByteArrayList</a> injectables,</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordtype">bool</span> weak);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordtype">void</span> registerService(<a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> iid,</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qstring.html">QString</a> pluginType = {},</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qstring.html">QString</a> pluginKey = {},</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  DestructionScope scope = DestroyOnAppDestroy,</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordtype">bool</span> weak = <span class="keyword">false</span>);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TInterface></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  TInterface *service();</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a> *serviceObj(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &iid);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordtype">void</span> injectServices(<a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a> *<span class="keywordtype">object</span>);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> TClass></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  TClass *constructInjected(<a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a> *parent = <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a> *constructInjected(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qmetaobject.html">QMetaObject</a> *metaObject, <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a> *parent = <span class="keyword">nullptr</span>);</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">friend</span> <span class="keyword">class </span>QtMvvm::ServiceRegistryPrivate;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qscopedpointer.html">QScopedPointer<ServiceRegistryPrivate></a> d;</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="l00111"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_exists_exception.html"> 111</a></span> <span class="keyword">class </span>Q_MVVMCORE_EXPORT <a class="code" href="class_qt_mvvm_1_1_service_exists_exception.html">ServiceExistsException</a> : <span class="keyword">public</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtdatasync/qtdatasync.tags:https://skycoder42.github.io/QtDataSync/" href="https://skycoder42.github.io/QtDataSync/class_q_exception.html">QException</a></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> {</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <a class="code" href="class_qt_mvvm_1_1_service_exists_exception.html">ServiceExistsException</a>(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &iid);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *what() <span class="keyword">const</span> noexcept <span class="keyword">override</span>;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordtype">void</span> <span class="keyword">raise</span>() <span class="keyword">const</span> <span class="keyword">override</span>;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtdatasync/qtdatasync.tags:https://skycoder42.github.io/QtDataSync/" href="https://skycoder42.github.io/QtDataSync/class_q_exception.html">QException</a> *clone() <span class="keyword">const override</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">protected</span>:</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="class_qt_mvvm_1_1_service_exists_exception.html">ServiceExistsException</a>(<span class="keyword">const</span> <a class="code" href="class_qt_mvvm_1_1_service_exists_exception.html">ServiceExistsException</a> * <span class="keyword">const</span> other);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> </div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> _msg;</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="l00134"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_construction_exception.html"> 134</a></span> <span class="keyword">class </span>Q_MVVMCORE_EXPORT <a class="code" href="class_qt_mvvm_1_1_service_construction_exception.html">ServiceConstructionException</a> : <span class="keyword">public</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtdatasync/qtdatasync.tags:https://skycoder42.github.io/QtDataSync/" href="https://skycoder42.github.io/QtDataSync/class_q_exception.html">QException</a></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> {</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <a class="code" href="class_qt_mvvm_1_1_service_construction_exception.html">ServiceConstructionException</a>(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &message);</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> </div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *what() <span class="keyword">const</span> noexcept <span class="keyword">override</span>;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordtype">void</span> <span class="keyword">raise</span>() <span class="keyword">const</span> <span class="keyword">override</span>;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtdatasync/qtdatasync.tags:https://skycoder42.github.io/QtDataSync/" href="https://skycoder42.github.io/QtDataSync/class_q_exception.html">QException</a> *clone() <span class="keyword">const override</span>;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="keyword">protected</span>:</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <a class="code" href="class_qt_mvvm_1_1_service_construction_exception.html">ServiceConstructionException</a>(<span class="keyword">const</span> <a class="code" href="class_qt_mvvm_1_1_service_construction_exception.html">ServiceConstructionException</a> * <span class="keyword">const</span> other);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> _msg;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span> };</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> </div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_dependency_exception.html"> 157</a></span> <span class="keyword">class </span>Q_MVVMCORE_EXPORT <a class="code" href="class_qt_mvvm_1_1_service_dependency_exception.html">ServiceDependencyException</a> : <span class="keyword">public</span> <a class="code" href="class_qt_mvvm_1_1_service_construction_exception.html">ServiceConstructionException</a></div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> {</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <a class="code" href="class_qt_mvvm_1_1_service_dependency_exception.html">ServiceDependencyException</a>(<span class="keyword">const</span> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a> &iid);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keywordtype">void</span> <span class="keyword">raise</span>() <span class="keyword">const</span> <span class="keyword">override</span>;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtdatasync/qtdatasync.tags:https://skycoder42.github.io/QtDataSync/" href="https://skycoder42.github.io/QtDataSync/class_q_exception.html">QException</a> *clone() <span class="keyword">const override</span>;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span> </div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> <span class="keyword">protected</span>:</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <a class="code" href="class_qt_mvvm_1_1_service_dependency_exception.html">ServiceDependencyException</a>(<span class="keyword">const</span> <a class="code" href="class_qt_mvvm_1_1_service_dependency_exception.html">ServiceDependencyException</a> * <span class="keyword">const</span> other);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> };</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span> </div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="comment">// ------------- Generic Implementation -------------</span></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> TInterface></div><div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#a2fddc2077d76404550f037dfbd9029ca"> 174</a></span> <span class="keywordtype">bool</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a2fddc2077d76404550f037dfbd9029ca">ServiceRegistry::isRegistered</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> <span class="keyword"></span>{</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordflow">return</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a2fddc2077d76404550f037dfbd9029ca">isRegistered</a>(__helpertypes::inject_iid<TInterface*>());</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> }</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span> </div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> <span class="preprocessor">#define QTMVVM_SERVICE_ASSERT(tint, tsvc) \</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> <span class="preprocessor"> static_assert(__helpertypes::is_valid_interface<TInterface, TService>::value, "TService must implement the given TInterface interface and be a qobject class"); \</span></div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> <span class="preprocessor"> Q_ASSERT_X(qobject_interface_iid<TInterface*>(), Q_FUNC_INFO, "TInterface must be registered with Q_DECLARE_INTERFACE");</span></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> <span class="keyword">template</span><<span class="keyword">typename</span> TInterface, <span class="keyword">typename</span> TService></div><div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#ab683dc8ccbb0e0198f0d5664b1f1f9ca"> 184</a></span> <span class="keywordtype">void</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#ab683dc8ccbb0e0198f0d5664b1f1f9ca">ServiceRegistry::registerInterface</a>(<a class="code" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">DestructionScope</a> scope, <span class="keywordtype">bool</span> weak)</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>  QTMVVM_SERVICE_ASSERT(TInterface, TService)</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a9fa590672277212bc246251b4a0f7f86">registerService</a>(qobject_interface_iid<TInterface*>(), &TService::staticMetaObject, scope, weak);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span> }</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> <span class="keyword">template</span> <<span class="keyword">typename</span> TInterface, <span class="keyword">typename</span> TService, <span class="keyword">typename</span> TFunc></div><div class="line"><a name="l00191"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#afb4dc088a24802160d9f9f01f69eaa2d"> 191</a></span> <span class="keywordtype">void</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#ab683dc8ccbb0e0198f0d5664b1f1f9ca">ServiceRegistry::registerInterface</a>(TFunc fn, <a class="code" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">DestructionScope</a> scope, <span class="keywordtype">bool</span> weak)</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>  QTMVVM_SERVICE_ASSERT(TInterface, TService)</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearraylist.html">QByteArrayList</a> injectables;</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keyword">auto</span> packed_fn = __helpertypes::pack_function(std::move(fn), injectables);</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a9fa590672277212bc246251b4a0f7f86">registerService</a>(qobject_interface_iid<TInterface*>(), packed_fn, injectables, scope, weak);</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> }</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span> </div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="keyword">template</span><<span class="keyword">typename</span> TInterface, <span class="keyword">typename</span> TService></div><div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#a7e0928c964a40cb88495c764d0b8627c"> 200</a></span> <span class="keywordtype">void</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#ab683dc8ccbb0e0198f0d5664b1f1f9ca">ServiceRegistry::registerInterface</a>(TService *service, <a class="code" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">DestructionScope</a> scope, <span class="keywordtype">bool</span> weak)</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> {</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  QTMVVM_SERVICE_ASSERT(TInterface, TService)</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a9fa590672277212bc246251b4a0f7f86">registerService</a>(qobject_interface_iid<TInterface*>(), [<a class="code" href="class_qt_mvvm_1_1_service_registry.html#a54085d3bac2c39f58c46165827686a31">service</a>](<span class="keyword">const</span> QObjectList &params) -> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a>* {</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  Q_UNUSED(params);</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">return</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a54085d3bac2c39f58c46165827686a31">service</a>;</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  }, <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearraylist.html">QByteArrayList</a>(), scope, weak);</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span> }</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> <span class="preprocessor">#undef QTMVVM_SERVICE_ASSERT</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span> <span class="preprocessor">#define QTMVVM_SERVICE_ASSERT(tsvc) \</span></div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> <span class="preprocessor"> static_assert(__helpertypes::is_qobj<tsvc>::value, "TService must be a qobject class");</span></div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> </div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> <span class="keyword">template</span><<span class="keyword">typename</span> TService></div><div class="line"><a name="l00214"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#ada266f18e940d48ac4030093955c55f9"> 214</a></span> <span class="keywordtype">void</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#ada266f18e940d48ac4030093955c55f9">ServiceRegistry::registerObject</a>(<a class="code" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">DestructionScope</a> scope, <span class="keywordtype">bool</span> weak)</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span> {</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  QTMVVM_SERVICE_ASSERT(TService)</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a9fa590672277212bc246251b4a0f7f86">registerService</a>(__helpertypes::qobject_iid<TService*>(), &TService::staticMetaObject, scope, weak);</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> }</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span> </div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span> <span class="keyword">template</span><<span class="keyword">typename</span> TService, <span class="keyword">typename</span> TFunc></div><div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#abf7c09845abe552aa47206413ad983f8"> 221</a></span> <span class="keywordtype">void</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#ada266f18e940d48ac4030093955c55f9">ServiceRegistry::registerObject</a>(TFunc fn, <a class="code" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">DestructionScope</a> scope, <span class="keywordtype">bool</span> weak)</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>  QTMVVM_SERVICE_ASSERT(TService)</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearraylist.html">QByteArrayList</a> injectables;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keyword">auto</span> packed_fn = __helpertypes::pack_function(std::move(fn), injectables);</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a9fa590672277212bc246251b4a0f7f86">registerService</a>(__helpertypes::qobject_iid<TService*>(), packed_fn, injectables, scope, weak);</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span> }</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span> </div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span> <span class="keyword">template</span><<span class="keyword">typename</span> TService></div><div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#a3cc1bdd66d9ac15b26e22bf1a8a39fd8"> 230</a></span> <span class="keywordtype">void</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#ada266f18e940d48ac4030093955c55f9">ServiceRegistry::registerObject</a>(TService *service, <a class="code" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">DestructionScope</a> scope, <span class="keywordtype">bool</span> weak)</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> {</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  QTMVVM_SERVICE_ASSERT(TService)</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a9fa590672277212bc246251b4a0f7f86">registerService</a>(__helpertypes::qobject_iid<TService*>(), [<a class="code" href="class_qt_mvvm_1_1_service_registry.html#a54085d3bac2c39f58c46165827686a31">service</a>](<span class="keyword">const</span> QObjectList &params) -> <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a>* {</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  Q_UNUSED(params);</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordflow">return</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a54085d3bac2c39f58c46165827686a31">service</a>;</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  }, <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qbytearraylist.html">QByteArrayList</a>(), scope, weak);</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> }</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> </div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span> <span class="preprocessor">#undef QTMVVM_SERVICE_ASSERT</span></div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> </div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span> <span class="keyword">template</span><<span class="keyword">typename</span> TInterface></div><div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#a24ea425f41f3919488e23c342193626f"> 242</a></span> <span class="keywordtype">void</span> <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a24ea425f41f3919488e23c342193626f">ServiceRegistry::registerPlugin</a>(<a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qstring.html">QString</a> pluginType, <a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtcore/qtcore.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/qstring.html">QString</a> pluginKey, <a class="code" href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">DestructionScope</a> scope, <span class="keywordtype">bool</span> weak)</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span> {</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <a class="code" href="class_qt_mvvm_1_1_service_registry.html#a9fa590672277212bc246251b4a0f7f86">registerService</a>(qobject_interface_iid<TInterface*>(), std::move(pluginType), std::move(pluginKey), scope, weak);</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span> }</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span> </div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span> <span class="keyword">template</span><<span class="keyword">typename</span> TInterface></div><div class="line"><a name="l00248"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#a54085d3bac2c39f58c46165827686a31"> 248</a></span> TInterface *<a class="code" href="class_qt_mvvm_1_1_service_registry.html#a54085d3bac2c39f58c46165827686a31">ServiceRegistry::service</a>()</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span> {</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  <span class="keywordflow">return</span> qobject_cast<TInterface*>(<a class="code" href="class_qt_mvvm_1_1_service_registry.html#abff2c6776647fdb377860a3c3cca9080">serviceObj</a>(__helpertypes::inject_iid<TInterface*>()));</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="l00253"></a><span class="lineno"> 253</span> <span class="keyword">template</span><<span class="keyword">typename</span> TClass></div><div class="line"><a name="l00254"></a><span class="lineno"><a class="line" href="class_qt_mvvm_1_1_service_registry.html#a3db366f49af65a3b7b79a5494bb69f19"> 254</a></span> TClass *<a class="code" href="class_qt_mvvm_1_1_service_registry.html#a3db366f49af65a3b7b79a5494bb69f19">ServiceRegistry::constructInjected</a>(<a class="codeRef" target="_blank" doxygen="/home/sky/Qt/Docs/Qt-5.11.1/qtautoupdater/qtautoupdater.tags:https://doc.qt.io/qt-5/" href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a> *parent)</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span> {</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  static_assert(__helpertypes::is_qobj<TClass>::value, <span class="stringliteral">"TClass must be a qobject class"</span>);</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordflow">return</span> qobject_cast<TClass*>(<a class="code" href="class_qt_mvvm_1_1_service_registry.html#a3db366f49af65a3b7b79a5494bb69f19">constructInjected</a>(&TClass::staticMetaObject, parent));</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> }</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span> </div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> }</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span> </div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span> <span class="preprocessor">#endif // QTMVVM_SERVICEREGISTRY_H</span></div><div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_a9fa590672277212bc246251b4a0f7f86"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#a9fa590672277212bc246251b4a0f7f86">QtMvvm::ServiceRegistry::registerService</a></div><div class="ttdeci">void registerService(const QByteArray &iid, const QMetaObject *metaObject, DestructionScope scope=DestroyOnAppDestroy, bool weak=false)</div><div class="ttdoc">Register a service by an iid via their metadata. </div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_a3db366f49af65a3b7b79a5494bb69f19"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#a3db366f49af65a3b7b79a5494bb69f19">QtMvvm::ServiceRegistry::constructInjected</a></div><div class="ttdeci">TClass * constructInjected(QObject *parent=nullptr)</div><div class="ttdoc">Constructs a new instance of TClass with properties injected. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00254">serviceregistry.h:254</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_ada266f18e940d48ac4030093955c55f9"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#ada266f18e940d48ac4030093955c55f9">QtMvvm::ServiceRegistry::registerObject</a></div><div class="ttdeci">void registerObject(DestructionScope scope=DestroyOnAppDestroy, bool weak=false)</div><div class="ttdoc">Register a service via its type. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00214">serviceregistry.h:214</a></div></div>
|
|
<div class="ttc" id="qbytearray_html"><div class="ttname"><a href="https://doc.qt.io/qt-5/qbytearray.html">QByteArray</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_a24ea425f41f3919488e23c342193626f"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#a24ea425f41f3919488e23c342193626f">QtMvvm::ServiceRegistry::registerPlugin</a></div><div class="ttdeci">void registerPlugin(QString pluginType={}, QString pluginKey={}, DestructionScope scope=DestroyOnAppDestroy, bool weak=false)</div><div class="ttdoc">Register a service via specifing a plugin to be loaded. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00242">serviceregistry.h:242</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_dependency_exception_html"><div class="ttname"><a href="class_qt_mvvm_1_1_service_dependency_exception.html">QtMvvm::ServiceDependencyException</a></div><div class="ttdoc">Is thrown if a service could not be created because of a missing dependency to be injected...</div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00157">serviceregistry.h:157</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_a2fddc2077d76404550f037dfbd9029ca"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#a2fddc2077d76404550f037dfbd9029ca">QtMvvm::ServiceRegistry::isRegistered</a></div><div class="ttdeci">bool isRegistered() const</div><div class="ttdoc">Checks if a given interface or service is already registered. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00174">serviceregistry.h:174</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_exists_exception_html"><div class="ttname"><a href="class_qt_mvvm_1_1_service_exists_exception.html">QtMvvm::ServiceExistsException</a></div><div class="ttdoc">Is thrown if a service is beeing registered that is already registered. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00111">serviceregistry.h:111</a></div></div>
|
|
<div class="ttc" id="qmetaobject_html"><div class="ttname"><a href="https://doc.qt.io/qt-5/qmetaobject.html">QMetaObject</a></div></div>
|
|
<div class="ttc" id="class_q_exception_html"><div class="ttname"><a href="https://skycoder42.github.io/QtDataSync/class_q_exception.html">QException</a></div></div>
|
|
<div class="ttc" id="qscopedpointer_html"><div class="ttname"><a href="https://doc.qt.io/qt-5/qscopedpointer.html">QScopedPointer< ServiceRegistryPrivate ></a></div></div>
|
|
<div class="ttc" id="qbytearraylist_html"><div class="ttname"><a href="https://doc.qt.io/qt-5/qbytearraylist.html">QByteArrayList</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html">QtMvvm::ServiceRegistry</a></div><div class="ttdoc">A singleton to prepare services for dependency injection and to access them. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00017">serviceregistry.h:17</a></div></div>
|
|
<div class="ttc" id="qstring_html"><div class="ttname"><a href="https://doc.qt.io/qt-5/qstring.html">QString</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_aff6b990faf118b6305c6d6cd4cacb276"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#aff6b990faf118b6305c6d6cd4cacb276">QtMvvm::ServiceRegistry::DestructionScope</a></div><div class="ttdeci">DestructionScope</div><div class="ttdoc">A scope to indicate when a service should be deleted. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00021">serviceregistry.h:21</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_a54085d3bac2c39f58c46165827686a31"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#a54085d3bac2c39f58c46165827686a31">QtMvvm::ServiceRegistry::service</a></div><div class="ttdeci">TInterface * service()</div><div class="ttdoc">Returns the service for the given interface. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00248">serviceregistry.h:248</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_construction_exception_html"><div class="ttname"><a href="class_qt_mvvm_1_1_service_construction_exception.html">QtMvvm::ServiceConstructionException</a></div><div class="ttdoc">Is thrown in case the construction of a service has failed. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00134">serviceregistry.h:134</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_abff2c6776647fdb377860a3c3cca9080"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#abff2c6776647fdb377860a3c3cca9080">QtMvvm::ServiceRegistry::serviceObj</a></div><div class="ttdeci">QObject * serviceObj(const QByteArray &iid)</div><div class="ttdoc">Returns the service for the given iid. </div></div>
|
|
<div class="ttc" id="class_q_object_html"><div class="ttname"><a href="https://doc.qt.io/qt-5/class_q_object.html">QObject</a></div></div>
|
|
<div class="ttc" id="namespace_qt_mvvm_html"><div class="ttname"><a href="namespace_qt_mvvm.html">QtMvvm</a></div><div class="ttdoc">The primary namespace of the QtMvvm library. </div><div class="ttdef"><b>Definition:</b> <a href="androidsettingsaccessor_8h_source.html#l00009">androidsettingsaccessor.h:9</a></div></div>
|
|
<div class="ttc" id="class_qt_mvvm_1_1_service_registry_html_ab683dc8ccbb0e0198f0d5664b1f1f9ca"><div class="ttname"><a href="class_qt_mvvm_1_1_service_registry.html#ab683dc8ccbb0e0198f0d5664b1f1f9ca">QtMvvm::ServiceRegistry::registerInterface</a></div><div class="ttdeci">void registerInterface(DestructionScope scope=DestroyOnAppDestroy, bool weak=false)</div><div class="ttdoc">Register a service for its interface via the type. </div><div class="ttdef"><b>Definition:</b> <a href="serviceregistry_8h_source.html#l00184">serviceregistry.h:184</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Wed Aug 8 2018 19:15:45 for QtMvvm by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.14
|
|
</small></address>
|
|
</body>
|
|
</html>
|
|
|