summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jonas <himself@jonasgunz.de> 2017-02-10 10:21:34 +0100
committerGravatar jonas <himself@jonasgunz.de> 2017-02-10 10:21:34 +0100
commit4429669b648a84e1729fed0d672737c517e68d11 (patch)
tree431b153fc4505a67185770e43e823341344c9158
parent4f38679129cc243a3db811e041009e9afd8f70b9 (diff)
downloadtree-4429669b648a84e1729fed0d672737c517e68d11.tar.gz
Cleanup: Removed unnecesary functions
-cNode::isEnd() -cNode::clear()
-rw-r--r--tree/src/cNode.cpp23
-rw-r--r--tree/src/cNode.h24
-rw-r--r--tree/src/cTree.cpp6
3 files changed, 0 insertions, 53 deletions
diff --git a/tree/src/cNode.cpp b/tree/src/cNode.cpp
index beec425..8340367 100644
--- a/tree/src/cNode.cpp
+++ b/tree/src/cNode.cpp
@@ -66,11 +66,6 @@ cData* cDatanode::search(string _search)
return NULL;
}//search
-bool cDatanode::isEnd()
-{
- return false;
-}//isEnd
-
void cDatanode::getSortet(list<cData>* _list)
{
nextSmaller->getSortet(_list);
@@ -78,14 +73,6 @@ void cDatanode::getSortet(list<cData>* _list)
nextBigger->getSortet(_list);
}//getSorte
-void cDatanode::clear()
-{
- delete nextSmaller;
- delete nextBigger;
- nextSmaller = new cEndnode();
- nextBigger = new cEndnode();
-}
-
void cDatanode::draw(int _depth)
{
for (int i = 0; i <= _depth; i++)
@@ -103,11 +90,6 @@ void cDatanode::draw(int _depth)
cEndnode::cEndnode() {}
cEndnode::~cEndnode() {}
-bool cEndnode::isEnd()
-{
- delete this;
- return true;
-}
cData cEndnode::getDataObject()
{
@@ -135,11 +117,6 @@ void cEndnode::getSortet(list<cData>* _list)
return;
}
-void cEndnode::clear()
-{
- return;
-}
-
void cEndnode::draw(int _depth)
{
for (int i = 0; i <= _depth; i++)
diff --git a/tree/src/cNode.h b/tree/src/cNode.h
index 3ee46e2..561e094 100644
--- a/tree/src/cNode.h
+++ b/tree/src/cNode.h
@@ -36,21 +36,11 @@ public:
/*
* Searches for a Object by its Primary Key, returns pointer pointing at result (NULL if no result)
*/
- virtual bool isEnd() = 0;
- /*
- * returns false
- * TODO Remove
- */
virtual void getSortet(list<cData>* _list) = 0;
/*
* gets sortet list
*/
- virtual void clear() = 0;
- /*
- * TODO Remove
- */
-
virtual void draw(int _depth) = 0;
};
@@ -76,18 +66,10 @@ public:
/*
* Searches for a Object by its Primary Key, returns pointer pointing at result (NULL if no result)
*/
- bool isEnd();
- /*
- * returns false
- */
void getSortet(list<cData>* _list);
/*
* Copy all cData Instances into _list
*/
- void clear();
- /*
- * clears the tree
- */
void draw(int _depth);
private:
cNode *nextSmaller, *nextBigger;
@@ -117,14 +99,8 @@ public:
/*
* Searches for a Object by its Primary Key, returns pointer pointing at result (NULL if no result)
*/
- bool isEnd();
- /*
- * returns false
- */
void getSortet(list<cData>* _list);
- void clear();
-
void draw(int _depth);
private:
};
diff --git a/tree/src/cTree.cpp b/tree/src/cTree.cpp
index 32c7179..6b6cfa4 100644
--- a/tree/src/cTree.cpp
+++ b/tree/src/cTree.cpp
@@ -34,12 +34,6 @@ void cTree::remove(cData* _data)
root->remove(_data, &dataList, &root);
insertList(&dataList);
- ///TODO: Optimize!!!
- /*while(!dataList.empty())
- {
- insert(dataList.front().clone());
- dataList.pop_front();
- }*/
}
void cTree::getList(list<cData>* _list)