Medical Imaging Interaction Toolkit  2016.11.0
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,
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 FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521
18 #define FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521
19 
20 #include <MitkCoreExports.h>
21 
22 // Microservices
23 #include <usGetModuleContext.h>
24 #include <usServiceObjects.h>
25 #include <usServiceReference.h>
26 
27 #include "mitkIFileWriter.h"
28 
29 namespace mitk
30 {
31  class BaseData;
32 }
33 
34 namespace mitk
35 {
46  {
47  public:
49 
52 
53  static std::vector<WriterReference> GetReferences(const BaseData *baseData,
54  us::ModuleContext *context = us::GetModuleContext());
55  static std::vector<WriterReference> GetReferences(const BaseData *baseData,
56  const std::string &mimeType,
57  us::ModuleContext *context = us::GetModuleContext());
58 
59  IFileWriter *GetWriter(const WriterReference &ref, us::ModuleContext *context = us::GetModuleContext());
60 
61  std::vector<IFileWriter *> GetWriters(const BaseData *baseData,
62  const std::string &mimeType,
63  us::ModuleContext *context = us::GetModuleContext());
64 
65  void UngetWriter(IFileWriter *writer);
66  void UngetWriters(const std::vector<IFileWriter *> &writers);
67 
68  private:
69  // purposely not implemented
71  FileWriterRegistry &operator=(const FileWriterRegistry &);
72 
73  std::map<IFileWriter *, us::ServiceObjects<IFileWriter>> m_ServiceObjects;
74  };
75 
76 } // namespace mitk
77 
78 #endif /* FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521 */
#define MITKCORE_EXPORT
us::ServiceReference< IFileWriter > WriterReference
Base of all data objects.
Definition: mitkBaseData.h:39
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.