56 #ifndef __SIM_LOC_FIFO_H_INCLUDED
57 #define __SIM_LOC_FIFO_H_INCLUDED
67 template<
typename ElementType,
typename MutexType = std::mutex>
class FifoBuffer
89 std::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
98 std::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
105 void push(
const ElementType & elem)
117 std::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
124 return ElementType();
164 virtual bool condition(
const ElementType & element) = 0;
174 ElementType
findFirstIf(UnaryConditionIf & condition_impl,
bool erase_if_found =
false)
176 std::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
179 if(condition_impl.condition(*iter))
181 ElementType elem = *iter;
189 return ElementType();
197 std::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
226 #endif // __SIM_LOC_FIFO_H_INCLUDED