MNE-CPP  beta 1.0
pluginoutputdata.cpp
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef PLUGINOUTPUTDATA_CPP //Because this cpp is part of the header -> template
37 #define PLUGINOUTPUTDATA_CPP
38 
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "pluginoutputdata.h"
46 
47 #include <xMeas/newmeasurement.h>
48 
49 #include <QDebug>
50 #include <QSharedPointer>
51 
52 
53 //*************************************************************************************************************
54 //=============================================================================================================
55 // DEFINE NAMESPACE MNEX
56 //=============================================================================================================
57 
58 namespace MNEX
59 {
60 
61 //*************************************************************************************************************
62 //=============================================================================================================
63 // USED NAMESPACES
64 //=============================================================================================================
65 
66 
67 
68 //*************************************************************************************************************
69 //=============================================================================================================
70 // DEFINE MEMBER METHODS
71 //=============================================================================================================
72 
73 template <class T>
74 PluginOutputData<T>::PluginOutputData(IPlugin *parent, const QString &name, const QString &descr)
75 : PluginOutputConnector(parent, name, descr)
76 {
77  m_pMeasurement = QSharedPointer<T>(new T);
78 
79  QSharedPointer<XMEASLIB::NewMeasurement> t_measurement = qSharedPointerDynamicCast<XMEASLIB::NewMeasurement>(m_pMeasurement);
80 
81  if(t_measurement.isNull())
82  qFatal("Template type is not a measurement and therefor not supported!");
83  else
84  connect(t_measurement.data(), &XMEASLIB::NewMeasurement::notify, this, &PluginOutputData<T>::update, Qt::DirectConnection);
85 }
86 
87 
88 //*************************************************************************************************************
89 
90 template <class T>
92 {
93  emit notify(qSharedPointerDynamicCast<XMEASLIB::NewMeasurement>(m_pMeasurement));
94 }
95 
96 }//Namespace
97 
98 #endif //PLUGINOUTPUTDATA_CPP
Contains the declaration of the NewMeasurement class.
The IPlugin class is the base interface class of all plugins.
Definition: IPlugin.h:92
The PluginConnector class provides the base to connect plug-in data.
Definition: arrow.h:75
PluginOutputConnector with specified Measurement.
PluginOutputData(IPlugin *parent, const QString &name, const QString &descr)