MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / appendChunk

Method appendChunk

app/src/IO/FrameReader.cpp:147–166  ·  view source on GitHub ↗

* @brief Appends a captured chunk and tracks its timing metadata. */

Source from the content-addressed store, hash-verified

145 * @brief Appends a captured chunk and tracks its timing metadata.
146 */
147void IO::FrameReader::appendChunk(const CapturedDataPtr& data)
148{
149 Q_ASSERT(data);
150 Q_ASSERT(!data->data.isEmpty());
151
152 // code-verify off
153 // CircularBuffer is pre-sized SPSC; append is memcpy
154 m_circularBuffer.append(data->data);
155 // code-verify on
156
157 PendingChunk chunk;
158 chunk.chunk = data;
159 chunk.bytesRemaining = data->data.size();
160 chunk.nextFrameTimestamp = data->timestamp;
161 chunk.frameStep = std::max(std::chrono::nanoseconds(1), data->frameStep);
162 // code-verify off
163 // per-chunk timing record; deque only grows by 1 per chunk
164 m_pendingChunks.push_back(std::move(chunk));
165 // code-verify on
166}
167
168/**
169 * @brief Drops timing-bookkeeping bytes for data lost to buffer overflow.

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
appendMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected