blob: d9486af42ad3a1deee86a03c8216ac60b301ac70 [file] [log] [blame]
Thomas Tsou20eb6d62013-11-09 14:30:41 -05001#ifndef _SIGNALVECTOR_H_
2#define _SIGNALVECTOR_H_
3
4#include <Vector.h>
5#include <Complex.h>
6
7/** Vector symmetry */
8enum Symmetry {
9 NONE = 0,
10 ABSSYM = 1
11};
12
13class signalVector: public Vector<complex> {
14public:
15 /** Default constructor */
Pau Espin Pedrolf7331762018-12-03 17:46:04 +010016 signalVector(size_t size = 0, vector_alloc_func wAllocFunc = NULL, vector_free_func wFreeFunc = NULL);
Thomas Tsou20eb6d62013-11-09 14:30:41 -050017
18 /** Construct with head room */
Pau Espin Pedrolf7331762018-12-03 17:46:04 +010019 signalVector(size_t size, size_t start, vector_alloc_func wAllocFunc = NULL, vector_free_func wFreeFunc = NULL);
Thomas Tsou20eb6d62013-11-09 14:30:41 -050020
21 /** Construct from existing buffer data (buffer not managed) */
Pau Espin Pedrolf7331762018-12-03 17:46:04 +010022 signalVector(complex *data, size_t start, size_t span, vector_alloc_func wAllocFunc = NULL, vector_free_func wFreeFunc = NULL);
Thomas Tsou20eb6d62013-11-09 14:30:41 -050023
24 /** Construct by from existing vector */
25 signalVector(const signalVector &vector);
26
27 /** Construct by from existing vector and append head-tail room */
28 signalVector(const signalVector &vector, size_t start, size_t tail = 0);
29
30 /** Override base assignment operator to include start offsets */
31 void operator=(const signalVector& vector);
32
Alexander Chemerise56bf3a2017-03-17 22:34:20 -070033 /** Return an alias to a segment of this signalVector. */
34 signalVector segment(size_t start, size_t span);
35
Thomas Tsou20eb6d62013-11-09 14:30:41 -050036 /** Return head room */
37 size_t getStart() const;
Tom Tsou28670fb2015-08-21 19:32:58 -070038 size_t updateHistory();
Thomas Tsou20eb6d62013-11-09 14:30:41 -050039
40 Symmetry getSymmetry() const;
41 void setSymmetry(Symmetry symmetry);
42
43 bool isReal() const;
44 void isReal(bool real);
45
46 bool isAligned() const;
47 void setAligned(bool aligned);
48
49private:
Thomas Tsou20eb6d62013-11-09 14:30:41 -050050 bool real;
51 bool aligned;
Thomas Tsou3f32ab52013-11-15 16:32:54 -050052 Symmetry symmetry;
Thomas Tsou20eb6d62013-11-09 14:30:41 -050053};
54
55#endif /* _SIGNALVECTOR_H_ */