55 #ifndef __SIM_LOC_FIFO_H_INCLUDED
56 #define __SIM_LOC_FIFO_H_INCLUDED
58 #include <boost/thread.hpp>
66 template<
typename ElementType,
typename MutexType = boost::mutex>
class FifoBuffer
88 boost::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
97 boost::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
104 void push(
const ElementType & elem)
116 boost::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
123 return ElementType();
131 while (ROS::ok() &&
empty())
142 if (ROS::ok() &&
empty())
163 virtual bool condition(
const ElementType & element) = 0;
173 ElementType
findFirstIf(UnaryConditionIf & condition_impl,
bool erase_if_found =
false)
175 boost::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
178 if(condition_impl.condition(*iter))
180 ElementType elem = *iter;
188 return ElementType();
196 boost::lock_guard<MutexType> message_lockguard(
m_fifo_mutex);
225 #endif // __SIM_LOC_FIFO_H_INCLUDED