Loading...
Searching...
No Matches
observer
// vi:set ft=cpp: -*- Mode: C++ -*-
/*
* (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/cxx/hlist>
namespace cxx {
class Observer : public H_list_item
{
public:
virtual void notify() = 0;
};
class Notifier : public H_list<Observer>
{
public:
void notify()
{
for (Iterator i = begin(); i != end(); ++i)
i->notify();
}
};
}
cxx::Bits::Basic_list::end
Const_iterator end() const
Return a const iterator to the end of the list.
Definition list_basics.h:150
cxx::Bits::Basic_list::begin
Iterator begin()
Return an iterator to the beginning of the list.
Definition list_basics.h:138
cxx::H_list
General double-linked list of unspecified cxx::H_list_item elements.
Definition hlist:70
cxx
Our C++ library.
Definition arith:11
cxx::H_list_item
H_list_item_t< void > H_list_item
Untyped list item.
Definition hlist:61