adatabase_8h_source.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.20"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>openPilotLog: src/experimental/adatabase.h Source File</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  17. <script type="text/javascript" src="search/searchdata.js"></script>
  18. <script type="text/javascript" src="search/search.js"></script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. <link href="custom_dark_theme.css" rel="stylesheet" type="text/css"/>
  21. </head>
  22. <body>
  23. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  24. <div id="titlearea">
  25. <table cellspacing="0" cellpadding="0">
  26. <tbody>
  27. <tr style="height: 56px;">
  28. <td id="projectalign" style="padding-left: 0.5em;">
  29. <div id="projectname">openPilotLog
  30. </div>
  31. </td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. <!-- end header part -->
  37. <!-- Generated by Doxygen 1.8.20 -->
  38. <script type="text/javascript">
  39. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  40. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  41. /* @license-end */
  42. </script>
  43. <script type="text/javascript" src="menudata.js"></script>
  44. <script type="text/javascript" src="menu.js"></script>
  45. <script type="text/javascript">
  46. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  47. $(function() {
  48. initMenu('',true,false,'search.php','Search');
  49. $(document).ready(function() { init_search(); });
  50. });
  51. /* @license-end */</script>
  52. <div id="main-nav"></div>
  53. </div><!-- top -->
  54. <div id="side-nav" class="ui-resizable side-nav-resizable">
  55. <div id="nav-tree">
  56. <div id="nav-tree-contents">
  57. <div id="nav-sync" class="sync"></div>
  58. </div>
  59. </div>
  60. <div id="splitbar" style="-moz-user-select:none;"
  61. class="ui-resizable-handle">
  62. </div>
  63. </div>
  64. <script type="text/javascript">
  65. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  66. $(document).ready(function(){initNavTree('adatabase_8h_source.html',''); initResizable(); });
  67. /* @license-end */
  68. </script>
  69. <div id="doc-content">
  70. <!-- window showing the filter options -->
  71. <div id="MSearchSelectWindow"
  72. onmouseover="return searchBox.OnSearchSelectShow()"
  73. onmouseout="return searchBox.OnSearchSelectHide()"
  74. onkeydown="return searchBox.OnSearchSelectKey(event)">
  75. </div>
  76. <!-- iframe showing the search results (closed by default) -->
  77. <div id="MSearchResultsWindow">
  78. <iframe src="javascript:void(0)" frameborder="0"
  79. name="MSearchResults" id="MSearchResults">
  80. </iframe>
  81. </div>
  82. <div class="header">
  83. <div class="headertitle">
  84. <div class="title">adatabase.h</div> </div>
  85. </div><!--header-->
  86. <div class="contents">
  87. <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div>
  88. <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> *openPilot Log - A FOSS Pilot Logbook Application</span></div>
  89. <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *Copyright (C) 2020 Felix Turowsky</span></div>
  90. <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> *</span></div>
  91. <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *This program is free software: you can redistribute it and/or modify</span></div>
  92. <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> *it under the terms of the GNU General Public License as published by</span></div>
  93. <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *the Free Software Foundation, either version 3 of the License, or</span></div>
  94. <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *(at your option) any later version.</span></div>
  95. <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> *</span></div>
  96. <div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> *This program is distributed in the hope that it will be useful,</span></div>
  97. <div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> *but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
  98. <div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
  99. <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *GNU General Public License for more details.</span></div>
  100. <div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> *</span></div>
  101. <div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> *You should have received a copy of the GNU General Public License</span></div>
  102. <div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> *along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.</span></div>
  103. <div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> */</span></div>
  104. <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#ifndef __DB_H__</span></div>
  105. <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#define __DB_H__</span></div>
  106. <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; </div>
  107. <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &lt;QPair&gt;</span></div>
  108. <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;QMap&gt;</span></div>
  109. <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;QString&gt;</span></div>
  110. <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;QSqlQuery&gt;</span></div>
  111. <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;QSqlError&gt;</span></div>
  112. <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;QSqlTableModel&gt;</span></div>
  113. <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;src/database/dbinfo.h&quot;</span></div>
  114. <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;src/testing/adebug.h&quot;</span></div>
  115. <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
  116. <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;aentry.h&quot;</span></div>
  117. <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;apilotentry.h&quot;</span></div>
  118. <div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;atailentry.h&quot;</span></div>
  119. <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &quot;aaircraftentry.h&quot;</span></div>
  120. <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &quot;aflightentry.h&quot;</span></div>
  121. <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
  122. <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceexperimental.html">experimental</a> {</div>
  123. <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; </div>
  124. <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
  125. <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment">// [G]: Suspicious documentation -,O</span></div>
  126. <div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a"> 44</a></span>&#160;<span class="comment"></span><span class="keyword">enum class</span> <a class="code" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a">ADatabaseTarget</a></div>
  127. <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;{</div>
  128. <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; airport_identifier_icao,</div>
  129. <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; airport_identifier_iata,</div>
  130. <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; airport_identifier_all,</div>
  131. <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; airport_names,</div>
  132. <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; pilots,</div>
  133. <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; registrations,</div>
  134. <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; aircraft,</div>
  135. <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; companies,</div>
  136. <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; tails</div>
  137. <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;};</div>
  138. <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; </div>
  139. <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment">// [G]: This is how we should handle custom &quot;events&quot; in the program.</span></div>
  140. <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment">// In this case a custom error doesnt need to be built from scratch.</span></div>
  141. <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="comment">// Find the type of error you want and extend it with a few tweaks.</span></div>
  142. <div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classexperimental_1_1_a_database_error.html"> 64</a></span>&#160;<span class="comment"></span><span class="keyword">class </span><a class="code" href="classexperimental_1_1_a_database_error.html">ADatabaseError</a> : <span class="keyword">public</span> QSqlError {</div>
  143. <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="keyword">public</span>:</div>
  144. <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <a class="code" href="classexperimental_1_1_a_database_error.html">ADatabaseError</a>() = <span class="keywordflow">default</span>;</div>
  145. <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <a class="code" href="classexperimental_1_1_a_database_error.html">ADatabaseError</a>(QString msg);</div>
  146. <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; QString text() <span class="keyword">const</span>;</div>
  147. <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;};</div>
  148. <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; </div>
  149. <div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classexperimental_1_1_a_database.html"> 75</a></span>&#160;<span class="keyword">class </span><a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a> : <span class="keyword">public</span> QObject {</div>
  150. <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; Q_OBJECT</div>
  151. <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="keyword">private</span>:</div>
  152. <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; TableNames tableNames;</div>
  153. <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; TableColumns tableColumns;</div>
  154. <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keyword">static</span> <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>* instance;</div>
  155. <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>() = <span class="keywordflow">default</span>;</div>
  156. <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="keyword">public</span>:</div>
  157. <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">// Ensure DB is not copiable or assignable</span></div>
  158. <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>(<span class="keyword">const</span> <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>&amp;) = <span class="keyword">delete</span>;</div>
  159. <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>&amp;) = <span class="keyword">delete</span>;</div>
  160. <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keyword">static</span> <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>* getInstance();</div>
  161. <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <a class="code" href="classexperimental_1_1_a_database_error.html">ADatabaseError</a> lastError;</div>
  162. <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; </div>
  163. <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#aa45ad744482ae94d8f639e5837c9c221">connect</a>();</div>
  164. <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; </div>
  165. <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classexperimental_1_1_a_database.html#a5e331e329bc21980d3e2f63c7ca01559">disconnect</a>();</div>
  166. <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; </div>
  167. <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keyword">static</span> QSqlDatabase <a class="code" href="classexperimental_1_1_a_database.html#a5a1d594fadb083e97aa8d50f736ab0ea">database</a>();</div>
  168. <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
  169. <div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; QVector&lt;QString&gt; <a class="code" href="classexperimental_1_1_a_database.html#ae536aeb620c52f873f1f0943cfeb9db0">customQuery</a>(QString statement, <span class="keywordtype">int</span> return_values);</div>
  170. <div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; </div>
  171. <div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#ad3fc7756ef3f032d252b02ed6867e0a5">exists</a>(<a class="code" href="classexperimental_1_1_a_entry.html">AEntry</a> entry);</div>
  172. <div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#ad3fc7756ef3f032d252b02ed6867e0a5">exists</a>(<a class="code" href="structexperimental_1_1_data_position.html">DataPosition</a> data_position);</div>
  173. <div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; </div>
  174. <div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#a041619c4931943406dff1be52eb77434">commit</a>(<a class="code" href="classexperimental_1_1_a_entry.html">AEntry</a> entry);</div>
  175. <div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; </div>
  176. <div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#a328fb63a110c9ada4af7ff2e4b240dfe">insert</a>(<a class="code" href="classexperimental_1_1_a_entry.html">AEntry</a> new_entry);</div>
  177. <div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; </div>
  178. <div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#ada25b4b94ab41b5ec78925a0a52b14ca">update</a>(<a class="code" href="classexperimental_1_1_a_entry.html">AEntry</a> updated_entry);</div>
  179. <div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; </div>
  180. <div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#aeeb82d8057f36436fd793a242627668e">remove</a>(<a class="code" href="classexperimental_1_1_a_entry.html">AEntry</a> entry);</div>
  181. <div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; </div>
  182. <div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#ab4fe26545b5fd05fa6b63486f2d234e3">removeMany</a>(QList&lt;DataPosition&gt;);</div>
  183. <div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; </div>
  184. <div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; TableData <a class="code" href="classexperimental_1_1_a_database.html#ae71340a7dc2668e9ae6e65117b16d1bd">getEntryData</a>(<a class="code" href="structexperimental_1_1_data_position.html">DataPosition</a> data_position);</div>
  185. <div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; </div>
  186. <div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <a class="code" href="classexperimental_1_1_a_entry.html">AEntry</a> <a class="code" href="classexperimental_1_1_a_database.html#ad273efb62d7829e5cef4440d78b53161">getEntry</a>(<a class="code" href="structexperimental_1_1_data_position.html">DataPosition</a> data_position);</div>
  187. <div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; </div>
  188. <div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="structexperimental_1_1_a_pilot_entry.html">APilotEntry</a> <a class="code" href="classexperimental_1_1_a_database.html#ae8fac5f877e2ab11eab07781ebcab4b1">getPilotEntry</a>(RowId row_id);</div>
  189. <div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; </div>
  190. <div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="structexperimental_1_1_a_tail_entry.html">ATailEntry</a> <a class="code" href="classexperimental_1_1_a_database.html#ad05071058f2706dddd9c681d6946ef6d">getTailEntry</a>(RowId row_id);</div>
  191. <div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; </div>
  192. <div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <a class="code" href="structexperimental_1_1_a_aircraft_entry.html">AAircraftEntry</a> <a class="code" href="classexperimental_1_1_a_database.html#aee75f906918935027d95b3e5d8e1ff75">getAircraftEntry</a>(RowId row_id);</div>
  193. <div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; </div>
  194. <div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <a class="code" href="classexperimental_1_1_a_flight_entry.html">AFlightEntry</a> <a class="code" href="classexperimental_1_1_a_database.html#ac613f3dd83524ef30dd6351e3b8a50f3">getFlightEntry</a>(RowId row_id);</div>
  195. <div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; </div>
  196. <div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keyword">const</span> QStringList <a class="code" href="classexperimental_1_1_a_database.html#a1e3fa80e9472325fa41f227319592b26">getCompletionList</a>(<a class="code" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a">ADatabaseTarget</a>);</div>
  197. <div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; </div>
  198. <div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keyword">const</span> QMap&lt;QString, int&gt; <a class="code" href="classexperimental_1_1_a_database.html#a74280b96dbf58580ed9b1485b5cdc200">getIdMap</a>(<a class="code" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a">ADatabaseTarget</a>);</div>
  199. <div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; </div>
  200. <div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordtype">int</span> <a class="code" href="classexperimental_1_1_a_database.html#a391a945bf0bf3160045690319833edce">getLastEntry</a>(<a class="code" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a">ADatabaseTarget</a>);</div>
  201. <div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; </div>
  202. <div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; QList&lt;int&gt; <a class="code" href="classexperimental_1_1_a_database.html#aaa6d9017e72693dd26a0ebd311dcef91">getForeignKeyConstraints</a>(<span class="keywordtype">int</span> foreign_row_id, <a class="code" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a">ADatabaseTarget</a> target);</div>
  203. <div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; </div>
  204. <div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;signals:</div>
  205. <div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="classexperimental_1_1_a_database.html#a202981d0d39b5b3dbc88af65e17ed42a"> 225</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classexperimental_1_1_a_database.html#a202981d0d39b5b3dbc88af65e17ed42a">dataBaseUpdated</a>();</div>
  206. <div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;};</div>
  207. <div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; </div>
  208. <div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>* <a class="code" href="namespaceexperimental.html#a3f601400554a3aab738cab39bfa5cc7e">aDB</a>();</div>
  209. <div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; </div>
  210. <div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;} <span class="comment">// namespace experimental</span></div>
  211. <div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; </div>
  212. <div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="preprocessor">#endif</span></div>
  213. </div><!-- fragment --></div><!-- contents -->
  214. </div><!-- doc-content -->
  215. <div class="ttc" id="anamespaceexperimental_html"><div class="ttname"><a href="namespaceexperimental.html">experimental</a></div><div class="ttdoc">Temporary namespace for experimental features. Will be removed in later versions.</div><div class="ttdef"><b>Definition:</b> aaircraftentry.cpp:20</div></div>
  216. <div class="ttc" id="aclassexperimental_1_1_a_database_html_a202981d0d39b5b3dbc88af65e17ed42a"><div class="ttname"><a href="classexperimental_1_1_a_database.html#a202981d0d39b5b3dbc88af65e17ed42a">experimental::ADatabase::dataBaseUpdated</a></div><div class="ttdeci">void dataBaseUpdated()</div><div class="ttdoc">updated is emitted whenever the database contents have been updated. This can be either a commit,...</div></div>
  217. <div class="ttc" id="aclassexperimental_1_1_a_database_html_a5e331e329bc21980d3e2f63c7ca01559"><div class="ttname"><a href="classexperimental_1_1_a_database.html#a5e331e329bc21980d3e2f63c7ca01559">experimental::ADatabase::disconnect</a></div><div class="ttdeci">void disconnect()</div><div class="ttdoc">closes the database connection.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:75</div></div>
  218. <div class="ttc" id="astructexperimental_1_1_data_position_html"><div class="ttname"><a href="structexperimental_1_1_data_position.html">experimental::DataPosition</a></div><div class="ttdef"><b>Definition:</b> decl.h:45</div></div>
  219. <div class="ttc" id="aclassexperimental_1_1_a_entry_html"><div class="ttname"><a href="classexperimental_1_1_a_entry.html">experimental::AEntry</a></div><div class="ttdoc">The Entry class encapsulates table metadata(table name, row id) and data for new and existing entries...</div><div class="ttdef"><b>Definition:</b> aentry.h:42</div></div>
  220. <div class="ttc" id="aclassexperimental_1_1_a_database_html_a041619c4931943406dff1be52eb77434"><div class="ttname"><a href="classexperimental_1_1_a_database.html#a041619c4931943406dff1be52eb77434">experimental::ADatabase::commit</a></div><div class="ttdeci">bool commit(AEntry entry)</div><div class="ttdoc">commits an entry to the database, calls either insert or update, based on position data</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:88</div></div>
  221. <div class="ttc" id="aclassexperimental_1_1_a_database_html_a74280b96dbf58580ed9b1485b5cdc200"><div class="ttname"><a href="classexperimental_1_1_a_database.html#a74280b96dbf58580ed9b1485b5cdc200">experimental::ADatabase::getIdMap</a></div><div class="ttdeci">const QMap&lt; QString, int &gt; getIdMap(ADatabaseTarget)</div><div class="ttdoc">returns a QMap&lt;QString, int&gt; of a human-readable database value and its row id. Used in the Dialogs t...</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:452</div></div>
  222. <div class="ttc" id="anamespaceexperimental_html_a4ae0b93d398c270c979a8eec17545b8a"><div class="ttname"><a href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a">experimental::ADatabaseTarget</a></div><div class="ttdeci">ADatabaseTarget</div><div class="ttdoc">The DBTarget enum provides the items for which QCompleter completion lists are provided from the data...</div><div class="ttdef"><b>Definition:</b> adatabase.h:45</div></div>
  223. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ada25b4b94ab41b5ec78925a0a52b14ca"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ada25b4b94ab41b5ec78925a0a52b14ca">experimental::ADatabase::update</a></div><div class="ttdeci">bool update(AEntry updated_entry)</div><div class="ttdoc">Updates entry in database from existing entry tweaked by the user.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:230</div></div>
  224. <div class="ttc" id="aclassexperimental_1_1_a_database_html_aee75f906918935027d95b3e5d8e1ff75"><div class="ttname"><a href="classexperimental_1_1_a_database.html#aee75f906918935027d95b3e5d8e1ff75">experimental::ADatabase::getAircraftEntry</a></div><div class="ttdeci">AAircraftEntry getAircraftEntry(RowId row_id)</div><div class="ttdoc">retreives a TailEntry from the database.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:390</div></div>
  225. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ae8fac5f877e2ab11eab07781ebcab4b1"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ae8fac5f877e2ab11eab07781ebcab4b1">experimental::ADatabase::getPilotEntry</a></div><div class="ttdeci">APilotEntry getPilotEntry(RowId row_id)</div><div class="ttdoc">retreives a PilotEntry from the database.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:376</div></div>
  226. <div class="ttc" id="aclassexperimental_1_1_a_flight_entry_html"><div class="ttname"><a href="classexperimental_1_1_a_flight_entry.html">experimental::AFlightEntry</a></div><div class="ttdef"><b>Definition:</b> aflightentry.h:9</div></div>
  227. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ae536aeb620c52f873f1f0943cfeb9db0"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ae536aeb620c52f873f1f0943cfeb9db0">experimental::ADatabase::customQuery</a></div><div class="ttdeci">QVector&lt; QString &gt; customQuery(QString statement, int return_values)</div><div class="ttdoc">Can be used to send a complex query to the database.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:564</div></div>
  228. <div class="ttc" id="astructexperimental_1_1_a_tail_entry_html"><div class="ttname"><a href="structexperimental_1_1_a_tail_entry.html">experimental::ATailEntry</a></div><div class="ttdef"><b>Definition:</b> atailentry.h:27</div></div>
  229. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ab4fe26545b5fd05fa6b63486f2d234e3"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ab4fe26545b5fd05fa6b63486f2d234e3">experimental::ADatabase::removeMany</a></div><div class="ttdeci">bool removeMany(QList&lt; DataPosition &gt;)</div><div class="ttdoc">deletes a list of entries from the database. Optimised for speed when deleting many entries.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:128</div></div>
  230. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ad05071058f2706dddd9c681d6946ef6d"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ad05071058f2706dddd9c681d6946ef6d">experimental::ADatabase::getTailEntry</a></div><div class="ttdeci">ATailEntry getTailEntry(RowId row_id)</div><div class="ttdoc">retreives a TailEntry from the database.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:383</div></div>
  231. <div class="ttc" id="aclassexperimental_1_1_a_database_html_a328fb63a110c9ada4af7ff2e4b240dfe"><div class="ttname"><a href="classexperimental_1_1_a_database.html#a328fb63a110c9ada4af7ff2e4b240dfe">experimental::ADatabase::insert</a></div><div class="ttdeci">bool insert(AEntry new_entry)</div><div class="ttdoc">Create new entry in the databse based on UserInput.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:266</div></div>
  232. <div class="ttc" id="aclassexperimental_1_1_a_database_html_a5a1d594fadb083e97aa8d50f736ab0ea"><div class="ttname"><a href="classexperimental_1_1_a_database.html#a5a1d594fadb083e97aa8d50f736ab0ea">experimental::ADatabase::database</a></div><div class="ttdeci">static QSqlDatabase database()</div><div class="ttdoc">Can be used to access the database connection.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:83</div></div>
  233. <div class="ttc" id="aclassexperimental_1_1_a_database_error_html"><div class="ttname"><a href="classexperimental_1_1_a_database_error.html">experimental::ADatabaseError</a></div><div class="ttdoc">Custom Database Error derived from QSqlError. Extends text() adding &quot;Database Error: &quot; before the tex...</div><div class="ttdef"><b>Definition:</b> adatabase.h:64</div></div>
  234. <div class="ttc" id="astructexperimental_1_1_a_aircraft_entry_html"><div class="ttname"><a href="structexperimental_1_1_a_aircraft_entry.html">experimental::AAircraftEntry</a></div><div class="ttdef"><b>Definition:</b> aaircraftentry.h:9</div></div>
  235. <div class="ttc" id="aclassexperimental_1_1_a_database_html_aaa6d9017e72693dd26a0ebd311dcef91"><div class="ttname"><a href="classexperimental_1_1_a_database.html#aaa6d9017e72693dd26a0ebd311dcef91">experimental::ADatabase::getForeignKeyConstraints</a></div><div class="ttdeci">QList&lt; int &gt; getForeignKeyConstraints(int foreign_row_id, ADatabaseTarget target)</div><div class="ttdoc">returns a list of ROWID's in the flights table for which foreign key constraints exist.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:527</div></div>
  236. <div class="ttc" id="aclassexperimental_1_1_a_database_html"><div class="ttname"><a href="classexperimental_1_1_a_database.html">experimental::ADatabase</a></div><div class="ttdoc">The DB class encapsulates the SQL database by providing fast access to hot database data.</div><div class="ttdef"><b>Definition:</b> adatabase.h:75</div></div>
  237. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ad3fc7756ef3f032d252b02ed6867e0a5"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ad3fc7756ef3f032d252b02ed6867e0a5">experimental::ADatabase::exists</a></div><div class="ttdeci">bool exists(AEntry entry)</div><div class="ttdoc">Checks if an entry exists in the database, based on position data.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:170</div></div>
  238. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ac613f3dd83524ef30dd6351e3b8a50f3"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ac613f3dd83524ef30dd6351e3b8a50f3">experimental::ADatabase::getFlightEntry</a></div><div class="ttdeci">AFlightEntry getFlightEntry(RowId row_id)</div><div class="ttdoc">retreives a flight entry from the database.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:397</div></div>
  239. <div class="ttc" id="aclassexperimental_1_1_a_database_html_aa45ad744482ae94d8f639e5837c9c221"><div class="ttname"><a href="classexperimental_1_1_a_database.html#aa45ad744482ae94d8f639e5837c9c221">experimental::ADatabase::connect</a></div><div class="ttdeci">bool connect()</div><div class="ttdoc">Connect to the database and populate database information.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:41</div></div>
  240. <div class="ttc" id="astructexperimental_1_1_a_pilot_entry_html"><div class="ttname"><a href="structexperimental_1_1_a_pilot_entry.html">experimental::APilotEntry</a></div><div class="ttdef"><b>Definition:</b> apilotentry.h:26</div></div>
  241. <div class="ttc" id="aclassexperimental_1_1_a_database_html_a391a945bf0bf3160045690319833edce"><div class="ttname"><a href="classexperimental_1_1_a_database.html#a391a945bf0bf3160045690319833edce">experimental::ADatabase::getLastEntry</a></div><div class="ttdeci">int getLastEntry(ADatabaseTarget)</div><div class="ttdoc">returns the ROWID for the newest entry in the respective database.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:499</div></div>
  242. <div class="ttc" id="anamespaceexperimental_html_a3f601400554a3aab738cab39bfa5cc7e"><div class="ttname"><a href="namespaceexperimental.html#a3f601400554a3aab738cab39bfa5cc7e">experimental::aDB</a></div><div class="ttdeci">ADatabase * aDB()</div><div class="ttdoc">Convinience function that returns instance of DataBase. Instead of this: DataBase::getInstance()....</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:590</div></div>
  243. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ae71340a7dc2668e9ae6e65117b16d1bd"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ae71340a7dc2668e9ae6e65117b16d1bd">experimental::ADatabase::getEntryData</a></div><div class="ttdeci">TableData getEntryData(DataPosition data_position)</div><div class="ttdoc">retreive entry data from the database to create an entry object</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:312</div></div>
  244. <div class="ttc" id="aclassexperimental_1_1_a_database_html_ad273efb62d7829e5cef4440d78b53161"><div class="ttname"><a href="classexperimental_1_1_a_database.html#ad273efb62d7829e5cef4440d78b53161">experimental::ADatabase::getEntry</a></div><div class="ttdeci">AEntry getEntry(DataPosition data_position)</div><div class="ttdoc">retreive an Entry from the database.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:369</div></div>
  245. <div class="ttc" id="aclassexperimental_1_1_a_database_html_a1e3fa80e9472325fa41f227319592b26"><div class="ttname"><a href="classexperimental_1_1_a_database.html#a1e3fa80e9472325fa41f227319592b26">experimental::ADatabase::getCompletionList</a></div><div class="ttdeci">const QStringList getCompletionList(ADatabaseTarget)</div><div class="ttdoc">getCompletionList returns a QStringList of values for a QCompleter based on database values</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:404</div></div>
  246. <div class="ttc" id="aclassexperimental_1_1_a_database_html_aeeb82d8057f36436fd793a242627668e"><div class="ttname"><a href="classexperimental_1_1_a_database.html#aeeb82d8057f36436fd793a242627668e">experimental::ADatabase::remove</a></div><div class="ttdeci">bool remove(AEntry entry)</div><div class="ttdoc">deletes an entry from the database.</div><div class="ttdef"><b>Definition:</b> adatabase.cpp:97</div></div>
  247. <!-- start footer part -->
  248. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  249. <ul>
  250. <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_4be88786e9e8558ded50c83b495719ca.html">experimental</a></li><li class="navelem"><b>adatabase.h</b></li>
  251. <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
  252. </ul>
  253. </div>
  254. </body>
  255. </html>