8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE reference |
10 <!DOCTYPE reference |
11 PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"> |
12 <reference id="GUID-0DEDC917-05C9-5D43-B839-73C043624BE9" xml:lang="en"><title> circularbuffer: |
12 <reference id="GUID-0DEDC917-05C9-5D43-B839-73C043624BE9" xml:lang="en"><title> circularbuffer: |
13 Circular Buffer Example</title><shortdesc>This example demonstrates the how to use the circular buffer classes <apiname>CCirBuf</apiname> and <apiname>CCirBuffer</apiname>. </shortdesc><prolog><metadata><keywords/></metadata></prolog><refbody> |
13 Circular Buffer Example</title><shortdesc>This example demonstrates the how to use the circular buffer classes <codeph>CCirBuf</codeph> and <codeph>CCirBuffer</codeph>. </shortdesc><prolog><metadata><keywords/></metadata></prolog><refbody> |
14 <section id="GUID-4AF25C42-D4E3-54AC-A493-F17995CF27A0"><title>Purpose</title> <p>This |
14 <section id="GUID-4AF25C42-D4E3-54AC-A493-F17995CF27A0"><title>Purpose</title> <p>This |
15 example application shows how to construct and make use of circular buffers |
15 example application shows how to construct and make use of circular buffers |
16 containing integers, objects of user defined classes and objects of an R class. </p> </section> |
16 containing integers, objects of user defined classes and objects of an R class. </p> </section> |
17 <section><title>Download</title> <p>Click on the following link to download |
17 <section id="GUID-DC849488-96A4-41A7-A088-4F4CC406F68B"><title>Download</title> <p>Click on the following link to download |
18 the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-07c0d4d4-3e5e-4329-a0c5-e569e89d3a9e.zip" scope="external">circularbuffer .zip</xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-07c0d4d4-3e5e-4329-a0c5-e569e89d3a9e.html" scope="peer"> browse </xref> to view the example code.</p> </section> |
18 the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-07c0d4d4-3e5e-4329-a0c5-e569e89d3a9e.zip" scope="external">circularbuffer .zip</xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-07c0d4d4-3e5e-4329-a0c5-e569e89d3a9e.html" scope="peer"> browse </xref> to view the example code.</p> </section> |
19 <section><title>class summary</title><p><xref href="GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623.dita"><apiname>CCirBuffer </apiname></xref> <xref href="GUID-1D73835F-4361-3216-8EFC-669364E3F5E7.dita"><apiname>CCirBuf</apiname></xref> </p></section> |
19 <section id="GUID-014CB2CC-94DC-4DF5-AA93-9157B756C915"><title>class summary</title><p><xref href="GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623.dita"><apiname>CCirBuffer </apiname></xref> <xref href="GUID-1D73835F-4361-3216-8EFC-669364E3F5E7.dita"><apiname>CCirBuf</apiname></xref> </p></section> |
20 <section id="GUID-2B02964A-812A-5838-9A6F-64E4C8D069EF"><title>Design and |
20 <section id="GUID-2B02964A-812A-5838-9A6F-64E4C8D069EF"><title>Design and |
21 implementation</title> <p>Class diagram: </p> <fig id="GUID-1424998B-6CBC-5CEF-9A2D-4DBB286F409B"> |
21 implementation</title> <p>Class diagram: </p> <fig id="GUID-1424998B-6CBC-5CEF-9A2D-4DBB286F409B"> |
22 <title> Circular buffers example class diagram </title> |
22 <title> Circular buffers example class diagram </title> |
23 <image href="GUID-1BDBFC07-A8E8-5150-953D-CA9CFE1CBF16_d0e341368_href.jpg" placement="inline"/> |
23 <image href="GUID-1BDBFC07-A8E8-5150-953D-CA9CFE1CBF16_d0e362824_href.jpg" placement="inline"/> |
24 </fig> <p>The example creates a circular buffer of integers using <xref href="GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623.dita#GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623/GUID-600BE94B-72FF-3A44-92EC-3806B7F5E4E5"><apiname>CCirBuffer::Put()</apiname></xref> to |
24 </fig> <p>The example creates a circular buffer of integers using <xref href="GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623.dita#GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623/GUID-600BE94B-72FF-3A44-92EC-3806B7F5E4E5"><apiname>CCirBuffer::Put()</apiname></xref> to |
25 add elements and <xref href="GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623.dita#GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623/GUID-112CD6F9-DAB4-30E5-9E5C-B636F8AEEC08"><apiname>CCirBuffer::Get()</apiname></xref> to remove an element. |
25 add elements and <xref href="GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623.dita#GUID-620EC30F-933F-3073-9E5F-CAC9F2BA4623/GUID-112CD6F9-DAB4-30E5-9E5C-B636F8AEEC08"><apiname>CCirBuffer::Get()</apiname></xref> to remove an element. |
26 To demonstrate the circular nature of the buffer, the example: </p> <ul> |
26 To demonstrate the circular nature of the buffer, the example: </p> <ul> |
27 <li id="GUID-950580F8-9810-5172-95AD-7B3C2B933818"><p>adds four elements until |
27 <li id="GUID-950580F8-9810-5172-95AD-7B3C2B933818"><p>adds four elements until |
28 the buffer is full, </p> </li> |
28 the buffer is full, </p> </li> |