-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathField_8h_source.html
287 lines (285 loc) · 35.7 KB
/
Field_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!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" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>COMMS: include/comms/Field.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">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">COMMS
</div>
<div id="projectbrief">Template library intended to help with implementation of communication protocols.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_b3b90260015bf389bbf56758f180cfb9.html">comms</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">Field.h</div></div>
</div><!--header-->
<div class="contents">
<a href="Field_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">//</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// Copyright 2014 - 2025 (C). Alex Robenko. All rights reserved.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">//</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// This Source Code Form is subject to the terms of the Mozilla Public</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// License, v. 2.0. If a copy of the MPL was not distributed with this</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// file, You can obtain one at http://mozilla.org/MPL/2.0/.</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <type_traits></span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include "<a class="code" href="access_8h.html">comms/util/access.h</a>"</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include "comms/details/FieldBase.h"</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include "comms/details/macro_common.h"</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include "comms/details/fields_access.h"</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include "comms/details/field_alias.h"</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacecomms.html">comms</a></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span>{</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">template</span> <<span class="keyword">typename</span>... TOptions></div>
<div class="foldopen" id="foldopen00032" data-start="{" data-end="};">
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html"> 32</a></span><span class="keyword">class </span><a class="code hl_class" href="classcomms_1_1Field.html">Field</a> : <span class="keyword">public</span> details::FieldBase<TOptions...></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span>{</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">using </span>BaseImpl = details::FieldBase<TOptions...>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a7e575b5b6193d2b8cf59517f0d336d6b"> 39</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classcomms_1_1Field.html#a7e575b5b6193d2b8cf59517f0d336d6b">Endian</a> = <span class="keyword">typename</span> BaseImpl::Endian;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a88a89ed629a73bbb6c64e3c46fb45332"> 42</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="classcomms_1_1Field.html#a88a89ed629a73bbb6c64e3c46fb45332">VersionType</a> = <span class="keyword">typename</span> BaseImpl::VersionType;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#abbc7d5f9c7a7167869590974d46edf5d"> 47</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#abbc7d5f9c7a7167869590974d46edf5d">valid</a>()</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
<div class="foldopen" id="foldopen00056" data-start="{" data-end="}">
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a4c92b4e31d20b3f67d95153dcf27f560"> 56</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#a4c92b4e31d20b3f67d95153dcf27f560">refresh</a>()</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> {</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> }</div>
</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="foldopen" id="foldopen00063" data-start="{" data-end="}">
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a33600b9f2dac980cd333d77301f49fa8"> 63</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#a33600b9f2dac980cd333d77301f49fa8">isVersionDependent</a>()</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
<div class="foldopen" id="foldopen00070" data-start="{" data-end="}">
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a8aa53d7554e6a293634b40d38f3e2217"> 70</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#a8aa53d7554e6a293634b40d38f3e2217">hasNonDefaultRefresh</a>()</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> {</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> }</div>
</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div>
<div class="foldopen" id="foldopen00077" data-start="{" data-end="}">
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a6acb8fb7f1983a8da5294a177a148e3f"> 77</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#a6acb8fb7f1983a8da5294a177a148e3f">hasReadNoStatus</a>()</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> }</div>
</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
<div class="foldopen" id="foldopen00084" data-start="{" data-end="}">
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a8b60b0387dcea372a7397b21bd0971de"> 84</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#a8b60b0387dcea372a7397b21bd0971de">hasWriteNoStatus</a>()</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> }</div>
</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="foldopen" id="foldopen00092" data-start="{" data-end="}">
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#acff46470efbd63ba545801326e6b7f76"> 92</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#acff46470efbd63ba545801326e6b7f76">hasVarLength</a>()</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> } </div>
</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
<div class="foldopen" id="foldopen00100" data-start="{" data-end="}">
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a07c7bd49761eeb71e159d49818cd09f0"> 100</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#a07c7bd49761eeb71e159d49818cd09f0">canWrite</a>()</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
<div class="foldopen" id="foldopen00109" data-start="{" data-end="}">
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a1e8ecf2525c7904247fe288e441685d1"> 109</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#a1e8ecf2525c7904247fe288e441685d1">setVersion</a>(<a class="code hl_typedef" href="classcomms_1_1Field.html#a88a89ed629a73bbb6c64e3c46fb45332">VersionType</a>)</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> }</div>
</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
<div class="foldopen" id="foldopen00116" data-start="{" data-end="}">
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#afc8d8b1d7287505cc0fdd7475dfd5d5f"> 116</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classcomms_1_1Field.html#afc8d8b1d7287505cc0fdd7475dfd5d5f">hasName</a>()</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> } </div>
</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="keyword">protected</span>:</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> TIter></div>
<div class="foldopen" id="foldopen00135" data-start="{" data-end="}">
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a0bd63c4d88caa3e2c7ec36810f4ef480"> 135</a></span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcomms_1_1Field.html#a0bd63c4d88caa3e2c7ec36810f4ef480">writeData</a>(T value, TIter& iter)</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> {</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> writeData<sizeof(T), T>(value, iter);</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keyword">template</span> <std::<span class="keywordtype">size_t</span> TSize, <span class="keyword">typename</span> T, <span class="keyword">typename</span> TIter></div>
<div class="foldopen" id="foldopen00155" data-start="{" data-end="}">
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#aa03f444fd95e5ab123f8cdadd5f0a24a"> 155</a></span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcomms_1_1Field.html#aa03f444fd95e5ab123f8cdadd5f0a24a">writeData</a>(T value, TIter& iter)</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> {</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keyword">static_assert</span>(TSize <= <span class="keyword">sizeof</span>(T),</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="stringliteral">"Cannot put more bytes than type contains"</span>);</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">return</span> util::writeData<TSize, T>(value, iter, <a class="code hl_typedef" href="classcomms_1_1Field.html#a7e575b5b6193d2b8cf59517f0d336d6b">Endian</a>());</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> }</div>
</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> TIter></div>
<div class="foldopen" id="foldopen00176" data-start="{" data-end="}">
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#a625b2614fc28507e11476c4dfa168cf8"> 176</a></span> <span class="keyword">static</span> T <a class="code hl_function" href="classcomms_1_1Field.html#a625b2614fc28507e11476c4dfa168cf8">readData</a>(TIter& iter)</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> {</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keywordflow">return</span> readData<T, sizeof(T)>(iter);</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> }</div>
</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, std::<span class="keywordtype">size_t</span> TSize, <span class="keyword">typename</span> TIter></div>
<div class="foldopen" id="foldopen00196" data-start="{" data-end="}">
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"><a class="line" href="classcomms_1_1Field.html#aa2fc07d0015fc88421311ac8c1a55868"> 196</a></span> <span class="keyword">static</span> T <a class="code hl_function" href="classcomms_1_1Field.html#aa2fc07d0015fc88421311ac8c1a55868">readData</a>(TIter& iter)</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> {</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="keyword">static_assert</span>(TSize <= <span class="keyword">sizeof</span>(T),</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="stringliteral">"Cannot get more bytes than type contains"</span>);</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">return</span> util::readData<T, TSize>(iter, <a class="code hl_typedef" href="classcomms_1_1Field.html#a7e575b5b6193d2b8cf59517f0d336d6b">Endian</a>());</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> }</div>
</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> </div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span>};</div>
</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> </div>
<div class="foldopen" id="foldopen00243" data-start="" data-end="">
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"><a class="line" href="Field_8h.html#a96226a2c000a3145a48ce074b6a7f847"> 243</a></span><span class="preprocessor">#define COMMS_FIELD_MEMBERS_ACCESS(...) \</span></div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span><span class="preprocessor"> COMMS_EXPAND(COMMS_DEFINE_FIELD_ENUM(__VA_ARGS__)) \</span></div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span><span class="preprocessor"> COMMS_FIELD_VALUE_ACCESS_FUNC { \</span></div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span><span class="preprocessor"> auto& val = comms::field::toFieldBase(*this).value(); \</span></div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span><span class="preprocessor"> using AllFieldsTuple = typename std::decay<decltype(val)>::type; \</span></div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span><span class="preprocessor"> static_assert(std::tuple_size<AllFieldsTuple>::value == FieldIdx_numOfValues, \</span></div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span><span class="preprocessor"> "Invalid number of names for fields tuple"); \</span></div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span><span class="preprocessor"> return val; \</span></div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span><span class="preprocessor"> COMMS_FIELD_VALUE_ACCESS_CONST_FUNC { \</span></div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span><span class="preprocessor"> auto& val = comms::field::toFieldBase(*this).value(); \</span></div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span><span class="preprocessor"> using AllFieldsTuple = typename std::decay<decltype(val)>::type; \</span></div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span><span class="preprocessor"> static_assert(std::tuple_size<AllFieldsTuple>::value == FieldIdx_numOfValues, \</span></div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span><span class="preprocessor"> "Invalid number of names for fields tuple"); \</span></div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span><span class="preprocessor"> return val; \</span></div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span><span class="preprocessor"> COMMS_EXPAND(COMMS_DO_FIELD_ACC_FUNC(ValueType, value(), __VA_ARGS__))</span></div>
</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> </div>
<div class="foldopen" id="foldopen00273" data-start="" data-end="">
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"><a class="line" href="Field_8h.html#a83dcd24efc7be6d3a95eadfb259a6b33"> 273</a></span><span class="preprocessor">#define COMMS_FIELD_MEMBERS_ACCESS_NOTEMPLATE(...) \</span></div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span><span class="preprocessor"> COMMS_EXPAND(COMMS_DEFINE_FIELD_ENUM(__VA_ARGS__)) \</span></div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span><span class="preprocessor"> COMMS_EXPAND(COMMS_DO_FIELD_ACC_FUNC_NOTEMPLATE(__VA_ARGS__))</span></div>
</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> </div>
<div class="foldopen" id="foldopen00387" data-start="" data-end="">
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno"><a class="line" href="Field_8h.html#af74198f06b52d3f58c92e795b2ff7129"> 387</a></span><span class="preprocessor">#define COMMS_FIELD_MEMBERS_NAMES(...) \</span></div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno"> 388</span><span class="preprocessor"> COMMS_EXPAND(COMMS_FIELD_MEMBERS_ACCESS(__VA_ARGS__)) \</span></div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"> 389</span><span class="preprocessor"> COMMS_EXPAND(COMMS_DO_FIELD_TYPEDEF(typename Base::ValueType, Field_, FieldIdx_, __VA_ARGS__))</span></div>
</div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> </div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"><a class="line" href="Field_8h.html#a7adc16bdcc59b3f0a646c106816c9cab"> 397</a></span><span class="preprocessor">#define COMMS_FIELD_ALIAS(f_, ...) COMMS_DO_ALIAS(field_, f_, __VA_ARGS__)</span></div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> </div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span>} <span class="comment">// namespace comms</span></div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"> 400</span> </div>
<div class="ttc" id="aaccess_8h_html"><div class="ttname"><a href="access_8h.html">access.h</a></div><div class="ttdoc">Contains functions for raw data access / (de)serialization.</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html"><div class="ttname"><a href="classcomms_1_1Field.html">comms::Field</a></div><div class="ttdoc">Base class to all the field classes.</div><div class="ttdef"><b>Definition</b> Field.h:33</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a07c7bd49761eeb71e159d49818cd09f0"><div class="ttname"><a href="classcomms_1_1Field.html#a07c7bd49761eeb71e159d49818cd09f0">comms::Field::canWrite</a></div><div class="ttdeci">static constexpr bool canWrite()</div><div class="ttdoc">Default check of whether the field has a consistent value for writing.</div><div class="ttdef"><b>Definition</b> Field.h:100</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a0bd63c4d88caa3e2c7ec36810f4ef480"><div class="ttname"><a href="classcomms_1_1Field.html#a0bd63c4d88caa3e2c7ec36810f4ef480">comms::Field::writeData</a></div><div class="ttdeci">static void writeData(T value, TIter &iter)</div><div class="ttdoc">Write data into the output buffer.</div><div class="ttdef"><b>Definition</b> Field.h:135</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a1e8ecf2525c7904247fe288e441685d1"><div class="ttname"><a href="classcomms_1_1Field.html#a1e8ecf2525c7904247fe288e441685d1">comms::Field::setVersion</a></div><div class="ttdeci">static constexpr bool setVersion(VersionType)</div><div class="ttdoc">Default version update functionality.</div><div class="ttdef"><b>Definition</b> Field.h:109</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a33600b9f2dac980cd333d77301f49fa8"><div class="ttname"><a href="classcomms_1_1Field.html#a33600b9f2dac980cd333d77301f49fa8">comms::Field::isVersionDependent</a></div><div class="ttdeci">static constexpr bool isVersionDependent()</div><div class="ttdoc">Default check of whether the field is version dependent.</div><div class="ttdef"><b>Definition</b> Field.h:63</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a4c92b4e31d20b3f67d95153dcf27f560"><div class="ttname"><a href="classcomms_1_1Field.html#a4c92b4e31d20b3f67d95153dcf27f560">comms::Field::refresh</a></div><div class="ttdeci">static constexpr bool refresh()</div><div class="ttdoc">Default refresh functionality.</div><div class="ttdef"><b>Definition</b> Field.h:56</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a625b2614fc28507e11476c4dfa168cf8"><div class="ttname"><a href="classcomms_1_1Field.html#a625b2614fc28507e11476c4dfa168cf8">comms::Field::readData</a></div><div class="ttdeci">static T readData(TIter &iter)</div><div class="ttdoc">Read data from input buffer.</div><div class="ttdef"><b>Definition</b> Field.h:176</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a6acb8fb7f1983a8da5294a177a148e3f"><div class="ttname"><a href="classcomms_1_1Field.html#a6acb8fb7f1983a8da5294a177a148e3f">comms::Field::hasReadNoStatus</a></div><div class="ttdeci">static constexpr bool hasReadNoStatus()</div><div class="ttdoc">Default check of whether the field has readNoStatus() member function.</div><div class="ttdef"><b>Definition</b> Field.h:77</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a7e575b5b6193d2b8cf59517f0d336d6b"><div class="ttname"><a href="classcomms_1_1Field.html#a7e575b5b6193d2b8cf59517f0d336d6b">comms::Field::Endian</a></div><div class="ttdeci">typename BaseImpl::Endian Endian</div><div class="ttdoc">Endian type.</div><div class="ttdef"><b>Definition</b> Field.h:39</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a88a89ed629a73bbb6c64e3c46fb45332"><div class="ttname"><a href="classcomms_1_1Field.html#a88a89ed629a73bbb6c64e3c46fb45332">comms::Field::VersionType</a></div><div class="ttdeci">typename BaseImpl::VersionType VersionType</div><div class="ttdoc">Version type.</div><div class="ttdef"><b>Definition</b> Field.h:42</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a8aa53d7554e6a293634b40d38f3e2217"><div class="ttname"><a href="classcomms_1_1Field.html#a8aa53d7554e6a293634b40d38f3e2217">comms::Field::hasNonDefaultRefresh</a></div><div class="ttdeci">static constexpr bool hasNonDefaultRefresh()</div><div class="ttdoc">Default check of whether the field has defines refresh functionality.</div><div class="ttdef"><b>Definition</b> Field.h:70</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_a8b60b0387dcea372a7397b21bd0971de"><div class="ttname"><a href="classcomms_1_1Field.html#a8b60b0387dcea372a7397b21bd0971de">comms::Field::hasWriteNoStatus</a></div><div class="ttdeci">static constexpr bool hasWriteNoStatus()</div><div class="ttdoc">Default check of whether the field has writeNoStatus() member function.</div><div class="ttdef"><b>Definition</b> Field.h:84</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_aa03f444fd95e5ab123f8cdadd5f0a24a"><div class="ttname"><a href="classcomms_1_1Field.html#aa03f444fd95e5ab123f8cdadd5f0a24a">comms::Field::writeData</a></div><div class="ttdeci">static void writeData(T value, TIter &iter)</div><div class="ttdoc">Write partial data into the output buffer.</div><div class="ttdef"><b>Definition</b> Field.h:155</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_aa2fc07d0015fc88421311ac8c1a55868"><div class="ttname"><a href="classcomms_1_1Field.html#aa2fc07d0015fc88421311ac8c1a55868">comms::Field::readData</a></div><div class="ttdeci">static T readData(TIter &iter)</div><div class="ttdoc">Read partial data from input buffer.</div><div class="ttdef"><b>Definition</b> Field.h:196</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_abbc7d5f9c7a7167869590974d46edf5d"><div class="ttname"><a href="classcomms_1_1Field.html#abbc7d5f9c7a7167869590974d46edf5d">comms::Field::valid</a></div><div class="ttdeci">static constexpr bool valid()</div><div class="ttdoc">Default validity check.</div><div class="ttdef"><b>Definition</b> Field.h:47</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_acff46470efbd63ba545801326e6b7f76"><div class="ttname"><a href="classcomms_1_1Field.html#acff46470efbd63ba545801326e6b7f76">comms::Field::hasVarLength</a></div><div class="ttdeci">static constexpr bool hasVarLength()</div><div class="ttdoc">Default check of whether the field has variable length definition via comms::option::def::VarLength o...</div><div class="ttdef"><b>Definition</b> Field.h:92</div></div>
<div class="ttc" id="aclasscomms_1_1Field_html_afc8d8b1d7287505cc0fdd7475dfd5d5f"><div class="ttname"><a href="classcomms_1_1Field.html#afc8d8b1d7287505cc0fdd7475dfd5d5f">comms::Field::hasName</a></div><div class="ttdeci">static constexpr bool hasName()</div><div class="ttdoc">Check of whether the field class defines name() function.</div><div class="ttdef"><b>Definition</b> Field.h:116</div></div>
<div class="ttc" id="anamespacecomms_html"><div class="ttname"><a href="namespacecomms.html">comms</a></div><div class="ttdoc">Main namespace for all classes / functions of COMMS library.</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>