Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
berryIStateListener.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef BERRYISTATELISTENER_H_
15 #define BERRYISTATELISTENER_H_
16 
18 
19 #include "berryMessage.h"
20 
21 namespace berry {
22 
23 template<class T> class SmartPointer;
24 
25 class Object;
26 class State;
27 
37 {
38 
39  struct Events {
40 
42 
43  StateEvent stateChanged;
44 
45  void AddListener(IStateListener* listener);
46  void RemoveListener(IStateListener* listener);
47 
48  private:
50  };
51 
52  virtual ~IStateListener();
53 
63  virtual void HandleStateChange(const SmartPointer<State>& state,
64  const SmartPointer<Object>& oldValue) = 0;
65 };
66 
67 
68 }
69 
70 #endif /* BERRYISTATELISTENER_H_ */
Message2< const SmartPointer< State > &, const SmartPointer< Object > & > StateEvent
Implements transparent reference counting.