/* * \brief Queue with first-in first-out semantics * \author Martin Stein * \date 2012-11-30 */ /* * Copyright (C) 2014 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. */ #ifndef _KERNEL__FIFO_H_ #define _KERNEL__FIFO_H_ /* Genode includes */ #include namespace Kernel { /** * Queue with first-in first-out semantics * * \param T queue element type */ template class Fifo : public Genode::Fifo { public: /** * Call function 'f' of type 'void (QT *)' for each queue element */ template void for_each(F f) { typedef Genode::Fifo B; for (T * e = B::head(); e; e = e->B::Element::next()) { f(e); } } }; } #endif /* _KERNEL__FIFO_H_ */