libsmbios_c library
src
include
smbios
IObserver.h
Go to the documentation of this file.
1
// vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
2
/*
3
* Copyright (C) 2005 Dell Inc.
4
* by Michael Brown <Michael_E_Brown@dell.com>
5
* Licensed under the Open Software License version 2.1
6
*
7
* Alternatively, you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published
9
* by the Free Software Foundation; either version 2 of the License,
10
* or (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
* See the GNU General Public License for more details.
16
*/
17
18
19
#ifndef IOBSERVER_H
20
#define IOBSERVER_H
21
22
// compat header should always be first header
23
#include "
smbios/compat.h
"
24
25
#include <list>
26
27
// abi_prefix should be last header included before declarations
28
#include "
smbios/config/abi_prefix.hpp
"
29
30
namespace
observer
31
{
32
// forward declarations
33
class
IObservable
;
34
35
class
IObserver
36
{
37
public
:
38
virtual
~IObserver
();
39
virtual
void
update
(
const
IObservable
*whatChanged,
void
*param = 0 ) = 0;
40
protected
:
41
IObserver
();
42
};
43
44
class
IObservable
45
{
46
public
:
47
virtual
~
IObservable
();
48
49
virtual
void
attach(
IObserver
* )
const
;
50
virtual
void
detach(
IObserver
* )
const
;
51
virtual
void
notify(
void
*param = 0 )
const
;
52
protected
:
53
IObservable
();
54
55
private
:
56
mutable
std::list<IObserver *> observers;
57
};
58
59
}
60
61
// always should be last thing in header file
62
#include "
smbios/config/abi_suffix.hpp
"
63
64
#endif
/* IOBSERVER_H */
abi_suffix.hpp
observer::IObserver::~IObserver
virtual ~IObserver()
observer::IObserver::IObserver
IObserver()
observer::IObservable
Definition:
IObserver.h:44
observer::IObserver::update
virtual void update(const IObservable *whatChanged, void *param=0)=0
abi_prefix.hpp
compat.h
observer
Definition:
IObserver.h:30
observer::IObserver
Definition:
IObserver.h:35
Generated on Mon Dec 11 2017 14:05:46 for libsmbios_c library by
1.8.13