MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / saveData

Method saveData

edrav2/iprj/libcore/src/queue.cpp:98–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96//
97//
98Variant Queue::saveData()
99{
100 if (!m_fPersistent)
101 return {};
102
103 flushBatch();
104
105 Sequence items;
106 {
107 std::scoped_lock sync(m_mtxData);
108 auto nCurrSize = m_nSaveSize;
109 for (auto v : m_data)
110 {
111 if (nCurrSize-- == 0) break;
112 items.push_back(v);
113 }
114 }
115
116 Dictionary vRoot;
117 if (!items.isEmpty())
118 vRoot.put("items", items);
119
120 return vRoot;
121}
122
123//
124//

Callers 2

test_queue.cppFile · 0.80
saveStateMethod · 0.80

Calls 3

push_backMethod · 0.45
isEmptyMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected