Buffer from Sam Grove changed to have static instead of dynamic memory allocation. Fixed size to 256B.
Dependents: BufferedSerialStatic
Fork of Buffer by
Revision 5:7b754354b99c, committed 2015-01-07
- Comitter:
- ansond
- Date:
- Wed Jan 07 18:34:56 2015 +0000
- Parent:
- 4:cd0a1f4c623f
- Child:
- 6:89564915f2a7
- Commit message:
- updates to the default buffer sizing
Changed in this revision
Buffer.cpp | Show annotated file Show diff for this revision Revisions of this file |
Buffer.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Buffer.cpp Wed Jun 26 15:24:27 2013 +0000 +++ b/Buffer.cpp Wed Jan 07 18:34:56 2015 +0000 @@ -42,6 +42,12 @@ } template <class T> +uint32_t Buffer<T>::getSize() +{ + return this->_size; +} + +template <class T> void Buffer<T>::clear(void) { _wloc = 0; @@ -68,4 +74,3 @@ template class Buffer<int64_t>; template class Buffer<char>; template class Buffer<wchar_t>; -
--- a/Buffer.h Wed Jun 26 15:24:27 2013 +0000 +++ b/Buffer.h Wed Jan 07 18:34:56 2015 +0000 @@ -72,6 +72,11 @@ */ Buffer(uint32_t size = 0x100); + /** Get the size of the ring buffer + * @return the size of the ring buffer + */ + uint32_t getSize(); + /** Destry a Buffer and release it's allocated memory */ ~Buffer();