]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/cxx/lib/tl/include/observer
update
[l4.git] / l4 / pkg / cxx / lib / tl / include / observer
1 // vi:ft=cpp
2 /*
3  * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  */
10 #pragma once
11
12 #include <l4/cxx/hlist>
13
14 namespace cxx {
15
16 class Observer : public H_list_item
17 {
18 public:
19   virtual void notify() = 0;
20 };
21
22 class Notifier : public H_list<Observer>
23 {
24 public:
25   void notify()
26   {
27     for (Iterator i = begin(); i != end(); ++i)
28       i->notify();
29   }
30 };
31
32 }
33
34