MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkToDCameraMESASR4000ModuleActivator.cpp
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12#ifndef __mitkMESASR4000Activator_h
13#define __mitkMESASR4000Activator_h
14
15// Microservices
16#include <usServiceRegistration.h>
17#include <usModuleActivator.h>
18#include "usModuleContext.h"
19#include <usModuleActivator.h>
20
21//ToF
23#include "mitkToFConfig.h"
25
26namespace mitk
27{
32class MESASR4000ModuleActivator : public us::ModuleActivator {
33public:
34
39 void Load(us::ModuleContext* context)
40 {
41 //Implementing MESASR4000DeviceFactory
42 ToFCameraMESASR4000DeviceFactory* toFCameraMESASR4000DeviceFactory = new ToFCameraMESASR4000DeviceFactory();
43 us::ServiceProperties mitkMESASR4000FactoryProps;
44 mitkMESASR4000FactoryProps["ToFFactoryName"] = toFCameraMESASR4000DeviceFactory->GetFactoryName();
45 context->RegisterService<IToFDeviceFactory>(toFCameraMESASR4000DeviceFactory, mitkMESASR4000FactoryProps);
46
47 toFCameraMESASR4000DeviceFactory->ConnectToFDevice();
48
49 m_Factories.push_back(toFCameraMESASR4000DeviceFactory);
50 }
51
55 void Unload(us::ModuleContext* )
56 {
57 }
58
63 {
64 if(m_Factories.size() > 0)
65 {
66 for(std::list< IToFDeviceFactory* >::iterator it = m_Factories.begin(); it != m_Factories.end(); ++it)
67 {
68 delete (*it);
69 }
70 }
71 }
72
73private:
77 std::list< IToFDeviceFactory* > m_Factories;
78
79};
80}
81US_EXPORT_MODULE_ACTIVATOR(mitk::MESASR4000ModuleActivator)
82#endif
The MESASR4000ModuleActivator class This is the module activator for the "MESASR4000Module" module....
~MESASR4000ModuleActivator()
Default destructor which deletes all registered factories.
void Load(us::ModuleContext *context)
Load This method is automatically called, when the MESASR4000Module is activated. It will automatical...
void Unload(us::ModuleContext *)
Unload called when the module is unloaded.
ToFCameraMESASR4000DeviceFactory is an implementation of the factory pattern to generate MESASR4000De...
std::string GetFactoryName()
Get the name of the factory, here for the ToFPMDCamCube.
IGT Exceptions.
ToFCameraDevice::Pointer ConnectToFDevice()
ConnectToFDevice Use this method to connect a device.
This is the base of class for all ToFDeviceFactories.