Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitkFileWriterRegistry.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 mitkFileWriterRegistry_h
14 #define mitkFileWriterRegistry_h
15 
16 #include <MitkCoreExports.h>
17 
18 // Microservices
19 #include <usGetModuleContext.h>
20 #include <usServiceObjects.h>
21 #include <usServiceReference.h>
22 
23 #include "mitkIFileWriter.h"
24 
25 namespace mitk
26 {
27  class BaseData;
28 }
29 
30 namespace mitk
31 {
42  {
43  public:
45 
48 
49  static std::vector<WriterReference> GetReferences(const BaseData *baseData,
50  us::ModuleContext *context = us::GetModuleContext());
51  static std::vector<WriterReference> GetReferences(const BaseData *baseData,
52  const std::string &mimeType,
53  us::ModuleContext *context = us::GetModuleContext());
54 
55  IFileWriter *GetWriter(const WriterReference &ref, us::ModuleContext *context = us::GetModuleContext());
56 
57  std::vector<IFileWriter *> GetWriters(const BaseData *baseData,
58  const std::string &mimeType,
59  us::ModuleContext *context = us::GetModuleContext());
60 
61  void UngetWriter(IFileWriter *writer);
62  void UngetWriters(const std::vector<IFileWriter *> &writers);
63 
64  private:
65  // purposely not implemented
67  FileWriterRegistry &operator=(const FileWriterRegistry &);
68 
69  std::map<IFileWriter *, us::ServiceObjects<IFileWriter>> m_ServiceObjects;
70  };
71 
72 } // namespace mitk
73 
74 #endif
usServiceObjects.h
us::GetModuleContext
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
Definition: usGetModuleContext.h:50
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
us::ServiceReference
Definition: usModule.h:40
mitk::IFileWriter
The common interface of all MITK file writers.
Definition: mitkIFileWriter.h:56
mitkIFileWriter.h
MitkCoreExports.h
usServiceReference.h
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
usGetModuleContext.h
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::FileWriterRegistry::WriterReference
us::ServiceReference< IFileWriter > WriterReference
Definition: mitkFileWriterRegistry.h:44
mitk::FileWriterRegistry
Definition: mitkFileWriterRegistry.h:41