Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkNonBlockingAlgorithmEvents.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 MITK_NON_BLOCKING_ALGORHITHMS_ENVETS_H_INCLDUED
14 #define MITK_NON_BLOCKING_ALGORHITHMS_ENVETS_H_INCLDUED
15 
16 #include <itkEventObject.h>
17 
18 namespace mitk
19 {
20  class NonBlockingAlgorithm;
21 
22  class NonBlockingAlgorithmEvent : public itk::AnyEvent
23  {
24  public:
26  typedef itk::AnyEvent Superclass;
27 
28  NonBlockingAlgorithmEvent(const NonBlockingAlgorithm *algorithm = nullptr) : m_Algorithm(algorithm) {}
30  const char *GetEventName() const override { return "NonBlockingAlgorithmEvent"; }
31  bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
32  ::itk::EventObject *MakeObject() const override { return new Self(m_Algorithm); }
33  const mitk::NonBlockingAlgorithm *GetAlgorithm() const { return m_Algorithm.GetPointer(); }
34  NonBlockingAlgorithmEvent(const Self &s) : itk::AnyEvent(s), m_Algorithm(s.m_Algorithm){};
35 
36  protected:
37  mitk::NonBlockingAlgorithm::ConstPointer m_Algorithm;
38 
39  private:
40  void operator=(const Self &);
41  };
42 
44  {
45  public:
46  ResultAvailable(const NonBlockingAlgorithm *algorithm = nullptr) : NonBlockingAlgorithmEvent(algorithm) {}
47  ~ResultAvailable() override {}
48  };
49 
51  {
52  public:
53  ProcessingError(const NonBlockingAlgorithm *algorithm = nullptr) : NonBlockingAlgorithmEvent(algorithm) {}
54  ~ProcessingError() override {}
55  };
56 }
57 
58 #endif
NonBlockingAlgorithmEvent(const NonBlockingAlgorithm *algorithm=nullptr)
DataCollection - Class to facilitate loading/accessing structured data.
const mitk::NonBlockingAlgorithm * GetAlgorithm() const
ResultAvailable(const NonBlockingAlgorithm *algorithm=nullptr)
const char * GetEventName() const override
bool CheckEvent(const ::itk::EventObject *e) const override
::itk::EventObject * MakeObject() const override
mitk::NonBlockingAlgorithm::ConstPointer m_Algorithm
ProcessingError(const NonBlockingAlgorithm *algorithm=nullptr)