MCPcopy Create free account
hub / github.com/comaps/comaps / FlushAsync

Method FlushAsync

generator/intermediate_data.cpp:172–187  ·  view source on GitHub ↗

Async version to continue collecting points in parallel, while writing a file.

Source from the content-addressed store, hash-verified

170
171 // Async version to continue collecting points in parallel, while writing a file.
172 void FlushAsync()
173 {
174 if (m_future.valid())
175 m_future.wait();
176
177 BufferT * pBuffer = new BufferT(std::move(m_buffer));
178 m_buffer.clear();
179 m_buffer.reserve(kBufferSize);
180
181 // Using raw pointers because we can't make std::function with rvalue reference.
182 m_future = std::async(std::launch::async, [this, pBuffer]()
183 {
184 FlushImpl(*pBuffer);
185 delete pBuffer;
186 });
187 }
188
189 void Flush()
190 {

Callers

nothing calls this directly

Calls 3

waitMethod · 0.80
clearMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected