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

Method setChecksum

app/src/IO/FrameReader.cpp:207–219  ·  view source on GitHub ↗

* @brief Selects the checksum algorithm, caching the function and its output length so the * per-frame validation never repeats the by-name map lookup. */

Source from the content-addressed store, hash-verified

205 * per-frame validation never repeats the by-name map lookup.
206 */
207void IO::FrameReader::setChecksum(const QString& checksum)
208{
209 m_checksum = checksum;
210 const auto& map = IO::checksumFunctionMap();
211 const auto it = map.find(m_checksum);
212 if (it != map.end()) {
213 m_checksumFunc = it.value();
214 m_checksumLength = m_checksumFunc("", 0).size();
215 } else {
216 m_checksumFunc = ChecksumFunc();
217 m_checksumLength = 0;
218 }
219}
220
221/**
222 * @brief Configures the frame start delimiters and precomputes their KMP tables.

Callers 2

startFrameReaderMethod · 0.80
configureAndFeedFunction · 0.80

Calls 3

findMethod · 0.80
valueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected