![]() |
Data Abstraction and Problem Solving with C++Walls and Mirrorsby Frank M. Carrano |
![]() |
TableB.hGo to the documentation of this file.00001 00018 #include "TableException.h" 00019 #include "BST.h" // binary search tree operations 00020 00021 typedef TreeItemType TableItemType; 00022 00028 class Table 00029 { 00030 public: 00032 Table(); 00033 // copy constructor is supplied by the compiler 00035 virtual ~Table(); 00036 00037 // Table operations: 00038 virtual bool tableIsEmpty() const; 00039 virtual int tableLength() const; 00040 virtual void tableInsert(const TableItemType& newItem) 00041 throw(TableException); 00042 virtual void tableDelete(KeyType searchKey) 00043 throw(TableException); 00044 virtual void tableRetrieve(KeyType searchKey, 00045 TableItemType& tableItem) const 00046 throw(TableException); 00047 virtual void traverseTable(FunctionType visit); 00048 00049 protected: 00050 void setSize(int newSize); 00051 00052 private: 00054 BinarySearchTree bst; 00056 int size; 00057 }; // end Table 00058 // End of header file. |