Use FE2CL_..._AROUND, _AROUND_DEL packets (#295)

* Use FE2CL_..._AROUND, _AROUND_DEL packets
* Use increased buffer size for 728 and 1013 protocols
This commit is contained in:
2024-10-28 20:49:34 -07:00
committed by GitHub
parent 6ffde9bb44
commit ae327cc104
9 changed files with 234 additions and 30 deletions

40
src/Bucket.hpp Normal file
View File

@@ -0,0 +1,40 @@
#pragma once
#include <array>
#include <optional>
#include <assert.h>
template<class T, size_t N>
class Bucket {
std::array<T, N> buf;
size_t sz;
public:
Bucket() {
sz = 0;
}
void add(const T& item) {
assert(sz < N);
buf[sz++] = item;
}
std::optional<T> get(size_t idx) const {
if (idx < sz) {
return buf[idx];
}
return std::nullopt;
}
size_t size() const {
return sz;
}
bool isFull() const {
return sz == N;
}
void clear() {
sz = 0;
}
};