MCPcopy Create free account
hub / github.com/PDAL/PDAL / producePoint

Function producePoint

examples/batch-streamer/batch_streamer.cpp:58–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool producePoint(pdal::PointRef& p)
59{
60 {
61 // Waiting for the consumer to be ready and to have consumed the
62 // previous point
63 std::unique_lock<std::mutex> l(mutex);
64 cv.wait(l, []{ return ready; });
65 cv.wait(l, []{ return !produced; });
66
67 x = p.getFieldAs<double>(pdal::Dimension::Id::X);
68 y = p.getFieldAs<double>(pdal::Dimension::Id::Y);
69 z = p.getFieldAs<double>(pdal::Dimension::Id::Z);
70
71 produced = true;
72 }
73
74 // Unlock before notifying, to avoid waking up the waiting thread only to
75 // block again (see notify_one for details)
76 cv.notify_one();
77
78 return true;
79}
80
81void makeProducer(const std::string& filename)
82{

Callers

nothing calls this directly

Calls 1

waitMethod · 0.80

Tested by

no test coverage detected