Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIStateListener.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef BERRYISTATELISTENER_H_
19 #define BERRYISTATELISTENER_H_
20 
22 
23 #include "berryMessage.h"
24 
25 namespace berry {
26 
27 template<class T> class SmartPointer;
28 
29 class Object;
30 class State;
31 
41 {
42 
43  struct Events {
44 
46 
47  StateEvent stateChanged;
48 
49  void AddListener(IStateListener* listener);
50  void RemoveListener(IStateListener* listener);
51 
52  private:
54  };
55 
56  virtual ~IStateListener();
57 
67  virtual void HandleStateChange(const SmartPointer<State>& state,
68  const SmartPointer<Object>& oldValue) = 0;
69 };
70 
71 
72 }
73 
74 #endif /* BERRYISTATELISTENER_H_ */
Message2< const SmartPointer< State > &, const SmartPointer< Object > & > StateEvent
Implements transparent reference counting.