Added Queue and Set stubs
authorPatrik Gornicz <Gornicz.P@gmail.com>
Sun, 2 Aug 2009 04:42:02 +0000 (00:42 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Sun, 2 Aug 2009 04:44:01 +0000 (00:44 -0400)
lib/include/bear/Queue.h [new file with mode: 0644]
lib/include/bear/Set.h [new file with mode: 0644]

diff --git a/lib/include/bear/Queue.h b/lib/include/bear/Queue.h
new file mode 100644 (file)
index 0000000..21df35b
--- /dev/null
@@ -0,0 +1,121 @@
+/* 
+ * File:   Queue.h
+ * Author: patrik
+ *
+ * Created on August 1, 2009, 7:12 PM
+ */
+
+#pragma once
+
+// HACK
+#ifndef NULL
+#define NULL 0
+#endif
+
+namespace bear
+{
+    /// ***** Header Class *****
+
+    template < class Item >
+    class Queue
+    {
+    public:
+         Queue();
+        ~Queue() {}
+
+        void init(int iStartSize = 2, int iSizeMultiplier = 2);
+        void fini();
+
+        void alloc(int iSize);
+        void trim();
+
+        bool isEmpty() const;
+
+        Item& getFront();
+        Item& getBack();
+
+        void pushFront(const Item& i);
+        void popBack(const Item& i);
+
+    private:
+        int     m_iStartSize;
+        int     m_iSizeMultiplier;
+
+        int     m_iAllocated;
+        Item*   m_pArrayItems;
+
+        int     m_iHead;
+        int     m_iTail;
+    };
+
+} // namespace bear
+
+template < class Item >
+bear::Queue<Item>::Queue()
+    :   m_iStartSize(0),
+        m_iSizeMultiplier(0),
+        m_iAllocated(0),
+        m_pArrayItems(NULL),
+        m_iHead(0),
+        m_iTail(0)
+{
+
+}
+
+template < class Item >
+void bear::Queue<Item>::init
+(
+    int iStartSize,
+    int iSizeMultiplier
+)
+{
+    m_iStartSize        = iStartSize;
+    m_iSizeMultiplier   = iSizeMultiplier;
+}
+template < class Item >
+void bear::Queue<Item>::fini()
+{
+
+}
+
+template < class Item >
+void bear::Queue<Item>::alloc(int iSize)
+{
+
+}
+template < class Item >
+void bear::Queue<Item>::trim()
+{
+
+}
+
+template < class Item >
+bool bear::Queue<Item>::isEmpty() const
+{
+    return false;
+}
+
+template < class Item >
+Item& bear::Queue<Item>::getFront()
+{
+
+}
+
+template < class Item >
+Item& bear::Queue<Item>::getBack()
+{
+
+}
+
+template < class Item >
+void bear::Queue<Item>::pushFront(const Item& i)
+{
+
+}
+
+template < class Item >
+void bear::Queue<Item>::popBack(const Item& i)
+{
+
+}
+
diff --git a/lib/include/bear/Set.h b/lib/include/bear/Set.h
new file mode 100644 (file)
index 0000000..71fa0f4
--- /dev/null
@@ -0,0 +1,23 @@
+/* 
+ * Author: Patrik Gornicz
+ *
+ * Created on August 1, 2009, 6:53 PM
+ */
+
+#ifndef _SET_H
+#define        _SET_H
+
+namespace bear
+{
+    /// ***** Header Class *****
+
+    class Set
+    {
+        // TODO
+    };
+
+} // namespace bear
+
+
+#endif // _SET_H
+