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"); }
Revisions of Buffer.cpp
Revision | Date | Message | Actions |
---|---|---|---|
4:cd0a1f4c623f | 2013-06-26 | merged | File Diff Annotate |
3:c2de0ddfe65b | 2013-06-26 | Allow any size of buffer | File Diff Annotate |
2:d13a72146516 | 2013-05-23 | Optimized the use of _size and created _sizemask instead. Faster during normal operation. | File Diff Annotate |
1:490224f41c09 | 2013-05-23 | Added documentation | File Diff Annotate |
0:5e4bca1bd5f7 | 2013-05-10 | First version - implements basic functionality and overloaded members | File Diff Annotate |