NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkIGIDataSourceFactoryServiceRAII.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkIGIDataSourceFactoryServiceRAII_h
16 #define niftkIGIDataSourceFactoryServiceRAII_h
17 
18 #include "niftkIGIDataSourcesExports.h"
20 #include "niftkIGIDataSourceI.h"
21 
22 #include <usServiceReference.h>
23 #include <usModuleContext.h>
24 
25 namespace niftk
26 {
27 
34 class NIFTKIGIDATASOURCES_EXPORT IGIDataSourceFactoryServiceRAII
35 {
36 
37 public:
38 
42  IGIDataSourceFactoryServiceRAII(const QString& factoryName);
43 
48 
52  IGIDataSourceI::Pointer CreateService(mitk::DataStorage::Pointer dataStorage,
53  const IGIDataSourceProperties& properties);
54 
55 private:
56  IGIDataSourceFactoryServiceRAII(const IGIDataSourceFactoryServiceRAII&); // deliberately not implemented
57  IGIDataSourceFactoryServiceRAII& operator=(const IGIDataSourceFactoryServiceRAII&); // deliberately not implemented
58 
59  us::ModuleContext* m_ModuleContext;
60  std::vector<us::ServiceReference<IGIDataSourceFactoryServiceI> > m_Refs;
62 };
63 
64 } // end namespace
65 
66 #endif
RAII object to retrieve a specific IGIDataSourceFactoryServiceI subclass.
Definition: niftkIGIDataSourceFactoryServiceRAII.h:34
QMap< QString, QVariant > IGIDataSourceProperties
Definition: niftkIGIDataSourceI.h:33
Definition: niftkExceptionObject.h:21
Interface for a factory to create niftk::IGIDataSourceServiceI.
Definition: niftkIGIDataSourceFactoryServiceI.h:38