MITK-IGT
IGT Extension of MITK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mitkIGTLModuleActivator.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
13#include <usGetModuleContext.h>
14#include <usModuleActivator.h>
15#include <usModuleContext.h>
16#include <usModule.h>
17
19
20namespace mitk
21{
22
26 class IGTLModuleActivator : public us::ModuleActivator
27 {
28 public:
29
30 void Load(us::ModuleContext* context) override
31 {
32 // First create and register a instance.
33 m_Measurement = IGTLMeasurements::New();
34 m_MeasurementReg = context->RegisterService<IGTLMeasurements>(m_Measurement);
35 }
36
37 void Unload(us::ModuleContext*) override
38 {
39 m_MeasurementReg.Unregister();
40 //delete m_Measurement;
41 //m_Measurement.
42 }
43
44 private:
45 IGTLMeasurements::Pointer m_Measurement;
46 us::ServiceRegistration<IGTLMeasurements> m_MeasurementReg;
47 };
48}
49
50US_EXPORT_MODULE_ACTIVATOR(mitk::IGTLModuleActivator)
Is a helper class to make measurments for latency and fps.
Registers services for IGTL module.
void Unload(us::ModuleContext *) override
void Load(us::ModuleContext *context) override
IGT Exceptions.