summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jonas <himself@jonasgunz.de> 2017-03-01 22:27:28 +0100
committerGravatar jonas <himself@jonasgunz.de> 2017-03-01 22:27:28 +0100
commite6aa448a5710d88300f424080201018dfa711022 (patch)
tree339308869e9e599805681f75101e26347fed591d
parentf4ad97dab99e2112abbbc5ff8a9eb77f173e5d9e (diff)
downloadtree-e6aa448a5710d88300f424080201018dfa711022.tar.gz
init first delete
-rw-r--r--tree/.cproject2
-rw-r--r--tree/.settings/language.settings.xml4
-rw-r--r--tree/src/cNode.cpp16
-rw-r--r--tree/src/cNode.h13
4 files changed, 32 insertions, 3 deletions
diff --git a/tree/.cproject b/tree/.cproject
index 9a5d181..1ac1dbd 100644
--- a/tree/.cproject
+++ b/tree/.cproject
@@ -16,7 +16,7 @@
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.992883527." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.1750761033" name="Cross GCC" nonInternalBuilderId="cdt.managedbuild.builder.gnu.cross" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1864634322" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
- <builder autoBuildTarget="all" buildPath="${workspace_loc:/tree}/Debug" cleanBuildTarget="clean" id="org.eclipse.cdt.build.core.internal.builder.192922103" incrementalBuildTarget="all" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.internal.builder"/>
+ <builder autoBuildTarget="all" buildPath="${workspace_loc:/tree}/Debug" cleanBuildTarget="clean" id="org.eclipse.cdt.build.core.internal.builder.192922103" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.internal.builder"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1925147654" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1319784671" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.649809700" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
diff --git a/tree/.settings/language.settings.xml b/tree/.settings/language.settings.xml
index 4200ffe..4353902 100644
--- a/tree/.settings/language.settings.xml
+++ b/tree/.settings/language.settings.xml
@@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
- <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-526476468772666232" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+ <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="903858879085254848" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
- <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-526476468772666232" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
+ <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="903858879085254848" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
diff --git a/tree/src/cNode.cpp b/tree/src/cNode.cpp
index b2c4d36..8618354 100644
--- a/tree/src/cNode.cpp
+++ b/tree/src/cNode.cpp
@@ -117,6 +117,18 @@ unsigned int cDatanode::getSubtreeSize()
return nextSmaller->getSubtreeSize() + nextBigger->getSubtreeSize() + 1;
}//getSubtreeSize
+sSubTree cDatanode::getSubTree()
+{
+ sSubTree s;
+ s.nextBigger = nextBigger;
+ s.nextSmaller = nextSmaller;
+
+ nextBigger = new cEndnode();
+ nextSmaller = new cEndnode();
+
+ return s;
+}
+
//
//==============================================================================================================================
//
@@ -173,6 +185,10 @@ unsigned int cEndnode::getDepth(unsigned int _depth)
return _depth;
}
+sSubTree cEndnode::getSubTree()
+{
+ return sSubTree{NULL, NULL};
+}
diff --git a/tree/src/cNode.h b/tree/src/cNode.h
index b3ec3ef..9918bf0 100644
--- a/tree/src/cNode.h
+++ b/tree/src/cNode.h
@@ -14,6 +14,14 @@
using namespace std;
+class cNode;
+
+struct sSubTree
+{
+ cNode *nextBigger;
+ cNode *nextSmaller;
+};
+
class cNode {
public:
cNode();
@@ -59,6 +67,8 @@ public:
/*
*draws tree in Ascii
*/
+
+ virtual sSubTree getSubTree() = 0;
};
class cDatanode:public cNode
@@ -92,6 +102,7 @@ public:
void draw(int _depth);
unsigned int getSubtreeSize();
unsigned int getDepth(unsigned int);
+ sSubTree getSubTree();
private:
cNode *nextSmaller, *nextBigger;
cData *data;
@@ -130,6 +141,8 @@ public:
unsigned int getDepth(unsigned int);
void draw(int _depth);
+
+ sSubTree getSubTree();
private:
};