MCPcopy Create free account
hub / github.com/KDE/labplot / dropOldData

Method dropOldData

src/3rdparty/vector_blf/src/Vector/BLF/UncompressedFile.cpp:269–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void UncompressedFile::dropOldData() {
270 /* mutex lock */
271 std::lock_guard<std::mutex> lock(m_mutex);
272
273 /* check if drop should be done now */
274 if (m_data.empty()) {
275 return;
276 }
277 std::shared_ptr<LogContainer> logContainer = m_data.front();
278 if (logContainer) {
279 std::streampos position = logContainer->uncompressedFileSize + logContainer->filePosition;
280 if ((position > m_tellg) || (position > m_tellp) || (position > m_fileSize)) {
281 /* don't drop yet */
282 return;
283 }
284 }
285
286 /* drop data */
287 m_data.pop_front();
288}
289
290uint32_t UncompressedFile::defaultLogContainerSize() const {
291 /* mutex lock */

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected