Medical Imaging Interaction Toolkit  2022.04.99-3f7a773b
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 FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521
14 #define FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521
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 /* FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521 */
#define MITKCORE_EXPORT
us::ServiceReference< IFileWriter > WriterReference
Base of all data objects.
Definition: mitkBaseData.h:42
DataCollection - Class to facilitate loading/accessing structured data.
The common interface of all MITK file writers.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.