From ad8b9998a75c09dcfae0ac77bfd244e7ae58da1f Mon Sep 17 00:00:00 2001 From: haller Date: Mon, 12 Dec 2005 19:40:07 +0000 Subject: Quelques hh --- i/simulotron/src/aiguillage/aiguillage.hh | 40 ++++++++++++++++++++++++++++++ i/simulotron/src/comc/comc.hh | 40 ++++++++++++++++++++++++++++++ i/simulotron/src/hub/hub.hh | 41 +++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 i/simulotron/src/aiguillage/aiguillage.hh create mode 100644 i/simulotron/src/comc/comc.hh create mode 100644 i/simulotron/src/hub/hub.hh diff --git a/i/simulotron/src/aiguillage/aiguillage.hh b/i/simulotron/src/aiguillage/aiguillage.hh new file mode 100644 index 0000000..3c68e66 --- /dev/null +++ b/i/simulotron/src/aiguillage/aiguillage.hh @@ -0,0 +1,40 @@ +#ifndef AIGUILLAGE_HH +#define AIGUILLAGE_HH +/* aiguillage.hh - Classe rajoutant les info de la source et de la dest d'un packet */ +/* Simulotron - Programme de simulation de robot {{{ + * + * Copyright (C) 2005 Nicolas Haller + * + * Robot APB Team/Efrei 2006. + * Web: http://assos.efrei.fr/robot/ + * Email: robot AT efrei DOT fr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * }}} */ + +class Aiguillage +{ + private: + GSTransmitter gqt_; + public: + /// Constructeur + Aiguillage(void); + /// Envoie un paquet en rajoutant les infos de sources et de provenance + void send(GSMessage & gsm, const std::string & source, const std::string & dest); + /// Reçoie un paquet du réseau et supprime les infos src et dest du GSM + int receive(GSMessage & gsm, std::string & source, const std::string & dest); +}; +#endif //AIGUILLAGE_HH diff --git a/i/simulotron/src/comc/comc.hh b/i/simulotron/src/comc/comc.hh new file mode 100644 index 0000000..f77aadb --- /dev/null +++ b/i/simulotron/src/comc/comc.hh @@ -0,0 +1,40 @@ +#ifndef COMC_HH +#define COMC_HH +/* comc.hh - Classe la plus haute dans la transmission par socket */ +/* Simulotron - Programme de simulation de robot {{{ + * + * Copyright (C) 2006 Nicolas Haller + * + * Robot APB Team/Efrei 2006. + * Web: http://assos.efrei.fr/robot/ + * Email: robot AT efrei DOT fr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * }}} */ + +template +class ComC : public C +{ + /// Constructeur + ComC(const Address & adr, const std::string & name); + /// Envoie un truc dans le réseau + template + void send(const T & message, const std::string & destname); + /// Recoie quelque chose et appelle une fonction callback + void receive(void); +}; + +#endif //COMC_HH diff --git a/i/simulotron/src/hub/hub.hh b/i/simulotron/src/hub/hub.hh new file mode 100644 index 0000000..40ddc62 --- /dev/null +++ b/i/simulotron/src/hub/hub.hh @@ -0,0 +1,41 @@ +#ifndef HUB_HH +#define HUB_HH +/* hub.hh - Classe la plus haute dans la transmission par socket */ +/* Simulotron - Programme de simulation de robot {{{ + * + * Copyright (C) 2006 Nicolas Haller + * + * Robot APB Team/Efrei 2006. + * Web: http://assos.efrei.fr/robot/ + * Email: robot AT efrei DOT fr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * }}} */ + +class Hub +{ + private: + TimeH timeh_; + Orders ordres_; + SocketServer socket_; + public: + /// Constructeur + Hub(void); + /// Initialisation + Init(void); +}; + +#endif //HUB_HH -- cgit v1.2.3