source: pacpusframework/branches/2.0-beta1/include/Pacpus/kernel/GenericObserverInterface.h@ 139

Last change on this file since 139 was 89, checked in by morasjul, 12 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

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