| 64 | |
| 65 | template<typename TDatums, typename TQueue> |
| 66 | bool PriorityQueue<TDatums, TQueue>::pop(TDatums& tDatums) |
| 67 | { |
| 68 | try |
| 69 | { |
| 70 | if (this->mPopIsStopped || this->mTQueue.empty()) |
| 71 | return false; |
| 72 | |
| 73 | tDatums = {std::move(this->mTQueue.top())}; |
| 74 | this->mTQueue.pop(); |
| 75 | this->mConditionVariable.notify_one(); |
| 76 | return true; |
| 77 | } |
| 78 | catch (const std::exception& e) |
| 79 | { |
| 80 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 81 | return false; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | COMPILE_TEMPLATE_DATUM(PriorityQueue); |
| 86 | } |