Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
berryIExecutionListenerWithChecks.cpp
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 
14 
15 #include "berryExecutionEvent.h"
17 #include "berryCommandCategory.h"
18 #include "berryState.h"
19 #include "berryIHandler.h"
20 
21 namespace berry {
22 
23 void
26 {
27  if (l == nullptr) return;
28 
30 
31  if (IExecutionListenerWithChecks* cl = dynamic_cast<IExecutionListenerWithChecks*>(l))
32  {
35  }
36 }
37 
38 void
41 {
42  if (l == nullptr) return;
43 
45 
46  if (IExecutionListenerWithChecks* cl = dynamic_cast<IExecutionListenerWithChecks*>(l))
47  {
50  }
51 }
52 
53 bool
56 {
57  return IExecutionListener::Events::HasListeners() || notDefined.HasListeners() ||
58  notEnabled.HasListeners();
59 }
60 
61 bool
63 ::IsEmpty() const
64 {
65  return !this->HasListeners();
66 }
67 
68 }
void RemoveListener(IExecutionListener *listener) override
virtual void RemoveListener(IExecutionListener *listener)
virtual void NotDefined(const QString &commandId, const NotDefinedException *exception)=0
virtual void NotEnabled(const QString &commandId, const NotEnabledException *exception)=0
virtual void AddListener(IExecutionListener *listener)
void AddListener(IExecutionListener *listener) override