MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / tryEmplace

Method tryEmplace

include/openpose/thread/queueBase.hpp:141–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140 template<typename TDatums, typename TQueue>
141 bool QueueBase<TDatums, TQueue>::tryEmplace(TDatums& tDatums)
142 {
143 try
144 {
145 const std::lock_guard<std::mutex> lock{mMutex};
146 if (mTQueue.size() >= getMaxSize())
147 return false;
148 return emplace(tDatums);
149 }
150 catch (const std::exception& e)
151 {
152 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
153 return false;
154 }
155 }
156
157 template<typename TDatums, typename TQueue>
158 bool QueueBase<TDatums, TQueue>::waitAndEmplace(TDatums& tDatums)

Callers

nothing calls this directly

Calls 3

whatMethod · 0.80
errorFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected