Created
January 4, 2022 15:50
-
-
Save omerbn/8e98d3858d13d5e36736304c6a081b77 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class MockBuffer: SPSRingBuffer<uint_8> { | |
/* | |
*/ | |
} | |
class Buffer { | |
SPSRingBuffer<uint_8> buffer; | |
public: | |
Buffer: buffer() {} | |
Buffer(SPSRingBuffer<uint_8>& buf): buffer(std::move(buffer)) {} | |
#ifdef IN_TESTS | |
/* | |
It's dangerous to use an external buffer, thus using this only in tests | |
*/ | |
Buffer(SPSRingBuffer<uint_8>* buf): buffer(*buffer) {} // lo mumlatz | |
#endif | |
} | |
void main() { | |
MockBuffer myBuffer; | |
std::unique_ptr<Buffer> buf = std::make_unique<Buffer>(&myBuffer); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment