Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryINullSelectionListener.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 BERRYInullptrSELECTIONLISTENER_H_
15 #define BERRYInullptrSELECTIONLISTENER_H_
16 
18 
19 namespace berry
20 {
21 
39 {
40  ~INullSelectionListener() override;
41 };
42 
68 template<typename R>
70 {
71 
72  typedef R Listener;
73  typedef void
74  (R::*Callback)(const IWorkbenchPart::Pointer&, const ISelection::ConstPointer&);
75 
76  NullSelectionChangedAdapter(R* l, Callback c) :
77  listener(l), callback(c)
78  {
79  poco_assert(listener);
80  poco_assert(callback);
81  }
82 
84  const ISelection::ConstPointer& selection) override
85  {
86  (listener->*callback)(part, selection);
87  }
88 
89 private:
90 
91  Listener* listener;
92  Callback callback;
93 };
94 
95 }
96 
97 #endif /* BERRYInullptrSELECTIONLISTENER_H_ */
void SelectionChanged(const IWorkbenchPart::Pointer &part, const ISelection::ConstPointer &selection) override
#define BERRY_UI_QT