aboutsummaryrefslogtreecommitdiff
path: root/oop2w6/Circuit.h
diff options
context:
space:
mode:
Diffstat (limited to 'oop2w6/Circuit.h')
-rw-r--r--oop2w6/Circuit.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/oop2w6/Circuit.h b/oop2w6/Circuit.h
new file mode 100644
index 0000000..cc406d0
--- /dev/null
+++ b/oop2w6/Circuit.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <iterator>
+
+#include "IComponent.h"
+
+class Circuit {
+private:
+ unsigned size = 0;
+ IComponent* components[16] = { nullptr };
+
+public:
+ virtual void add(IComponent* pComponent);
+ using iterator = IComponent* const *;
+ iterator begin() const { return &components[0]; }
+ iterator end() const { return &components[size]; }
+};
+