MCPcopy Create free account
hub / github.com/Snapchat/Valdi / dequeue

Method dequeue

snap_drawing/src/snap_drawing/cpp/Utils/ImageQueue.cpp:61–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61std::optional<Ref<Image>> ImageQueue::dequeue() {
62 std::lock_guard<Valdi::Mutex> lock(_mutex);
63 if (_queue.empty()) {
64 return std::nullopt;
65 }
66
67 auto image = std::move(_queue.front());
68 _queue.pop_front();
69
70 return {std::move(image)};
71}
72
73void ImageQueue::clearQueueUpToSize(size_t maxSize, std::unique_lock<Valdi::Mutex>& lock) {
74 while (_queue.size() > maxSize) {

Callers 2

TEST_FFunction · 0.80
runMethod · 0.80

Calls 2

frontMethod · 0.80
emptyMethod · 0.45

Tested by 1

TEST_FFunction · 0.64