Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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;
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 
89  virtual void AboutToRun(const IJobChangeEvent::ConstPointer& /*event*/)
90  {
91  }
92 
97  virtual void Awake(const IJobChangeEvent::ConstPointer& /*event*/)
98  {
99  }
100 
106  virtual void Done(const IJobChangeEvent::ConstPointer& /*event*/)
107  {
108  }
109 
113  virtual void Running(const IJobChangeEvent::ConstPointer& /*event*/)
114  {
115  }
116 
122  virtual void Scheduled(const IJobChangeEvent::ConstPointer& /*event*/)
123  {
124  }
125 
130  virtual void Sleeping(const IJobChangeEvent::ConstPointer& /*event*/)
131  {
132  }
133 
134 };
135 
136 }
137 
138 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IJobChangeListener::Events::Types)
139 
140 #endif /* BERRYIJOBCHANGELISTENER_H_ */
berry::IJobChangeListener::Awake
virtual void Awake(const IJobChangeEvent::ConstPointer &)
Definition: berryIJobChangeListener.h:97
berry::IJobChangeListener::Events
Definition: berryIJobChangeListener.h:46
berry::IJobChangeEvent
Definition: berryIJobChangeEvent.h:36
berryIJobChangeEvent.h
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berry::AbstractExceptionHandler
Definition: berryMessage.h:354
berry::Message1< const IJobChangeEvent::ConstPointer & >
berry::MessageDelegate1
Definition: berryMessage.h:170
berry::IJobChangeListener::Events::JobChangeEventType
Message1< const IJobChangeEvent::ConstPointer & > JobChangeEventType
Definition: berryIJobChangeListener.h:49
berry::IJobChangeListener
Definition: berryIJobChangeListener.h:43
berry::IJobChangeListener::Sleeping
virtual void Sleeping(const IJobChangeEvent::ConstPointer &)
Definition: berryIJobChangeListener.h:130
berry::IJobChangeListener::Done
virtual void Done(const IJobChangeEvent::ConstPointer &)
Definition: berryIJobChangeListener.h:106
berry::IJobChangeListener::Running
virtual void Running(const IJobChangeEvent::ConstPointer &)
Definition: berryIJobChangeListener.h:113
berry::IJobChangeListener::Events::Type
Type
Definition: berryIJobChangeListener.h:51
BERRY_JOBS
#define BERRY_JOBS
Definition: org_blueberry_core_jobs_Export.h:26
berry::IJobChangeListener::Scheduled
virtual void Scheduled(const IJobChangeEvent::ConstPointer &)
Definition: berryIJobChangeListener.h:122
berry
Definition: QmitkPropertyItemModel.h:24