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