MNE-CPP  beta 1.0
pluginoutputdata.h
1 //=============================================================================================================
35 #ifndef PLUGINOUTPUTDATA_H
36 #define PLUGINOUTPUTDATA_H
37 
38 //*************************************************************************************************************
39 //=============================================================================================================
40 // INCLUDES
41 //=============================================================================================================
42 
43 #include "../mne_x_global.h"
44 #include "pluginoutputconnector.h"
45 
46 
47 //*************************************************************************************************************
48 //=============================================================================================================
49 // Qt INCLUDES
50 //=============================================================================================================
51 
52 #include <QSharedPointer>
53 #include <QMetaType>
54 
55 
56 //*************************************************************************************************************
57 //=============================================================================================================
58 // DEFINE NAMESPACE MNEX
59 //=============================================================================================================
60 
61 namespace MNEX
62 {
63 
64 
65 //=========================================================================================================
71 template <class T>
73 {
74 public:
75  typedef QSharedPointer<PluginOutputData<T> > SPtr;
76  typedef QSharedPointer<const PluginOutputData<T> > ConstSPtr;
78  //=========================================================================================================
86  PluginOutputData(IPlugin *parent, const QString &name, const QString &descr);
87 
88  //=========================================================================================================
92  virtual ~PluginOutputData(){}
93 
94  //=========================================================================================================
104  static inline QSharedPointer< PluginOutputData<T> > create(IPlugin *parent, const QString &name, const QString &descr);
105 
106  //=========================================================================================================
112  inline QSharedPointer<T> &data();
113 
114  void update();
115 
116 private:
117  QSharedPointer<T> m_pMeasurement;
118 };
119 
120 //*************************************************************************************************************
121 //=============================================================================================================
122 // INLINE DEFINITIONS
123 //=============================================================================================================
124 
125 template <class T>
126 inline QSharedPointer< PluginOutputData<T> > PluginOutputData<T>::create(IPlugin *parent, const QString &name, const QString &descr)
127 {
128  QSharedPointer< PluginOutputData<T> > pPluginOutputData(new PluginOutputData<T>(parent, name, descr));
129  return pPluginOutputData;
130 }
131 
132 //*************************************************************************************************************
133 
134 template <class T>
135 inline QSharedPointer<T> &PluginOutputData<T>::data()
136 {
137  return m_pMeasurement;
138 }
139 
140 } // NAMESPACE
141 
142 //Make the template definition visible to compiler in the first point of instantiation
143 #include "pluginoutputdata.cpp"
144 
145 #endif // PLUGININPUTDATA_H
Contains the declaration of the PluginOutputData 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.
QSharedPointer< PluginOutputData< T > > SPtr
Contains the declaration of the PluginOutputConnector class.
Definition: arrow.h:75
PluginOutputConnector with specified Measurement.
QSharedPointer< const PluginOutputData< T > > ConstSPtr
PluginOutputData(IPlugin *parent, const QString &name, const QString &descr)
static QSharedPointer< PluginOutputData< T > > create(IPlugin *parent, const QString &name, const QString &descr)
QSharedPointer< T > & data()