MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / receiveAndProcess

Method receiveAndProcess

tools/openni_image.cpp:317–343  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 4

writeToDiskFunction · 0.85
popFrontMethod · 0.80
getSizeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected