Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryINullSelectionListener.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 BERRYINULLSELECTIONLISTENER_H_
19 #define BERRYINULLSELECTIONLISTENER_H_
20 
22 
23 namespace berry
24 {
25 
43 {
45 };
46 
72 template<typename R>
74 {
75 
76  typedef R Listener;
77  typedef void
79 
80  NullSelectionChangedAdapter(R* l, Callback c) :
81  listener(l), callback(c)
82  {
83  poco_assert(listener);
84  poco_assert(callback);
85  }
86 
88  const ISelection::ConstPointer& selection) override
89  {
90  (listener->*callback)(part, selection);
91  }
92 
93 private:
94 
95  Listener* listener;
96  Callback callback;
97 };
98 
99 }
100 
101 #endif /* BERRYINULLSELECTIONLISTENER_H_ */
void SelectionChanged(const IWorkbenchPart::Pointer &part, const ISelection::ConstPointer &selection) override
void(R::* Callback)(const IWorkbenchPart::Pointer &, const ISelection::ConstPointer &)
#define BERRY_UI_QT