| 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) |