Buffer for general purpose use. Templated for most datatypes

Dependents:   BufferedSoftSerial 09_PT1000 10_PT1000 11_PT1000 ... more

Example

 #include "mbed.h"
 #include "Buffer.h"

 Buffer <char> buf;

 int main()
 {
     buf = 'a';
     buf.put('b');
     char *head = buf.head();
     puts(head);

     char whats_in_there[2] = {0};
     int pos = 0;

     while(buf.available())
     {   
         whats_in_there[pos++] = buf;
     }
     printf("%c %c\n", whats_in_there[0], whats_in_there[1]);
     buf.clear();
     error("done\n\n\n");
 }

History

Update class name to MyBuffer to avoid conflicting names with a class in the mbed library default tip

2016-03-07, by sam_grove [Mon, 07 Mar 2016 21:10:13 +0000] rev 6

Update class name to MyBuffer to avoid conflicting names with a class in the mbed library


updates to the default buffer sizing

2015-01-07, by ansond [Wed, 07 Jan 2015 18:34:56 +0000] rev 5

updates to the default buffer sizing


merged

2013-06-26, by sam_grove [Wed, 26 Jun 2013 15:24:27 +0000] rev 4

merged


Allow any size of buffer

2013-06-26, by sam_grove [Wed, 26 Jun 2013 15:19:45 +0000] rev 3

Allow any size of buffer


Optimized the use of _size and created _sizemask instead. Faster during normal operation.

2013-05-23, by sam_grove [Thu, 23 May 2013 23:48:36 +0000] rev 2

Optimized the use of _size and created _sizemask instead. Faster during normal operation.


Added documentation

2013-05-23, by sam_grove [Thu, 23 May 2013 19:26:31 +0000] rev 1

Added documentation


First version - implements basic functionality and overloaded members

2013-05-10, by sam_grove [Fri, 10 May 2013 18:34:16 +0000] rev 0

First version - implements basic functionality and overloaded members