Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIJobChangeListener.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 #ifndef BERRYIJOBCHANGELISTENER_H_
18 #define BERRYIJOBCHANGELISTENER_H_
19 
20 #include "berryIJobChangeEvent.h"
21 
22 namespace berry
23 {
24 
47 struct BERRY_JOBS IJobChangeListener
48 {
49 
50  struct BERRY_JOBS Events
51  {
52 
54 
55  enum Type
56  {
57  NONE = 0x00000000,
58  ABOUT_TO_RUN = 0x00000001,
59  AWAKE = 0x00000002,
60  DONE = 0x00000004,
61  RUNNING = 0x00000008,
62  SCHEDULED = 0x00000010,
63  SLEEPING = 0x00000020,
64 
65  ALL = 0xffffffff
66  };
67 
68  Q_DECLARE_FLAGS(Types, Type)
69 
70  JobChangeEventType jobAboutToRun;
71  JobChangeEventType jobAwake;
72  JobChangeEventType jobDone;
73  JobChangeEventType jobRunning;
74  JobChangeEventType jobScheduled;
75  JobChangeEventType jobSleeping;
76 
77  void AddListener(IJobChangeListener* listener);
78  void RemoveListener(IJobChangeListener* listener);
79 
80  void SetExceptionHandler(const AbstractExceptionHandler& handler);
81 
84  };
85 
86  virtual Events::Types GetEventTypes() = 0;
87 
95  virtual void AboutToRun(const IJobChangeEvent::ConstPointer& /*event*/)
96  {
97  }
98 
105  virtual void Awake(const IJobChangeEvent::ConstPointer& /*event*/)
106  {
107  }
108 
116  virtual void Done(const IJobChangeEvent::ConstPointer& /*event*/)
117  {
118  }
119 
125  virtual void Running(const IJobChangeEvent::ConstPointer& /*event*/)
126  {
127  }
128 
137  virtual void Scheduled(const IJobChangeEvent::ConstPointer& /*event*/)
138  {
139  }
140 
147  virtual void Sleeping(const IJobChangeEvent::ConstPointer& /*event*/)
148  {
149  }
150 
151 };
152 
153 }
154 
155 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IJobChangeListener::Events::Types)
156 
157 #endif /* BERRYIJOBCHANGELISTENER_H_ */
static MsgHandler handler
Definition: usUtils.cpp:261
virtual void Sleeping(const IJobChangeEvent::ConstPointer &)
Message1< const IJobChangeEvent::ConstPointer & > JobChangeEventType
virtual void Scheduled(const IJobChangeEvent::ConstPointer &)
virtual void Running(const IJobChangeEvent::ConstPointer &)
itk::SmartPointer< const Self > ConstPointer
virtual void Awake(const IJobChangeEvent::ConstPointer &)
virtual void Done(const IJobChangeEvent::ConstPointer &)