NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxStreamerServiceUtilities.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
13 
14 #include <QList>
15 #include <ctkServiceTracker.h>
16 #include <iostream>
17 #include "cxTypeConversions.h"
18 
19 namespace cx
20 {
22 {
23  ctkServiceTracker<StreamerService*> tracker(context);
24  tracker.open();
25 
26  QList<StreamerService*> serviceList = tracker.getServices();
27 
28  for(int i = 0; i < serviceList.size(); ++i)
29  {
30  StreamerService* service = serviceList.at(i);
31  if (service->getType() == name)
32  return service;
33  }
34 
35  return NULL;
36 }
37 } /* namespace cx */
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxStreamerServiceUtilities.h
cxTypeConversions.h
cx::StreamerServiceUtilities::getStreamerServiceFromType
static StreamerService * getStreamerServiceFromType(QString name, ctkPluginContext *context)
Definition: cxStreamerServiceUtilities.cpp:21
cx::StreamerService
Abstract class. Interface to Streamers.
Definition: cxStreamerService.h:42
cx::StreamerService::getType
virtual QString getType() const =0