Website Summary Files Commits Branches @commit @diff @stats
path: root / Week05 / Exercise01 / NumSeries.h
diff options
context:
space:
mode:
1 files changed, 27 insertions, 0 deletions
-rw-r--r--Week05/Exercise01/NumSeries.h27
diff --git a/Week05/Exercise01/NumSeries.h b/Week05/Exercise01/NumSeries.h
new file mode 100644
index 0000000..b7d89a7
--- /dev/null
+++ b/Week05/Exercise01/NumSeries.h
@@ -0,0 +1,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 */