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

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

Documentation: file info.

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