NorMIT-nav  22.09
An IGT application
cxStreamerService.h
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 #ifndef CXSTREAMERINTERFACE_H
12 #define CXSTREAMERINTERFACE_H
13 
14 #include "cxResourceExport.h"
15 
16 #include "boost/shared_ptr.hpp"
17 #include <QObject>
18 #include <QDomElement>
19 #include "cxProperty.h"
20 #include <vector>
21 class QWidget;
22 
23 #define StreamerService_iid "cx::StreamerService"
24 
25 namespace cx
26 {
27 
28 // Use of smart pointer not possible for plugin service. Replace with serviceAdded and serviceRemoved signals using regular pointers
29 // The smart pointer can still be used if StreamerService is coming from another source than a ctk plugin
30 typedef boost::shared_ptr<class StreamerService> StreamerServicePtr;
31 typedef boost::shared_ptr<class Streamer> StreamerPtr;
32 typedef boost::shared_ptr<class Receiver> ReceiverPtr;
33 
42 class cxResource_EXPORT StreamerService : public QObject
43 {
44  Q_OBJECT
45 public:
46  static StreamerServicePtr getNullObject();
47 
49  virtual QString getName() = 0;
50  virtual QString getType() const = 0;
51 // virtual void testZZZ() {} //TODO: Check - uncommenting this cause seg fault??? Also moving stop() line (62) up here causes seg fault.
57  virtual std::vector<PropertyPtr> getSettings(QDomElement root) = 0;
61  virtual StreamerPtr createStreamer(QDomElement root) = 0;
62  virtual void stop() = 0;
63 };
64 
73 class cxResource_EXPORT SimulatedStreamerService : public StreamerService
74 {
75  Q_OBJECT
76 public:
78 
79 public slots:
80  virtual void setImageToStream(QString imageUid) = 0;
81 };
82 
83 } //end namespace cx
84 Q_DECLARE_INTERFACE(cx::StreamerService, StreamerService_iid)
85 
86 #endif // CXSTREAMERINTERFACE_H
cx::SimulatedStreamerService
Abstract class. Interface to Simulated Streamers.
Definition: cxStreamerService.h:73
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::StreamerService::StreamerService
StreamerService()
Definition: cxStreamerService.h:48
StreamerService_iid
#define StreamerService_iid
Definition: cxStreamerService.h:23
cx::StreamerServicePtr
boost::shared_ptr< class StreamerService > StreamerServicePtr
Definition: cxPlusConnectWidget.h:26
cx::SimulatedStreamerService::SimulatedStreamerService
SimulatedStreamerService()
Definition: cxStreamerService.h:77
cxProperty.h
cx::ReceiverPtr
boost::shared_ptr< class Receiver > ReceiverPtr
Definition: cxStreamerService.h:32
cx::StreamerService
Abstract class. Interface to Streamers.
Definition: cxStreamerService.h:42
cx::StreamerPtr
boost::shared_ptr< class Streamer > StreamerPtr
Definition: cxImageReceiverThread.h:29