Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkFileReaderRegistry.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 mitkFileReaderRegistry_h
14 #define mitkFileReaderRegistry_h
15 
16 #include <MitkCoreExports.h>
17 #include <mitkBaseData.h>
18 
19 #include <mitkIFileReader.h>
20 
21 // Microservices
22 #include <usGetModuleContext.h>
23 #include <usServiceObjects.h>
24 #include <usServiceReference.h>
25 
26 namespace mitk
27 {
28  class MimeType;
29 
40  {
41  public:
43 
46 
54  static MimeType GetMimeTypeForFile(const std::string &path, us::ModuleContext *context = us::GetModuleContext());
55 
56  static std::vector<ReaderReference> GetReferences(const MimeType &mimeType,
57  us::ModuleContext *context = us::GetModuleContext());
58 
59  mitk::IFileReader *GetReader(const ReaderReference &ref, us::ModuleContext *context = us::GetModuleContext());
60 
61  std::vector<mitk::IFileReader *> GetReaders(const MimeType &mimeType,
62  us::ModuleContext *context = us::GetModuleContext());
63 
64  void UngetReader(mitk::IFileReader *reader);
65  void UngetReaders(const std::vector<mitk::IFileReader *> &readers);
66 
67  private:
68  // purposely not implemented
70  FileReaderRegistry &operator=(const FileReaderRegistry &);
71 
72  std::map<mitk::IFileReader *, us::ServiceObjects<mitk::IFileReader>> m_ServiceObjects;
73  };
74 
75 } // namespace mitk
76 
77 #endif
mitk::FileReaderRegistry
Definition: mitkFileReaderRegistry.h:39
usServiceObjects.h
us::GetModuleContext
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
Definition: usGetModuleContext.h:50
mitk::FileReaderRegistry::ReaderReference
us::ServiceReference< IFileReader > ReaderReference
Definition: mitkFileReaderRegistry.h:42
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::IFileReader
The common interface for all MITK file readers.
Definition: mitkIFileReader.h:61
us::ServiceReference
Definition: usModule.h:40
MitkCoreExports.h
mitkIFileReader.h
usServiceReference.h
mitkBaseData.h
usGetModuleContext.h
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::MimeType
The MimeType class represents a registered mime-type. It is an immutable wrapper for mitk::CustomMime...
Definition: mitkMimeType.h:36