From 56cc59cf44ec64440ba4d1c0d005196195c758e6 Mon Sep 17 00:00:00 2001 From: hugues Date: Sat, 25 Mar 2006 15:07:51 +0000 Subject: Nettoyage du repository glagen git-svn-id: file:///usr/local/opt/svn/repos/glagen@12 0f7e0d06-a6f9-0310-a55f-d5f984f55e4c --- tags/START/glagen/algo_distribue/tree/main.cc | 99 --------------------------- 1 file changed, 99 deletions(-) delete mode 100644 tags/START/glagen/algo_distribue/tree/main.cc (limited to 'tags/START/glagen/algo_distribue/tree/main.cc') diff --git a/tags/START/glagen/algo_distribue/tree/main.cc b/tags/START/glagen/algo_distribue/tree/main.cc deleted file mode 100644 index 3b6f02d..0000000 --- a/tags/START/glagen/algo_distribue/tree/main.cc +++ /dev/null @@ -1,99 +0,0 @@ -// -// main.cc for in -// -// Made by meng-tih lam -// Login -// -// Started on Fri Aug 16 02:41:45 2002 meng-tih lam -// - -#include -#include -#include - -#include "node.hh" -#include "tree.hh" - -// Pour construire un arbre, il faut d'abord faire les fils -// et les raccoller avec le pere avec la methode add_tree - -int test_tree() -{ - // ** Exemple avec la classe ** - // ** On peut mettre n'importe classe ** - - // * Support du sous-arbre * - string root = "Connection..."; - string a = "Est-ce que ca fonctionne ?"; - string b = "1212123"; - string c = "OK recu 5/5"; - Tree tree(root); - tree.add_node(a); - tree.add_node(b); - tree.add_node(c); - - // Affichage root de l'arbre - std::cout << "root: " << tree.get_node_root().get_data() << std::endl; - - // Affichage de ses fils - unsigned int nb_childs = tree.get_nb_childs(); - for (unsigned int i = 0; i < nb_childs; ++i) - std::cout << tree.get_child(i).get_data() << std::endl; - std::cout << std::endl << std::endl; - - - - // * Support Arbre principale * - Tree main_tree("Execution..."); - - // Voici la methode pour lier un arbre et un sous-arbre - main_tree.add_tree(tree); - - std::cout << "root main: " << main_tree.get_node_root().get_data() - << std::endl; - unsigned int nb_childs2 = main_tree.get_nb_childs(); - - // Ici arbre sur 2 niveaux (Bien sur qu'on peut faire en recursivite ^_^) - for (unsigned int i = 0; i < nb_childs2; ++i) - { - nb_childs = main_tree.get_child(i).get_nb_childs(); - std::cout << main_tree.get_child(i).get_data() << std::endl; - for (unsigned int j = 0; j < nb_childs; ++j) - std::cout << main_tree.get_child(i).get_child(j).get_data() - << std::endl; - } - std::cout << std::endl << std::endl; - - - - - // * Allez on rajoute pour compliquer les choses * - Tree tree2("Une tentative de suicide"); - tree2.add_node("Ou ca?"); - tree2.add_node("A Epita"); - tree2.add_node("Ping pong ping"); - main_tree.add_tree(tree2); - - std::cout << "root main: " << main_tree.get_node_root().get_data() - << std::endl; - nb_childs2 = main_tree.get_nb_childs(); - - // Ici arbre sur 2 niveaux (Bien sur qu'on peut faire en recursivite ^_^) - for (unsigned int i = 0; i < nb_childs2; ++i) - { - nb_childs = main_tree.get_child(i).get_nb_childs(); - std::cout << main_tree.get_child(i).get_data() << std::endl; - for (unsigned int j = 0; j < nb_childs; ++j) - std::cout << main_tree.get_child(i).get_child(j).get_data() - << std::endl; - } - - return (0); -} - - -int main() -{ - test_tree(); - return (0); -} -- cgit v1.2.3