Enqueues an item in the queue if not already present (as determined by operator ==). Blocks other threads from accessing the queue.
| 65 | |
| 66 | /// Enqueues an item in the queue if not already present (as determined by operator ==). Blocks other threads from accessing the queue. |
| 67 | void EnqueueItemIfNotPresent(ItemType a_Item) |
| 68 | { |
| 69 | cCSLock Lock(m_CS); |
| 70 | |
| 71 | for (iterator itr = m_Contents.begin(); itr != m_Contents.end(); ++itr) |
| 72 | { |
| 73 | if ((*itr) == a_Item) |
| 74 | { |
| 75 | Funcs::Combine(*itr, a_Item); |
| 76 | return; |
| 77 | } |
| 78 | } |
| 79 | m_Contents.push_back(a_Item); |
| 80 | m_evtAdded.Set(); |
| 81 | } |
| 82 | |
| 83 | |
| 84 | /// Dequeues an item from the queue if any are present. |
no test coverage detected