L4Re Operating System Framework
Interface and Usage Documentation
•All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 * License: see LICENSE.spdx (in this directory or the directories above)
7 */
8#pragma once
9
10#include <l4/cxx/hlist>
11
12namespace cxx {
13
14class Observer : public H_list_item
15{
16public:
17 virtual void notify() = 0;
18};
19
20class Notifier : public H_list<Observer>
21{
22public:
23 void notify()
24 {
25 for (Iterator i = begin(); i != end(); ++i)
26 i->notify();
27 }
28};
29
30}
31
32
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:11
H_list_item_t< void > H_list_item
Untyped list item.
Definition hlist:61