14#include <fairlogger/Logger.h>
23 memset(mDataWords.data(), 0,
sizeof(uint32_t) * mDataWords.size());
30 auto address =
reinterpret_cast<char*
>(&word);
32 while (nbyte < payloadsize) {
34 nbyte +=
sizeof(word);
35 if ((word & 0xFFFFFF) == 0x1d3082) {
36 LOG(error) <<
"Found stop word" << std::endl;
42 mDataWords[mNDataWords++] = word;
49 auto address =
reinterpret_cast<const uint32_t*
>(rawmemory.data());
50 for (
auto iword = 0; iword < rawmemory.size() /
sizeof(uint32_t); iword++) {
59 mDataWords[mNDataWords++] =
address[iword];
65 if (
index >= mNDataWords) {
66 throw std::runtime_error(
"Index out of range");
68 return mDataWords[
index];
74 throw std::runtime_error(
"No more data words in buffer");
76 return mDataWords[mCurrentDataWord++];
void readFromMemoryBuffer(const gsl::span< const char > rawmemory)
Read page from raw memory buffer.
bool hasNext() const
Check whether the next data word exists.
uint32_t getWord(int index) const
Get the data word at a given index.
uint32_t getNextDataWord()
Get the next data word in the superpage.
void readFromStream(std::istream &in, uint32_t payloadsize)
Read page from stream.
void flush()
Flush the buffer Does not overwrite the word buffer but just resets the counter and iterator.
GLuint GLuint64EXT address
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"