MNE-CPP  beta 1.0
plugininputdata.cpp
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef PLUGININPUTDATA_CPP //Because this cpp is part of the header -> template
37 #define PLUGININPUTDATA_CPP
38 
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "plugininputdata.h"
46 
47 //*************************************************************************************************************
48 //=============================================================================================================
49 // DEFINE NAMESPACE MNEX
50 //=============================================================================================================
51 
52 namespace MNEX
53 {
54 
55 //*************************************************************************************************************
56 //=============================================================================================================
57 // USED NAMESPACES
58 //=============================================================================================================
59 
60 
61 //*************************************************************************************************************
62 //=============================================================================================================
63 // DEFINE MEMBER METHODS
64 //=============================================================================================================
65 
66 template <class T>
67 PluginInputData<T>::PluginInputData(IPlugin *parent, const QString &name, const QString &descr)
68 : PluginInputConnector(parent, name, descr)
69 , m_pFunc(NULL)
70 {
71 }
72 
73 
74 //*************************************************************************************************************
75 
76 template <class T>
77 void PluginInputData<T>::setCallbackMethod(callback_function pFunc)
78 {
79  m_pFunc = pFunc;
80  connect(this, &PluginInputConnector::notify, this, &PluginInputData<T>::notifyCallbackFunction);
81 }
82 
83 
84 //*************************************************************************************************************
85 
86 template <class T>
88 {
89  qDebug() << "Here in input data.";
90  if(m_pFunc)
91  {
92  QSharedPointer<T> measurement = pMeasurement.dynamicCast<T>();
93 
94  (*m_pFunc)(measurement);
95  }
96 }
97 
98 }//Namespace
99 
100 #endif //PLUGININPUTDATA_CPP
void setCallbackMethod(callback_function pFunc)
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.
Contains the declaration of the PluginInputData class.
Definition: arrow.h:75
QSharedPointer< NewMeasurement > SPtr
PluginInputData(IPlugin *parent, const QString &name, const QString &descr)
void notifyCallbackFunction(XMEASLIB::NewMeasurement::SPtr pMeasurement)