Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryHandlerEvent.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 
13 #include "berryHandlerEvent.h"
14 #include "berryIHandler.h"
15 
16 namespace berry
17 {
18 
19 const int HandlerEvent::CHANGED_ENABLED = 1;
20 const int HandlerEvent::CHANGED_HANDLED = 1 << 1;
21 
23  bool handledChanged) :
24  handler(handler)
25 {
26  if (!handler)
27  {
28  throw Poco::NullPointerException("Handler cannot be null");
29  }
30 
31  if (enabledChanged)
32  {
33  changedValues |= CHANGED_ENABLED;
34  }
35  if (handledChanged)
36  {
37  changedValues |= CHANGED_HANDLED;
38  }
39 }
40 
42 {
43  return handler;
44 }
45 
47 {
48  return ((changedValues & CHANGED_ENABLED) != 0);
49 }
50 
52 {
53  return ((changedValues & CHANGED_HANDLED) != 0);
54 }
55 
56 }
57 
static MsgHandler handler
Definition: usUtils.cpp:261
SmartPointer< IHandler > GetHandler() const
bool IsHandledChanged() const
HandlerEvent(const SmartPointer< IHandler > handler, bool enabledChanged, bool handledChanged)
bool IsEnabledChanged() const