File: msrowdataext.h

package info (click to toggle)
aoflagger 2.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,232 kB
  • sloc: cpp: 61,805; python: 60; sh: 23; makefile: 8
file content (72 lines) | stat: -rw-r--r-- 2,053 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef MS_ROW_DATAEXT_H
#define MS_ROW_DATAEXT_H

#include "msrowdata.h"

#include "../util/serializable.h"

class MSRowDataExt : public Serializable
{
	public:
		MSRowDataExt() = default;
		
		MSRowDataExt(unsigned polarizationCount, unsigned channelCount) :
			_data(polarizationCount, channelCount),
			_antenna1(),
			_antenna2(),
			_timeOffsetIndex(),
			_u(), _v(), _w(),
			_time()
		{
		}
		
		const MSRowData &Data() const { return _data; }
		MSRowData &Data() { return _data; }
		unsigned Antenna1() const { return _antenna1; }
		unsigned Antenna2() const { return _antenna2; }
		double U() const { return _u; }
		double V() const { return _v; }
		double W() const { return _w; }
		double Time() const { return _time; }
		size_t TimeOffsetIndex() const { return _timeOffsetIndex; }
		
		void SetU(double u) { _u = u; }
		void SetV(double v) { _v = v; }
		void SetW(double w) { _w = w; }
		void SetAntenna1(double antenna1) { _antenna1 = antenna1; }
		void SetAntenna2(double antenna2) { _antenna2 = antenna2; }
		void SetTime(double time) { _time = time; }
		void SetTimeOffsetIndex(size_t timeOffsetIndex) { _timeOffsetIndex = timeOffsetIndex; }
		
		virtual void Serialize(std::ostream &stream) const final override
		{
			_data.Serialize(stream);
			SerializeToUInt32(stream, _antenna1);
			SerializeToUInt32(stream, _antenna2);
			SerializeToUInt64(stream, _timeOffsetIndex);
			SerializeToDouble(stream, _u);
			SerializeToDouble(stream, _v);
			SerializeToDouble(stream, _w);
			SerializeToDouble(stream, _time);
		}
		
		virtual void Unserialize(std::istream &stream) final override
		{
			_data.Unserialize(stream);
			_antenna1 = UnserializeUInt32(stream);
			_antenna2 = UnserializeUInt32(stream);
			_timeOffsetIndex = UnserializeUInt64(stream);
			_u = UnserializeDouble(stream);
			_v = UnserializeDouble(stream);
			_w = UnserializeDouble(stream);
			_time = UnserializeDouble(stream);
		}
	private:
		MSRowData _data;
		unsigned _antenna1, _antenna2;
		size_t _timeOffsetIndex;
		double _u, _v, _w;
		double _time;
};

#endif