Website Summary Files Commits Branches @commit @diff @stats
path: root / Week05 / Exercise01 / NumSeries.h
blob: b7d89a771eee3acb246ca7259dff7e88a34d04ac (plain) (blame)
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
#ifndef NUMSERIES
#define NUMSERIES

class NumSeries {
	double* numbers;
	unsigned allocated;
	unsigned size;

	void free();
	void copyFrom(const NumSeries& other);

	void resize();
public:
	NumSeries();
	~NumSeries();
	NumSeries(const NumSeries& other);
	NumSeries& operator=(const NumSeries& other);

	NumSeries(NumSeries&& other);
	NumSeries& operator=(NumSeries&& other);

	void Push(double element);
	double At(unsigned index) const;
	unsigned Length() const;
};

#endif /* NUMSERIES */