-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use FE2CL_..._AROUND, _AROUND_DEL packets (#295)
* Use FE2CL_..._AROUND, _AROUND_DEL packets * Use increased buffer size for 728 and 1013 protocols
- Loading branch information
1 parent
6ffde9b
commit ae327cc
Showing
9 changed files
with
234 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.