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