3333 *****************************************************************************/
3434
3535/* *
36- * @brief Push an element to the front of the queue
36+ * Push an element to the front of the queue
3737 *
38- * @tparam T Element type
39- * @param element The element to push
38+ * @tparam T Element type
39+ * @param element The element to push
4040 * @return true if successfully pushed, false if queue is full
4141 */
4242template <typename T>
@@ -54,10 +54,10 @@ bool cQueue<T>::Push(const T& element)
5454}
5555
5656/* *
57- * @brief Pop an element from the back of the queue
57+ * Pop an element from the back of the queue
5858 *
59- * @tparam T Element type
60- * @return T The popped element
59+ * @tparam T Element type
60+ * @return T The popped element
6161 * @throws std::runtime_error if queue is empty
6262 */
6363template <typename T>
@@ -76,10 +76,10 @@ T cQueue<T>::Pop(void)
7676}
7777
7878/* *
79- * @brief Get a reference to the front element
79+ * Get a reference to the front element
8080 *
81- * @tparam T Element type
82- * @return T& Reference to the front (most recently pushed) element
81+ * @tparam T Element type
82+ * @return T Element at the front (most recently pushed)
8383 * @throws std::runtime_error if queue is empty
8484 */
8585template <typename T>
@@ -95,10 +95,10 @@ T cQueue<T>::Head(void)
9595}
9696
9797/* *
98- * @brief Get a reference to the back element
98+ * Get a reference to the back element
9999 *
100- * @tparam T Element type
101- * @return T& Reference to the back (next to be popped) element
100+ * @tparam T Element type
101+ * @return T Element at the back (next to be popped)
102102 * @throws std::runtime_error if queue is empty
103103 */
104104template <typename T>
@@ -114,7 +114,7 @@ T cQueue<T>::Peek(void)
114114}
115115
116116/* *
117- * @brief Check if the queue is empty
117+ * Check if the queue is empty
118118 *
119119 * @tparam T Element type
120120 * @return true if queue is empty, false otherwise
@@ -123,19 +123,21 @@ template <typename T>
123123bool cQueue<T>::Empty(void )
124124{
125125 std::lock_guard<std::mutex> lock (m_mutex);
126+
126127 return m_deque.empty ();
127128}
128129
129130/* *
130- * @brief Get the current size of the queue
131+ * Get the current size of the queue
131132 *
132133 * @tparam T Element type
133- * @return size_t Number of elements currently in the queue
134+ * @return Number of elements currently in the queue
134135 */
135136template <typename T>
136137size_t cQueue<T>::Size(void )
137138{
138139 std::lock_guard<std::mutex> lock (m_mutex);
140+
139141 return m_deque.size ();
140142}
141143
0 commit comments