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 --- trunk/glagen/algo_distribue/tree/Makefile | 45 -------------- trunk/glagen/algo_distribue/tree/main.cc | 99 ------------------------------- trunk/glagen/algo_distribue/tree/node.cc | 11 ---- trunk/glagen/algo_distribue/tree/node.hh | 78 ------------------------ trunk/glagen/algo_distribue/tree/tree.cc | 11 ---- trunk/glagen/algo_distribue/tree/tree.hh | 51 ---------------- 6 files changed, 295 deletions(-) delete mode 100644 trunk/glagen/algo_distribue/tree/Makefile delete mode 100644 trunk/glagen/algo_distribue/tree/main.cc delete mode 100644 trunk/glagen/algo_distribue/tree/node.cc delete mode 100644 trunk/glagen/algo_distribue/tree/node.hh delete mode 100644 trunk/glagen/algo_distribue/tree/tree.cc delete mode 100644 trunk/glagen/algo_distribue/tree/tree.hh (limited to 'trunk/glagen/algo_distribue/tree') diff --git a/trunk/glagen/algo_distribue/tree/Makefile b/trunk/glagen/algo_distribue/tree/Makefile deleted file mode 100644 index 895117b..0000000 --- a/trunk/glagen/algo_distribue/tree/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -## -## Makefile for in -## -## Made by meng-tih lam -## Login -## -## Started on Thu Feb 7 19:08:57 2002 meng-tih lam - -## - -NAME = glagen_tree -SRCS = node.cc tree.cc main.cc - -OBJS = $(SRCS:.cc=.o) - -ARCHI_i586 = -g2 -Wall -W -Werror -O3 -ARCHI_NetBSD = -g2 -Wall -W -Werror -O3 -I/usr/X11R6/include -ARCHI_sun4 = -g2 -Wall -W -Werror -O3 -ARCHI_alpha = -g2 -Wall -W -Werror -O3 - -LIB_i586 = -LIB_NetBSD = -L/usr/pkg/lib -L/usr/X11R6/lib -lGL -lGLU -lglut -LIB_alpha = -LIB_sun4 = - -CPPFLAGS = -I. -CC = g++ -RM = rm -f - -.PHONY: all clean deps - -all: $(OBJS) - $(CC) -o $(NAME) $(CFLAGS) $(OBJS)\ - $(LIB_${HOSTTYPE}) $(ARCHI_${HOSTTYPE}) - -.cc.o: - $(CC) $(ARCHI_${HOSTTYPE}) $(CPPFLAGS) -c $< - -clean: - $(RM) $(OBJS) $(NAME) *~ \#*\# - -deps: - makedepend $(SRC) 2>/dev/null - -re: clean all diff --git a/trunk/glagen/algo_distribue/tree/main.cc b/trunk/glagen/algo_distribue/tree/main.cc deleted file mode 100644 index 3b6f02d..0000000 --- a/trunk/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); -} diff --git a/trunk/glagen/algo_distribue/tree/node.cc b/trunk/glagen/algo_distribue/tree/node.cc deleted file mode 100644 index a3ae387..0000000 --- a/trunk/glagen/algo_distribue/tree/node.cc +++ /dev/null @@ -1,11 +0,0 @@ -// -// node.cc for in -// -// Made by meng-tih lam -// Login -// -// Started on Fri Aug 16 02:40:40 2002 meng-tih lam -// Last update Fri Aug 16 02:41:05 2002 meng-tih lam -// - -#include "node.hh" diff --git a/trunk/glagen/algo_distribue/tree/node.hh b/trunk/glagen/algo_distribue/tree/node.hh deleted file mode 100644 index b80a699..0000000 --- a/trunk/glagen/algo_distribue/tree/node.hh +++ /dev/null @@ -1,78 +0,0 @@ - -#ifndef NODE_HH_ -# define NODE_HH_ - -#include -// Rajouter l'include correspondant a la template de TYPENODE -// + implemente le std::cout abtrait pour les tests - -template class Tree; // Declaration prealable - -template class Node -{ - friend class Tree; - -public: - Node(const TYPENODE &d) : _link(new std::list), _data(d) {} - - void add_child(const TYPENODE& value) { _link->push_back(Node(value)); } - - void add_tree_node(const Node& value) { _link->push_back(value); } - - TYPENODE get_data() const { return (_data); } - - const unsigned int get_nb_childs() const { return (_link->size()); } - - std::list* get_childs() const { return (_link); } - - unsigned int get_number_node() const - { - unsigned int number_childs = _link->size(); - std::list::const_iterator child = _link->begin(); - unsigned int number_node = 1; - for (unsigned int tmp = 0; tmp != number_childs; ++tmp) - { - number_node += child->get_number_node(); - ++child; - } - return (number_node); - } - - // Renvoie le noeud fils suivant le numero a partir de 0 - Node get_child(const unsigned int& i) const - { - assert(i < _link->size()); - std::list::const_iterator child = _link->begin(); - for (unsigned int tmp = 0; tmp != i; ++tmp) - ++child; - return (*child); - } - - // Numerotation de l'arbre suivant un parcours en largeur de 0 a n - Node get_node_course_width(const int& ptr) const - { - int rptr = ptr; - std::list ptr_node = *new std::list; - ptr_node.push_back(*this); - while (ptr_node.size()) - { - std::list::iterator childs = ptr_node.begin(); - std::list::iterator child = childs->get_childs()->begin(); - for (; child != childs->get_childs()->end(); ++child) - { - ptr_node.push_back(*child); - if (--rptr == 0) - return (*child); - } - ptr_node.pop_front(); - } - return (*this); - } - -private: - - std::list *_link; // Pointeur vers le sous-arbre - TYPENODE _data; -}; - -#endif // NODE_HH_ diff --git a/trunk/glagen/algo_distribue/tree/tree.cc b/trunk/glagen/algo_distribue/tree/tree.cc deleted file mode 100644 index 047ca89..0000000 --- a/trunk/glagen/algo_distribue/tree/tree.cc +++ /dev/null @@ -1,11 +0,0 @@ -// -// tree.cc for in -// -// Made by meng-tih lam -// Login -// -// Started on Fri Aug 16 02:45:56 2002 meng-tih lam -// Last update Fri Aug 16 17:11:24 2002 meng-tih lam -// - -#include "tree.hh" diff --git a/trunk/glagen/algo_distribue/tree/tree.hh b/trunk/glagen/algo_distribue/tree/tree.hh deleted file mode 100644 index 86ce136..0000000 --- a/trunk/glagen/algo_distribue/tree/tree.hh +++ /dev/null @@ -1,51 +0,0 @@ - - -#ifndef TREE_HH_ -# define TREE_HH_ - -#include -#include -#include "node.hh" -// Rajouter l'include correspondant a la template de TYPENODE -// + implemente le std::cout abstrait pour les tests - -template class Tree -{ -public: - // Construit la racine de l'arbre avec l'info dans son contenu - Tree(const TYPENODE& value) : _root(new Node(value)) {} - - Tree(const Tree& value) : _root(value._root) {} - - // Ajoute un noeud fils (avec info) a l'arbre - void add_node(const TYPENODE& value) { _root->add_child(value); } - - // Renvoie la racine de l'arbre de type Node - Node& get_node_root() const { return (*_root); } - - // Ajoute un autre arbre a la racine de l'arbre courant - void add_tree(const Tree &value) - { - _root->add_tree_node(value.get_node_root()); - } - - // Renvoie la liste de Node de ses fils - std::list< Node >& get_childs() { return _root->get_childs(); } - - // Information du nombre de fils - const unsigned int get_nb_childs() const - { - return (_root->get_nb_childs()); - } - - // Renvoie le noeud fils suivant le numero a partir de 0 - Node get_child(const unsigned int& i) const - { - return (_root->get_child(i)); - } - -private: - Node *_root; -}; - -#endif // TREE_HH_ -- cgit v1.2.3