#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. * * }}} */ #include "gs/gs_transmitter.hh" #include "utils/non_copyable.hh" class Aiguillage : public NonCopyable { private: static const unsigned int MAX_SIZE_NAME = 8; private: GSTransmitter gst_; std::string name_; public: /// Constructeur client Aiguillage(const std::string & address, int port, const std::string & name); /// Constructeur serveur Aiguillage(SocketServer & socket, const std::string & name); /// Envoie un paquet en rajoutant les infos de sources et de provenance void send(const 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 bool receive(GSMessage & gsm, std::string & source, std::string & dest, bool bloquant); private: /// Set le nom de transmition void setName(const std::string & name); }; #endif //AIGUILLAGE_HH