Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/SimplyAtomic"]
path = src/SimplyAtomic
url = https://github.com/wizard97/SimplyAtomic
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,27 @@ Creates a new RingBuf object that can buffer up to MaxElements of type Type.
## Methods


### add()
### add() / append() / push()

```c++
bool add(Type &obj);
bool append(Type &obj);
bool push(Type &obj);
```

Append an element to the buffer. Return true on success, false on a full buffer.

All three methods are identical, except for their name.

### prepend()

```c++
bool prepend(Type &obj);
```

Prepend an element to the buffer. Return true on success, false on a full buffer.


### peek()

```c++
Expand All @@ -72,11 +85,20 @@ Peek at the num'th element in the buffer. Returns a pointer to the location of t
### pull()

```c++
bool pull(Type *dest);
bool pull(Type *dest = nullptr);
bool pull(Type &dest);
```

Pull the first element out of the buffer. The first element is copied into the location pointed to by dest. Returns false if the buffer is empty, otherwise returns true on success.
Pull the first element out of the buffer. If a non-null pointer is passed, the removed element is copied into the location pointed to or referenced by dest. Returns false if the buffer is empty, otherwise returns true on success.

### pop()

```c++
bool pop(Type *dest = nullptr);
bool pop(Type &dest);
```

Pop the last element out of the buffer. If a non-null pointer is passed, the removed element is copied into the location pointed to or referenced by dest. Returns false if the buffer is empty, otherwise returns true on success.

### numElements()
```c++
Expand Down
159 changes: 0 additions & 159 deletions RingBufCPP.h

This file was deleted.

53 changes: 0 additions & 53 deletions RingBufHelpers.h

This file was deleted.

6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name=RingBufCPP
version=1.1
author=D. Aaron Wisner (daw268@cornell.edu)
maintainer=D. Aaron Wisner (daw268@cornell.edu)
sentence=A library for buffering items into a ring (circular/FIFO) buffer
sentence=A library for buffering items into a ring (circular/FIFO) buffer, using C++ and templates
paragraph=This library is perfect for capturing pin states, timestamps, etc.. during an ISR. Then in void loop(), the buffer can be asynchronously processed whenever your program has free time.
category=Data Storage
url=https://github.com/wizard97/ArduinoRingBuffer
architectures=avr,esp8266
url=https://github.com/wizard97/Embedded_RingBuf_CPP
architectures=*
Loading