123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.20"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>openPilotLog: src/experimental/adatabase.h Source File</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="resize.js"></script>
- <script type="text/javascript" src="navtreedata.js"></script>
- <script type="text/javascript" src="navtree.js"></script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- <link href="custom_dark_theme.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">openPilotLog
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.20 -->
- <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>
- </div><!-- top -->
- <div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
- </div>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(function(){initNavTree('adatabase_8h_source.html',''); initResizable(); });
- /* @license-end */
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- <div class="header">
- <div class="headertitle">
- <div class="title">adatabase.h</div> </div>
- </div><!--header-->
- <div class="contents">
- <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
- <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> *openPilot Log - A FOSS Pilot Logbook Application</span></div>
- <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *Copyright (C) 2020 Felix Turowsky</span></div>
- <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div>
- <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *This program is free software: you can redistribute it and/or modify</span></div>
- <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> *it under the terms of the GNU General Public License as published by</span></div>
- <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *the Free Software Foundation, either version 3 of the License, or</span></div>
- <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *(at your option) any later version.</span></div>
- <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div>
- <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> *This program is distributed in the hope that it will be useful,</span></div>
- <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> *but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
- <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
- <div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> *GNU General Public License for more details.</span></div>
- <div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> *</span></div>
- <div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> *You should have received a copy of the GNU General Public License</span></div>
- <div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> *along with this program. If not, see <https://www.gnu.org/licenses/>.</span></div>
- <div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> */</span></div>
- <div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef __DB_H__</span></div>
- <div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#define __DB_H__</span></div>
- <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  </div>
- <div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <QPair></span></div>
- <div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <QMap></span></div>
- <div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include <QString></span></div>
- <div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <QSqlQuery></span></div>
- <div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <QSqlError></span></div>
- <div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <QSqlTableModel></span></div>
- <div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "src/database/dbinfo.h"</span></div>
- <div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "src/testing/adebug.h"</span></div>
- <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  </div>
- <div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "aentry.h"</span></div>
- <div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "apilotentry.h"</span></div>
- <div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include "atailentry.h"</span></div>
- <div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include "aaircraftentry.h"</span></div>
- <div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "aflightentry.h"</span></div>
- <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div>
- <div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">namespace </span><a class="code" href="namespaceexperimental.html">experimental</a> {</div>
- <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  </div>
- <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div>
- <div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// [G]: Suspicious documentation -,O</span></div>
- <div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a"> 44</a></span> <span class="comment"></span><span class="keyword">enum class</span> <a class="code" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a">ADatabaseTarget</a></div>
- <div class="line"><a name="l00045"></a><span class="lineno"> 45</span> {</div>
- <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  airport_identifier_icao,</div>
- <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  airport_identifier_iata,</div>
- <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  airport_identifier_all,</div>
- <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  airport_names,</div>
- <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  pilots,</div>
- <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  registrations,</div>
- <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  aircraft,</div>
- <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  companies,</div>
- <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  tails</div>
- <div class="line"><a name="l00055"></a><span class="lineno"> 55</span> };</div>
- <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  </div>
- <div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment">// [G]: This is how we should handle custom "events" in the program.</span></div>
- <div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment">// In this case a custom error doesnt need to be built from scratch.</span></div>
- <div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="comment">// Find the type of error you want and extend it with a few tweaks.</span></div>
- <div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classexperimental_1_1_a_database_error.html"> 64</a></span> <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>
- <div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">public</span>:</div>
- <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="classexperimental_1_1_a_database_error.html">ADatabaseError</a>() = <span class="keywordflow">default</span>;</div>
- <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="classexperimental_1_1_a_database_error.html">ADatabaseError</a>(QString msg);</div>
- <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  QString text() <span class="keyword">const</span>;</div>
- <div class="line"><a name="l00069"></a><span class="lineno"> 69</span> };</div>
- <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  </div>
- <div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classexperimental_1_1_a_database.html"> 75</a></span> <span class="keyword">class </span><a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a> : <span class="keyword">public</span> QObject {</div>
- <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  Q_OBJECT</div>
- <div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="keyword">private</span>:</div>
- <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  TableNames tableNames;</div>
- <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  TableColumns tableColumns;</div>
- <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keyword">static</span> <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>* instance;</div>
- <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>() = <span class="keywordflow">default</span>;</div>
- <div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">public</span>:</div>
- <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="comment">// Ensure DB is not copiable or assignable</span></div>
- <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <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>&) = <span class="keyword">delete</span>;</div>
- <div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>&) = <span class="keyword">delete</span>;</div>
- <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keyword">static</span> <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>* getInstance();</div>
- <div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="classexperimental_1_1_a_database_error.html">ADatabaseError</a> lastError;</div>
- <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  </div>
- <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#aa45ad744482ae94d8f639e5837c9c221">connect</a>();</div>
- <div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
- <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordtype">void</span> <a class="code" href="classexperimental_1_1_a_database.html#a5e331e329bc21980d3e2f63c7ca01559">disconnect</a>();</div>
- <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  </div>
- <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keyword">static</span> QSqlDatabase <a class="code" href="classexperimental_1_1_a_database.html#a5a1d594fadb083e97aa8d50f736ab0ea">database</a>();</div>
- <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  </div>
- <div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  QVector<QString> <a class="code" href="classexperimental_1_1_a_database.html#ae536aeb620c52f873f1f0943cfeb9db0">customQuery</a>(QString statement, <span class="keywordtype">int</span> return_values);</div>
- <div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  </div>
- <div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <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>
- <div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <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>
- <div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  </div>
- <div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <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>
- <div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  </div>
- <div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <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>
- <div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  </div>
- <div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <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>
- <div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  </div>
- <div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <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>
- <div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  </div>
- <div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keywordtype">bool</span> <a class="code" href="classexperimental_1_1_a_database.html#ab4fe26545b5fd05fa6b63486f2d234e3">removeMany</a>(QList<DataPosition>);</div>
- <div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  </div>
- <div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  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>
- <div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  </div>
- <div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <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>
- <div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  </div>
- <div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <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>
- <div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  </div>
- <div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <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>
- <div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  </div>
- <div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <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>
- <div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  </div>
- <div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <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>
- <div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  </div>
- <div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <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>
- <div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  </div>
- <div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keyword">const</span> QMap<QString, int> <a class="code" href="classexperimental_1_1_a_database.html#a74280b96dbf58580ed9b1485b5cdc200">getIdMap</a>(<a class="code" href="namespaceexperimental.html#a4ae0b93d398c270c979a8eec17545b8a">ADatabaseTarget</a>);</div>
- <div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  </div>
- <div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <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>
- <div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  </div>
- <div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  QList<int> <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>
- <div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  </div>
- <div class="line"><a name="l00218"></a><span class="lineno"> 218</span> signals:</div>
- <div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="classexperimental_1_1_a_database.html#a202981d0d39b5b3dbc88af65e17ed42a"> 225</a></span>  <span class="keywordtype">void</span> <a class="code" href="classexperimental_1_1_a_database.html#a202981d0d39b5b3dbc88af65e17ed42a">dataBaseUpdated</a>();</div>
- <div class="line"><a name="l00226"></a><span class="lineno"> 226</span> };</div>
- <div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  </div>
- <div class="line"><a name="l00235"></a><span class="lineno"> 235</span> <a class="code" href="classexperimental_1_1_a_database.html">ADatabase</a>* <a class="code" href="namespaceexperimental.html#a3f601400554a3aab738cab39bfa5cc7e">aDB</a>();</div>
- <div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  </div>
- <div class="line"><a name="l00237"></a><span class="lineno"> 237</span> } <span class="comment">// namespace experimental</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">#endif</span></div>
- </div><!-- fragment --></div><!-- contents -->
- </div><!-- doc-content -->
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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< QString, int > getIdMap(ADatabaseTarget)</div><div class="ttdoc">returns a QMap<QString, int> 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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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< QString > 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>
- <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>
- <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< DataPosition >)</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>
- <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>
- <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>
- <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>
- <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 "Database Error: " before the tex...</div><div class="ttdef"><b>Definition:</b> adatabase.h:64</div></div>
- <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>
- <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< int > 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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_4be88786e9e8558ded50c83b495719ca.html">experimental</a></li><li class="navelem"><b>adatabase.h</b></li>
- <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>
- </ul>
- </div>
- </body>
- </html>
|