Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkUSUICustomWidgetFactory.cpp
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 
18 
20 
21 #include <usModuleContext.h>
22 
24  : m_Prototype(prototype)
25 {
26 }
27 
29 {
30  return context->RegisterService<QmitkUSAbstractCustomWidget>(m_Prototype, m_Prototype->GetServiceProperties());
31 }
32 
34 {
35  // clone the prototype for returning a uniqe instance
36  return us::MakeInterfaceMap<QmitkUSAbstractCustomWidget>(m_Prototype->Clone());
37 }
38 
40 {
41  // just delete the given service
42  delete us::ExtractInterface<QmitkUSAbstractCustomWidget>(service);
43 }
std::map< std::string, void * > InterfaceMap
us::ServiceProperties GetServiceProperties() const
Returns the properties of the micro service. Properties consist of just the device class of the corre...
void UngetService(us::Module *, const us::ServiceRegistrationBase &, const us::InterfaceMap &service) override
USUICustomWidgetFactory(QmitkUSAbstractCustomWidget *prototype)
us::ServiceRegistration< QmitkUSAbstractCustomWidget > RegisterService(us::ModuleContext *context)
Registers this factory in the given module context.
Abstract superclass for all custom control widgets of mitk::USDevice classes.
us::InterfaceMap GetService(us::Module *, const us::ServiceRegistrationBase &) override