mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 07:19:28 -05:00
Track StreamInput bytes written
This commit is contained in:
parent
8e14d2f4e8
commit
56e448d355
@ -47,11 +47,18 @@ public:
|
||||
}
|
||||
|
||||
size_t write(const void* const data, const size_t length) {
|
||||
return fifo.in(reinterpret_cast<const uint8_t*>(data), length);
|
||||
const auto written = fifo.in(reinterpret_cast<const uint8_t*>(data), length);
|
||||
bytes_written += written;
|
||||
return written;
|
||||
}
|
||||
|
||||
uint64_t written() const {
|
||||
return bytes_written;
|
||||
}
|
||||
|
||||
private:
|
||||
const size_t K;
|
||||
uint64_t bytes_written = 0;
|
||||
std::unique_ptr<uint8_t[]> data;
|
||||
FIFO<uint8_t> fifo;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user