L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
observer
1// vi:set ft=cpp: -*- Mode: C++ -*-
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
14namespace cxx {
15
16class Observer : public H_list_item
17{
18public:
19 virtual void notify() = 0;
20};
21
22class Notifier : public H_list<Observer>
23{
24public:
25 void notify()
26 {
27 for (Iterator i = begin(); i != end(); ++i)
28 i->notify();
29 }
30};
31
32}
33
34
Const_iterator end() const
Return a const iterator to the end of the list.
Iterator begin()
Return an iterator to the beginning of the list.
Our C++ library.
Definition arith:22
H_list_item_t< void > H_list_item
Untyped list item.
Definition hlist:72