-
Notifications
You must be signed in to change notification settings - Fork 0
/
CBUF_8h.html
436 lines (396 loc) · 22.2 KB
/
CBUF_8h.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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<!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.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Appiko: /home/prathik/workspace/appiko/nrf5x-firmware/codebase/util/CBUF.h File Reference</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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Appiko
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_55036300ef91cc8e272dad7bffa86910.html">codebase</a></li><li class="navelem"><a class="el" href="dir_c7d238809e409be7775f1243dc10a8f3.html">util</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> </div>
<div class="headertitle">
<div class="title">CBUF.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This file contains global definitions for circular buffer manipulation.
<a href="#details">More...</a></p>
<p><a href="CBUF_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a01162d0b1861b0c80097676b6f283bef"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a01162d0b1861b0c80097676b6f283bef">CBUF_H</a></td></tr>
<tr class="separator:a01162d0b1861b0c80097676b6f283bef"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a417ec47b08d169767ad67e6053712b58"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a417ec47b08d169767ad67e6053712b58">CBUF_Init</a>(cbuf)   cbuf.m_getIdx = cbuf.m_putIdx = 0</td></tr>
<tr class="separator:a417ec47b08d169767ad67e6053712b58"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a14b3d7264a17a274c0cf93c2214ffff8"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a14b3d7264a17a274c0cf93c2214ffff8">CBUF_Len</a>(cbuf)   ((typeof( cbuf.m_putIdx ))(( cbuf.m_putIdx ) - ( cbuf.m_getIdx )))</td></tr>
<tr class="separator:a14b3d7264a17a274c0cf93c2214ffff8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af8dc32e432e751175292d3bab7ed91b2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#af8dc32e432e751175292d3bab7ed91b2">CBUF_Push</a>(cbuf, elem)   (cbuf.m_entry)[ cbuf.m_putIdx++ & (( cbuf##_SIZE ) - 1 )] = (elem)</td></tr>
<tr class="separator:af8dc32e432e751175292d3bab7ed91b2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afe3672eecf4b83980759648f2b2f2f93"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#afe3672eecf4b83980759648f2b2f2f93">CBUF_Pop</a>(cbuf)   (cbuf.m_entry)[ cbuf.m_getIdx++ & (( cbuf##_SIZE ) - 1 )]</td></tr>
<tr class="separator:afe3672eecf4b83980759648f2b2f2f93"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4496290c9c5c69f8688d6f6c120e5d47"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a4496290c9c5c69f8688d6f6c120e5d47">CBUF_Get</a>(cbuf, idx)   (cbuf.m_entry)[( cbuf.m_getIdx + idx ) & (( cbuf##_SIZE ) - 1 )]</td></tr>
<tr class="separator:a4496290c9c5c69f8688d6f6c120e5d47"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a99f25054ac9eee1b3bcfa87914c0461d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a99f25054ac9eee1b3bcfa87914c0461d">CBUF_GetEnd</a>(cbuf, idx)   (cbuf.m_entry)[( cbuf.m_putIdx - idx - 1 ) & (( cbuf##_SIZE ) - 1 )]</td></tr>
<tr class="separator:a99f25054ac9eee1b3bcfa87914c0461d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8d7830eaee46cb9027c56e9f94cf6e78"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a8d7830eaee46cb9027c56e9f94cf6e78">CBUF_IsEmpty</a>(cbuf)   ( <a class="el" href="CBUF_8h.html#a14b3d7264a17a274c0cf93c2214ffff8">CBUF_Len</a>( cbuf ) == 0 )</td></tr>
<tr class="separator:a8d7830eaee46cb9027c56e9f94cf6e78"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0e9aa8ed1d291b0c36bf2bcbc0e8bb7b"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a0e9aa8ed1d291b0c36bf2bcbc0e8bb7b">CBUF_IsFull</a>(cbuf)   ( <a class="el" href="CBUF_8h.html#a14b3d7264a17a274c0cf93c2214ffff8">CBUF_Len</a>( cbuf ) == ( cbuf##_SIZE ))</td></tr>
<tr class="separator:a0e9aa8ed1d291b0c36bf2bcbc0e8bb7b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a56598579a1c63e3071fb71208cb525c5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a56598579a1c63e3071fb71208cb525c5">CBUF_Error</a>(cbuf)   ( <a class="el" href="CBUF_8h.html#a14b3d7264a17a274c0cf93c2214ffff8">CBUF_Len</a>( cbuf ) > cbuf##_SIZE )</td></tr>
<tr class="separator:a56598579a1c63e3071fb71208cb525c5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a45f45415a1204cd7b4315c5b36add574"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a45f45415a1204cd7b4315c5b36add574">CBUF_GetPtr</a>(cbuf, idx)   ((typeof( &cbuf.m_entry[0]))( cbuf.m_entry + (( cbuf.m_getIdx + idx ) & (( cbuf##_SIZE ) - 1 ))))</td></tr>
<tr class="separator:a45f45415a1204cd7b4315c5b36add574"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a03f8c721425ffa8b3ce1c3cc13907ba4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="CBUF_8h.html#a03f8c721425ffa8b3ce1c3cc13907ba4">CBUF_Remove</a>(cbuf, idx)   ({cbuf.m_getIdx += ( idx );})</td></tr>
<tr class="separator:a03f8c721425ffa8b3ce1c3cc13907ba4"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>These macros implement a circular buffer which employs get and put pointers, in such a way that mutual exclusion is not required (assumes one reader & one writer).</p>
<p>It requires that the circular buffer size be a power of two, and the size of the buffer needs to smaller than the index. So an 8 bit index supports a circular buffer upto ( 1 << 7 ) = 128 entries, and a 16 bit index supports a circular buffer upto ( 1 << 15 ) = 32768 entries.</p>
<p>The basis for these routines came from an article in Jack Ganssle's Embedded Muse: <a href="http://www.ganssle.com/tem/tem110.pdf">http://www.ganssle.com/tem/tem110.pdf</a></p>
<p>In order to offer the most amount of flexibility for embedded environments you need to define a macro for the size.</p>
<p>First, you need to name your circular buffer. For this example, we'll call it myQ.</p>
<p>The size macro that needs to be defined will be the name of the circular buffer followed by _SIZE. The size must be a power of two and it needs to fit in the get/put indicies. i.e. if you use an 8 bit index, then the maximum supported size would be 128.</p>
<p>The structure which defines the circular buffer needs to have 3 members m_getIdx, m_putIdx, and m_entry.</p>
<p>m_getIdx and m_putIdx need to be unsigned integers of the same size.</p>
<p>m_entry needs to be an array of xxx_SIZE entries, or a pointer to an array of xxx_SIZE entries. The type of each entry is entirely up to the caller.</p>
<p>#define myQ_SIZE 64</p>
<p>volatile struct { uint8_t m_getIdx; uint8_t m_putIdx; uint8_t m_entry[ myQ_SIZE ];</p>
<p>} myQ;</p>
<p>You could then use </p><pre class="fragment">CBUF_Push( myQ, 'x' );
</pre><p>to add a character to the circular buffer, or </p><pre class="fragment">ch = CBUF_Pop( myQ );
</pre><p>to retrieve an element from the buffer.</p>
<p>If you happen to prefer to use C++ instead, there is a templatized version which requires no macros. You just declare 3 template parameters: </p><pre class="fragment">- The type that should be used for the index
- The size of the circular buffer
- The type that should be used for the entry
</pre><p>For example: </p><pre class="fragment">CBUF< uint8_t, 64, char > myQ;
</pre>
<p class="definition">Definition in file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a56598579a1c63e3071fb71208cb525c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56598579a1c63e3071fb71208cb525c5">◆ </a></span>CBUF_Error</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_Error</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf</td><td>)</td>
<td>   ( <a class="el" href="CBUF_8h.html#a14b3d7264a17a274c0cf93c2214ffff8">CBUF_Len</a>( cbuf ) > cbuf##_SIZE )</td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines if the circular buffer is currently overflowed or underflowed. </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00139">139</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a4496290c9c5c69f8688d6f6c120e5d47"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4496290c9c5c69f8688d6f6c120e5d47">◆ </a></span>CBUF_Get</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_Get</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">idx </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>   (cbuf.m_entry)[( cbuf.m_getIdx + idx ) & (( cbuf##_SIZE ) - 1 )]</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the i'th element from the beginning of the circular buffer </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00115">115</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a99f25054ac9eee1b3bcfa87914c0461d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a99f25054ac9eee1b3bcfa87914c0461d">◆ </a></span>CBUF_GetEnd</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_GetEnd</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">idx </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>   (cbuf.m_entry)[( cbuf.m_putIdx - idx - 1 ) & (( cbuf##_SIZE ) - 1 )]</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the i'th element from the end of the circular buffer </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00121">121</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a45f45415a1204cd7b4315c5b36add574"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a45f45415a1204cd7b4315c5b36add574">◆ </a></span>CBUF_GetPtr</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_GetPtr</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">idx </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>   ((typeof( &cbuf.m_entry[0]))( cbuf.m_entry + (( cbuf.m_getIdx + idx ) & (( cbuf##_SIZE ) - 1 ))))</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the pointer element to be popped incremented by an offset </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00145">145</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a01162d0b1861b0c80097676b6f283bef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01162d0b1861b0c80097676b6f283bef">◆ </a></span>CBUF_H</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_H</td>
</tr>
</table>
</div><div class="memdoc">
<p>Include Guard </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00080">80</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a417ec47b08d169767ad67e6053712b58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a417ec47b08d169767ad67e6053712b58">◆ </a></span>CBUF_Init</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_Init</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf</td><td>)</td>
<td>   cbuf.m_getIdx = cbuf.m_putIdx = 0</td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes the circular buffer for use. </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00090">90</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a8d7830eaee46cb9027c56e9f94cf6e78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d7830eaee46cb9027c56e9f94cf6e78">◆ </a></span>CBUF_IsEmpty</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_IsEmpty</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf</td><td>)</td>
<td>   ( <a class="el" href="CBUF_8h.html#a14b3d7264a17a274c0cf93c2214ffff8">CBUF_Len</a>( cbuf ) == 0 )</td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines if the circular buffer is empty </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00127">127</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a0e9aa8ed1d291b0c36bf2bcbc0e8bb7b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e9aa8ed1d291b0c36bf2bcbc0e8bb7b">◆ </a></span>CBUF_IsFull</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_IsFull</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf</td><td>)</td>
<td>   ( <a class="el" href="CBUF_8h.html#a14b3d7264a17a274c0cf93c2214ffff8">CBUF_Len</a>( cbuf ) == ( cbuf##_SIZE ))</td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines if the circular buffer is full. </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00133">133</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a14b3d7264a17a274c0cf93c2214ffff8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14b3d7264a17a274c0cf93c2214ffff8">◆ </a></span>CBUF_Len</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_Len</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf</td><td>)</td>
<td>   ((typeof( cbuf.m_putIdx ))(( cbuf.m_putIdx ) - ( cbuf.m_getIdx )))</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the number of elements which are currently contained in the circular buffer. </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00097">97</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="afe3672eecf4b83980759648f2b2f2f93"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe3672eecf4b83980759648f2b2f2f93">◆ </a></span>CBUF_Pop</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_Pop</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf</td><td>)</td>
<td>   (cbuf.m_entry)[ cbuf.m_getIdx++ & (( cbuf##_SIZE ) - 1 )]</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves an element from the beginning of the circular buffer </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00109">109</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="af8dc32e432e751175292d3bab7ed91b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8dc32e432e751175292d3bab7ed91b2">◆ </a></span>CBUF_Push</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_Push</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">elem </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>   (cbuf.m_entry)[ cbuf.m_putIdx++ & (( cbuf##_SIZE ) - 1 )] = (elem)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Appends an element to the end of the circular buffer </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00103">103</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
<a id="a03f8c721425ffa8b3ce1c3cc13907ba4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03f8c721425ffa8b3ce1c3cc13907ba4">◆ </a></span>CBUF_Remove</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CBUF_Remove</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">cbuf, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">idx </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>   ({cbuf.m_getIdx += ( idx );})</td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes (like popping) a specified number of elements from the buffer </p>
<p class="definition">Definition at line <a class="el" href="CBUF_8h_source.html#l00151">151</a> of file <a class="el" href="CBUF_8h_source.html">CBUF.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>