refactor StorageClass (and sub-classes) to DataStructure
authorTJ <hacker@iam.tj>
Mon, 13 Apr 2015 15:32:55 +0000 (16:32 +0100)
committerTJ <hacker@iam.tj>
Mon, 13 Apr 2015 15:32:55 +0000 (16:32 +0100)
DataStructures.hpp [moved from StorageClass.hpp with 81% similarity]

similarity index 81%
rename from StorageClass.hpp
rename to DataStructures.hpp
index b2f8c15..ed7b4ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Implementation of Storage Classes for GenericStorageContainerTemplateImpl
+ * Implementation of Data Structures for GenericStorageContainerTemplateImpl
  * Copyright (c) 2014 TJ <hacker@iam.tj>
  *
  *    This program is free software: you can redistribute it and/or modify
@@ -33,14 +33,14 @@ namespace tj
    */
 
   template <typename S>
-  class StorageClass
+  class AbstractDataStructure
   {
     size_t capacity_;
     size_t size_;
 
     public:
-    StorageClass() {};
-    virtual ~StorageClass() {};
+    AbstractDataStructure() {};
+    virtual ~AbstractDataStructure() {};
 
     /* API available to application
      *
@@ -70,7 +70,7 @@ namespace tj
      * @param data the item (of type S) to be stored
      * @param index position to insert; 0 is 'beginning', -1 is 'end'
      *
-     * Depending on the storage class, values of index other than 0 or -1 may have no meaning and be ignored
+     * Depending on the data structure, values of index other than 0 or -1 may have no meaning and be ignored
      */
     virtual bool insert_at(S& data, long index = -1) = 0;
 
@@ -120,26 +120,34 @@ namespace tj
   };
 
 
-  /* Specialised storage class implementing a Dynamic Array
+  /* Specialised data structure implementing a Dynamic Array
    */
-  template <typename SAD>
-  class StorageClass_DynamicArray : StorageClass<SAD> 
+  template <typename AD>
+  class DataStructure_ArrayDynamic : AbstractDataStructure<AD> 
   {
     // TODO: implement
   };
 
-  /* Specialised storage class implementing a 2-way Linked List
+  /* Specialised data structure implementing a 1-way Linked List
    */
-  template <typename SLLD>
-  class StorageClass_LinkedListDouble : StorageClass<SLLD> 
+  template <typename LLS>
+  class DataStructure_LinkedListSingle : AbstractDataStructure<LLS>
   {
     // TODO: implement
   };
 
-  /* Specialised storage class implementing a Binary Search Tree
+  /* Specialised data structure implementing a 2-way Linked List
    */
-  template <typename SBST>
-  class StorageClass_BinarySearchTree : StorageClass<SBST> 
+  template <typename LLD>
+  class DataStructure_LinkedListDouble : DataStructure_LinkedListSingle<LLD> 
+  {
+    // TODO: implement
+  };
+
+  /* Specialised data structure implementing a Binary Search Tree
+   */
+  template <typename BST>
+  class DataStructure_BinarySearchTree : DataStructure<BST> 
   {
     // TODO: implement
   };