Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
berryIJobChangeListener.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 #ifndef BERRYIJOBCHANGELISTENER_H_
14 #define BERRYIJOBCHANGELISTENER_H_
15 
16 #include "berryIJobChangeEvent.h"
17 
18 namespace berry
19 {
20 
44 {
45 
47  {
48 
50 
51  enum Type
52  {
53  NONE = 0x00000000,
54  ABOUT_TO_RUN = 0x00000001,
55  AWAKE = 0x00000002,
56  DONE = 0x00000004,
57  RUNNING = 0x00000008,
58  SCHEDULED = 0x00000010,
59  SLEEPING = 0x00000020,
60 
61  ALL = 0xffffffff
62  };
63 
64  Q_DECLARE_FLAGS(Types, Type)
65 
66  JobChangeEventType jobAboutToRun;
67  JobChangeEventType jobAwake;
68  JobChangeEventType jobDone;
69  JobChangeEventType jobRunning;
70  JobChangeEventType jobScheduled;
71  JobChangeEventType jobSleeping;
72 
73  void AddListener(IJobChangeListener* listener);
74  void RemoveListener(IJobChangeListener* listener);
75 
76  void SetExceptionHandler(const AbstractExceptionHandler& handler);
77 
78  typedef MessageDelegate1<IJobChangeListener, const IJobChangeEvent::ConstPointer&>
80  };
81 
82  virtual Events::Types GetEventTypes() = 0;
83 
91  virtual void AboutToRun(const IJobChangeEvent::ConstPointer& /*event*/)
92  {
93  }
94 
101  virtual void Awake(const IJobChangeEvent::ConstPointer& /*event*/)
102  {
103  }
104 
112  virtual void Done(const IJobChangeEvent::ConstPointer& /*event*/)
113  {
114  }
115 
121  virtual void Running(const IJobChangeEvent::ConstPointer& /*event*/)
122  {
123  }
124 
133  virtual void Scheduled(const IJobChangeEvent::ConstPointer& /*event*/)
134  {
135  }
136 
143  virtual void Sleeping(const IJobChangeEvent::ConstPointer& /*event*/)
144  {
145  }
146 
147 };
148 
149 }
150 
151 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IJobChangeListener::Events::Types)
152 
153 #endif /* BERRYIJOBCHANGELISTENER_H_ */
static MsgHandler handler
Definition: usUtils.cpp:261
virtual void Sleeping(const IJobChangeEvent::ConstPointer &)
Message1< const IJobChangeEvent::ConstPointer & > JobChangeEventType
#define BERRY_JOBS
virtual void Scheduled(const IJobChangeEvent::ConstPointer &)
virtual void Running(const IJobChangeEvent::ConstPointer &)
virtual void Awake(const IJobChangeEvent::ConstPointer &)
virtual void Done(const IJobChangeEvent::ConstPointer &)