MNE-CPP  beta 1.0
newnumeric.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef NEWNUMERIC_H
37 #define NEWNUMERIC_H
38 
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "xmeas_global.h"
46 #include "newmeasurement.h"
47 
48 
49 //*************************************************************************************************************
50 //=============================================================================================================
51 // Qt INCLUDES
52 //=============================================================================================================
53 
54 #include <QSharedPointer>
55 #include <QMutex>
56 #include <QMutexLocker>
57 
58 
59 //*************************************************************************************************************
60 //=============================================================================================================
61 // DEFINE NAMESPACE XMEASLIB
62 //=============================================================================================================
63 
64 namespace XMEASLIB
65 {
66 
67 
68 //=============================================================================================================
75 {
76  Q_OBJECT
77 public:
78  typedef QSharedPointer<NewNumeric> SPtr;
79  typedef QSharedPointer<const NewNumeric> ConstSPtr;
81  //=========================================================================================================
85  NewNumeric(QObject *parent = 0);
86 
87  //=========================================================================================================
91  virtual ~NewNumeric();
92 
93  //=========================================================================================================
99  inline void setUnit(const QString& unit);
100 
101  //=========================================================================================================
107  inline const QString& getUnit() const;
108 
109  //=========================================================================================================
116  virtual void setValue(double v);
117 
118  //=========================================================================================================
125  virtual double getValue() const;
126 
127 private:
128  mutable QMutex m_qMutex;
130  QString m_qString_Unit;
131  double m_dValue;
132 };
133 
134 
135 //*************************************************************************************************************
136 //=============================================================================================================
137 // INLINE DEFINITIONS
138 //=============================================================================================================
139 
140 inline void NewNumeric::setUnit(const QString& unit)
141 {
142  QMutexLocker locker(&m_qMutex);
143  m_qString_Unit = unit;
144 }
145 
146 
147 //*************************************************************************************************************
148 
149 inline const QString& NewNumeric::getUnit() const
150 {
151  QMutexLocker locker(&m_qMutex);
152  return m_qString_Unit;
153 }
154 
155 } // NAMESPACE
156 
157 Q_DECLARE_METATYPE(XMEASLIB::NewNumeric::SPtr)
158 
159 #endif // NUMERIC_H
Contains the declaration of the NewMeasurement class.
#define XMEASSHARED_EXPORT
Definition: xmeas_global.h:54
QSharedPointer< const NewNumeric > ConstSPtr
Definition: newnumeric.h:79
const QString & getUnit() const
Definition: newnumeric.h:149
void setUnit(const QString &unit)
Definition: newnumeric.h:140
Contains the xMeas library export/import macros.
QSharedPointer< NewNumeric > SPtr
Definition: newnumeric.h:78
The Numeric class provides a Numeric Measurement.
Definition: newnumeric.h:74