Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitkITKEventObserverGuard.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 mitkITKEventObserverGuard_h
14 #define mitkITKEventObserverGuard_h
15 
16 #include <functional>
17 #include <memory>
18 #include "MitkCoreExports.h"
19 
20 namespace itk
21 {
22  class Object;
23  class Command;
24  class EventObject;
25 }
26 
27 namespace mitk
28 {
56  {
57  public:
59  ITKEventObserverGuard(const itk::Object* sender, unsigned long observerTag);
60  ITKEventObserverGuard(const itk::Object* sender, const itk::EventObject& event, itk::Command* command);
61  ITKEventObserverGuard(const itk::Object* sender, const itk::EventObject& event, std::function<void(const itk::EventObject&)> function);
64 
66 
69  void Reset();
70 
73  void Reset(const itk::Object* sender, unsigned long observerTag);
74 
77  void Reset(const itk::Object* sender, const itk::EventObject& event, itk::Command* command);
78 
81  void Reset(const itk::Object* sender, const itk::EventObject& event, std::function<void(const itk::EventObject&)> function);
82 
83  bool IsInitialized() const;
84 
85  private:
86  struct Impl;
87  std::unique_ptr<Impl> m_ITKEventObserverGuardImpl;
88  };
89 
90 
91 }
92 
93 #endif
mitk::ITKEventObserverGuard
Convenience class that helps to manage the lifetime of itk event observers.
Definition: mitkITKEventObserverGuard.h:55
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
MitkCoreExports.h
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15