| 96 | // |
| 97 | // |
| 98 | Variant 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 | // |
no test coverage detected