summaryrefslogtreecommitdiffstats
path: root/collection.h
diff options
context:
space:
mode:
Diffstat (limited to 'collection.h')
-rw-r--r--collection.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/collection.h b/collection.h
new file mode 100644
index 0000000..e354065
--- /dev/null
+++ b/collection.h
@@ -0,0 +1,26 @@
+#ifndef _COLLECTION_H_
+#define _COLLECTION_H_
+
+class Collection
+{
+ public:
+ virtual ~Collection() {}
+
+ virtual void add(int) = 0;
+ virtual bool remove(int) = 0;
+ virtual Collection& operator=(const Collection&) = 0;
+ virtual int operator[](int) = 0;
+ virtual Collection *copy(void) = 0;
+
+ int get_size(void) const;
+ void iterate(void (*)(int *));
+ virtual bool contains(int) const;
+
+ private:
+ protected:
+ Collection() : size_(0) {}
+ int size_;
+};
+
+#endif
+