Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkFileReaderWriterBase.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 MITKFILEREADERWRITERBASE_H
14 #define MITKFILEREADERWRITERBASE_H
15 
16 #include <mitkCustomMimeType.h>
17 #include <mitkMessage.h>
18 
19 #include <usAny.h>
20 #include <usModuleContext.h>
21 #include <usServiceRegistration.h>
22 
23 #include <memory>
24 
25 namespace mitk
26 {
28  {
29  public:
30  typedef std::map<std::string, us::Any> Options;
32 
34  virtual ~FileReaderWriterBase();
35 
36  Options GetOptions() const;
37  us::Any GetOption(const std::string &name) const;
38 
39  void SetOptions(const Options &options);
40  void SetOption(const std::string &name, const us::Any &value);
41 
42  void SetDefaultOptions(const Options &defaultOptions);
43  Options GetDefaultOptions() const;
44 
55  void SetRanking(int ranking);
56  int GetRanking() const;
57 
58  void SetMimeType(const CustomMimeType &mimeType);
59  const CustomMimeType *GetMimeType() const;
61 
63 
64  void SetMimeTypePrefix(const std::string &prefix);
65  std::string GetMimeTypePrefix() const;
66 
67  void SetDescription(const std::string &description);
68  std::string GetDescription() const;
69 
70  void AddProgressCallback(const ProgressCallback &callback);
71  void RemoveProgressCallback(const ProgressCallback &callback);
72 
74  void UnregisterMimeType();
75 
76  protected:
78 
79  std::string m_Description;
80  int m_Ranking;
81 
82  std::string m_MimeTypePrefix;
83 
89  Options m_Options;
90 
92 
93  // us::PrototypeServiceFactory* m_PrototypeFactory;
94 
96 
97  std::unique_ptr<CustomMimeType> m_CustomMimeType;
99 
100  private:
101  // purposely not implemented
102  FileReaderWriterBase &operator=(const FileReaderWriterBase &other);
103  };
104 }
105 
106 #endif // MITKFILEREADERWRITERBASE_H
us::ServiceRegistration< CustomMimeType > RegisterMimeType(us::ModuleContext *context)
void SetDefaultOptions(const Options &defaultOptions)
void RemoveProgressCallback(const ProgressCallback &callback)
void SetRanking(int ranking)
Set the service ranking for this file reader.
DataCollection - Class to facilitate loading/accessing structured data.
us::Any GetOption(const std::string &name) const
us::ServiceRegistration< CustomMimeType > m_MimeTypeReg
void SetMimeTypePrefix(const std::string &prefix)
void SetDescription(const std::string &description)
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
void SetOptions(const Options &options)
const CustomMimeType * GetMimeType() const
Definition: usAny.h:163
void SetOption(const std::string &name, const us::Any &value)
mitk::MessageAbstractDelegate1< float > ProgressCallback
The MimeType class represens a registered mime-type. It is an immutable wrapper for mitk::CustomMimeT...
Definition: mitkMimeType.h:36
std::map< std::string, us::Any > Options
Options m_Options
Options supported by this reader. Set sensible default values!
void SetMimeType(const CustomMimeType &mimeType)
std::unique_ptr< CustomMimeType > m_CustomMimeType
void AddProgressCallback(const ProgressCallback &callback)