Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
Home
Manual
API Reference
Download
Bugzilla
Groups
Namespace List
Class List
File List
Examples
File List
File Members
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
17
#include "
mitkUSUICustomWidgetFactory.h
"
18
19
#include "
QmitkUSAbstractCustomWidget.h
"
20
21
#include <
usModuleContext.h
>
22
23
mitk::USUICustomWidgetFactory::USUICustomWidgetFactory
(
QmitkUSAbstractCustomWidget
* prototype)
24
: m_Prototype(prototype)
25
{
26
}
27
28
us::ServiceRegistration<QmitkUSAbstractCustomWidget>
mitk::USUICustomWidgetFactory::RegisterService
(us::ModuleContext* context)
29
{
30
return
context->RegisterService<
QmitkUSAbstractCustomWidget
>(m_Prototype, m_Prototype->
GetServiceProperties
());
31
}
32
33
us::InterfaceMap
mitk::USUICustomWidgetFactory::GetService
(
us::Module
*
/*module*/
,
const
us::ServiceRegistrationBase
&
/*registration*/
)
34
{
35
// clone the prototype for returning a uniqe instance
36
return
us::MakeInterfaceMap<QmitkUSAbstractCustomWidget>
(m_Prototype->Clone());
37
}
38
39
void
mitk::USUICustomWidgetFactory::UngetService
(
us::Module
*,
const
us::ServiceRegistrationBase
&,
const
us::InterfaceMap
& service)
40
{
41
// just delete the given service
42
delete
us::ExtractInterface<QmitkUSAbstractCustomWidget>(service);
43
}
mitkUSUICustomWidgetFactory.h
us::InterfaceMap
std::map< std::string, void * > InterfaceMap
Definition:
usServiceInterface.h:138
QmitkUSAbstractCustomWidget::GetServiceProperties
us::ServiceProperties GetServiceProperties() const
Returns the properties of the micro service. Properties consist of just the device class of the corre...
Definition:
QmitkUSAbstractCustomWidget.cpp:58
mitk::USUICustomWidgetFactory::UngetService
void UngetService(us::Module *, const us::ServiceRegistrationBase &, const us::InterfaceMap &service) override
Definition:
mitkUSUICustomWidgetFactory.cpp:39
us::ServiceRegistration< QmitkUSAbstractCustomWidget >
mitk::USUICustomWidgetFactory::USUICustomWidgetFactory
USUICustomWidgetFactory(QmitkUSAbstractCustomWidget *prototype)
Definition:
mitkUSUICustomWidgetFactory.cpp:23
mitk::USUICustomWidgetFactory::RegisterService
us::ServiceRegistration< QmitkUSAbstractCustomWidget > RegisterService(us::ModuleContext *context)
Registers this factory in the given module context.
Definition:
mitkUSUICustomWidgetFactory.cpp:28
us::Module
Definition:
usModule.h:78
QmitkUSAbstractCustomWidget
Abstract superclass for all custom control widgets of mitk::USDevice classes.
Definition:
QmitkUSAbstractCustomWidget.h:78
QmitkUSAbstractCustomWidget.h
mitk::USUICustomWidgetFactory::GetService
us::InterfaceMap GetService(us::Module *, const us::ServiceRegistrationBase &) override
Definition:
mitkUSUICustomWidgetFactory.cpp:33
us::MakeInterfaceMap
Definition:
usServiceInterface.h:179
us::ServiceRegistrationBase
Definition:
usServiceRegistrationBase.h:56
usModuleContext.h
git
MITK
Modules
USUI
mitkUSUICustomWidgetFactory.cpp
Generated on Fri Feb 3 2017 20:52:11 for Medical Imaging Interaction Toolkit by
1.8.9.1