source: pacpusframework/trunk/include/Pacpus/kernel/GenericObserverInterface.h@ 64

Last change on this file since 64 was 64, checked in by Marek Kurdej, 12 years ago

Modified property: added svn:keywords=Id.

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1// This file is part of the PACPUS framework distributed under the
2// CECILL-C License, Version 1.0.
3//
4/// @author Stephane Bonnet <firstname.surname@utc.fr>
5/// @date October, 2012
6/// @version $Id: GenericObserverInterface.h 64 2013-01-09 16:41:12Z kurdejma $
7/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
8/// @brief Brief description.
9///
10/// Detailed description.
11
12#ifndef DEF_PACPUS_GENERIC_OBSERVER_INTERFACE_H
13#define DEF_PACPUS_GENERIC_OBSERVER_INTERFACE_H
14
15namespace pacpus {
16
17/** Base class for te GenericObserverInterface template.
18
19 The purpose of this class is to be able to take generic pointers on
20 GenericObserverInterface<T> class template instances.
21*/
22class GenericObserverBase {
23public:
24 virtual ~GenericObserverBase() {}
25};
26
27/** Template interface for generic observers.
28
29 This is a pure virtual class that should be used as a base to classes
30 wishing to receive notifications from GenericObservable classes.
31*/
32template <typename T>
33class GenericObserverInterface : public GenericObserverBase {
34public:
35 virtual ~GenericObserverInterface() {};
36
37 /** Update function.
38
39 This function is called each time the observables notifies its observers
40 of a change. It must be implemented by all classes obeying the
41 GenericObserverInterface interface.
42
43 @param observable is a pointer to the observed object that was updated.
44 */
45 virtual void update(T* observable) = 0;
46};
47
48} // namespace pacpus
49
50
51#endif // DEF_PACPUS_GENERIC_OBSERVER_INTERFACE_H
Note: See TracBrowser for help on using the repository browser.