summaryrefslogtreecommitdiff
path: root/arduino_libs/ByteBuffer/.svn/text-base/ByteBuffer.h.svn-base
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2011-12-19 18:20:33 +0000
committerTim Redfern <tim@eclectronics.org>2011-12-19 18:20:33 +0000
commite9a73bbb3c14af340999f70146747787785f4fee (patch)
treea125452f7d641673286542497da051b810427880 /arduino_libs/ByteBuffer/.svn/text-base/ByteBuffer.h.svn-base
initial commit
Diffstat (limited to 'arduino_libs/ByteBuffer/.svn/text-base/ByteBuffer.h.svn-base')
-rwxr-xr-xarduino_libs/ByteBuffer/.svn/text-base/ByteBuffer.h.svn-base57
1 files changed, 57 insertions, 0 deletions
diff --git a/arduino_libs/ByteBuffer/.svn/text-base/ByteBuffer.h.svn-base b/arduino_libs/ByteBuffer/.svn/text-base/ByteBuffer.h.svn-base
new file mode 100755
index 0000000..b100c2f
--- /dev/null
+++ b/arduino_libs/ByteBuffer/.svn/text-base/ByteBuffer.h.svn-base
@@ -0,0 +1,57 @@
+/*
+ ByteBuffer.h - A circular buffer implementation for Arduino
+ Created by Sigurdur Orn, July 19, 2010.
+ */
+#ifndef ByteBuffer_h
+#define ByteBuffer_h
+
+#include "WProgram.h"
+
+class ByteBuffer
+{
+public:
+ ByteBuffer();
+
+ void init(unsigned int buf_size);
+
+ void clear();
+ int getSize();
+ int getCapacity();
+
+ int putInFront(byte in);
+ int put(byte in);
+
+ byte get();
+ byte getFromBack();
+
+ byte peek(unsigned int index);
+
+ int putIntInFront(int in);
+ int putInt(int in);
+
+ int putLongInFront(long in);
+ int putLong(long in);
+
+ int getInt();
+ int getIntFromBack();
+
+ long getLong();
+ long getLongFromBack();
+
+ int putFloatInFront(float in);
+ int putFloat(float in);
+
+ float getFloat();
+ float getFloatFromBack();
+
+private:
+ byte* data;
+ byte* float_bytes;
+
+ unsigned int capacity;
+ unsigned int position;
+ unsigned int length;
+};
+
+#endif
+