QDaq  0.2.6
Qt-based Data Aqcuisition
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
vectorprototype.h
1 #ifndef VECTORPROTOTYPE_H
2 #define VECTORPROTOTYPE_H
3 
4 #include "QDaqVector.h"
5 #include <QtCore/QObject>
6 #include <QtScript/QScriptable>
7 #include <QtScript/QScriptValue>
8 
46 class VectorPrototype : public QObject, public QScriptable
47 {
48  Q_OBJECT
49 
50 public:
51  VectorPrototype(QObject *parent = 0);
52  ~VectorPrototype();
53 
54 public slots:
55 
57  bool equals(const QDaqVector &other);
58 
60  QScriptValue valueOf() const;
61 
62  QScriptValue toArray() const;
63 
64  void clear();
65 
67  void push(const QScriptValue& val);
69  void pop();
71  void resize(int n);
72 
73  double min() const;
74  double max() const;
75  double mean() const;
76  double std() const;
77 
78  QDaqVector clone() const { return thisVector()->clone(); }
79 
80 
81  QString toString() const;
82 
83 private:
84  QDaqVector *thisVector() const;
85 
86  bool checkRange(int offset, int sz) const;
87 };
89 
90 
91 #endif
bool equals(const QDaqVector &other)
Returns true if this Vector is equal to other.
The prototype for the Vector class.
A buffer for storing double numbers.
Definition: QDaqVector.h:40
QScriptValue valueOf() const
Return the data stored by the object.
void pop()
Remove the last element.
void push(const QScriptValue &val)
Push a number, a Vector or a numeric Array at the end.
void resize(int n)
Resize to n elements keeping the first n.