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"); }
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
6:89564915f2a7 | 2016-03-07 | sam_grove | Update class name to MyBuffer to avoid conflicting names with a class in the mbed library |
5:7b754354b99c | 2015-01-07 | ansond | updates to the default buffer sizing |
4:cd0a1f4c623f | 2013-06-26 | sam_grove | merged |
3:c2de0ddfe65b | 2013-06-26 | sam_grove | Allow any size of buffer |
2:d13a72146516 | 2013-05-23 | sam_grove | Optimized the use of _size and created _sizemask instead. Faster during normal operation. |
1:490224f41c09 | 2013-05-23 | sam_grove | Added documentation |
0:5e4bca1bd5f7 | 2013-05-10 | sam_grove | First version - implements basic functionality and overloaded members |