//////////////////////////////////////////////////////////////////////////////////
| 315 | |
| 316 | /////////////////////////////////////////////////////////////////////////////////////// |
| 317 | void |
| 318 | receiveAndProcess () |
| 319 | { |
| 320 | while (!is_done) |
| 321 | { |
| 322 | if (save_data || toggle_one_frame_capture) |
| 323 | writeToDisk (buf_.popFront ()); |
| 324 | else |
| 325 | std::this_thread::sleep_for(100us); |
| 326 | } |
| 327 | |
| 328 | if (save_data && buf_.getSize () > 0) |
| 329 | { |
| 330 | { |
| 331 | std::lock_guard<std::mutex> io_lock (io_mutex); |
| 332 | print_info ("Writing remaining %ld clouds in the buffer to disk...\n", buf_.getSize ()); |
| 333 | } |
| 334 | while (!buf_.isEmpty ()) |
| 335 | { |
| 336 | { |
| 337 | std::lock_guard<std::mutex> io_lock (io_mutex); |
| 338 | print_info ("Clearing buffer... %ld remaining...\n", buf_.getSize ()); |
| 339 | } |
| 340 | writeToDisk (buf_.popFront ()); |
| 341 | } |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | public: |
| 346 | Writer (Buffer &buf) |
nothing calls this directly
no test coverage detected