Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Buffer by
Diff: Buffer.cpp
- Revision:
- 3:c2de0ddfe65b
- Parent:
- 1:490224f41c09
- Child:
- 4:cd0a1f4c623f
diff -r 490224f41c09 -r c2de0ddfe65b Buffer.cpp
--- a/Buffer.cpp Thu May 23 19:26:31 2013 +0000
+++ b/Buffer.cpp Wed Jun 26 15:19:45 2013 +0000
@@ -24,7 +24,7 @@
#include "Buffer.h"
template <class T>
-Buffer<T>::Buffer(BUFFER_SIZE size)
+Buffer<T>::Buffer(uint32_t size)
{
_buf = new T [size];
_size = size;
@@ -42,32 +42,6 @@
}
template <class T>
-void Buffer<T>::put(T data)
-{
- _buf[_wloc++] = data;
- _wloc &= (_size-1);
-
- return;
-}
-
-template <class T>
-T Buffer<T>::get(void)
-{
- T data_pos = _buf[_rloc++];
- _rloc &= (_size-1);
-
- return data_pos;
-}
-
-template <class T>
-T *Buffer<T>::head(void)
-{
- T *data_pos = &_buf[0];
-
- return data_pos;
-}
-
-template <class T>
void Buffer<T>::clear(void)
{
_wloc = 0;
@@ -77,12 +51,6 @@
return;
}
-template <class T>
-uint32_t Buffer<T>::available(void)
-{
- return (_wloc == _rloc) ? 0 : 1;
-}
-
// make the linker aware of some possible types
template class Buffer<uint8_t>;
template class Buffer<int8_t>;
