mbsiminterface  1.0.0
mbsim_server.h
00001 /* Copyright (C) 2013 Markus Schneider
00002 
00003  * This library is free software; you can redistribute it and/or 
00004  * modify it under the terms of the GNU Lesser General Public 
00005  * License as published by the Free Software Foundation; either 
00006  * version 2.1 of the License, or (at your option) any later version. 
00007  *  
00008  * This library is distributed in the hope that it will be useful, 
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00011  * Lesser General Public License for more details. 
00012  *  
00013  * You should have received a copy of the GNU Lesser General Public 
00014  * License along with this library; if not, write to the Free Software 
00015  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
00016 
00017  *
00018  * Contact:
00019  *   markus.ms.schneider@live.de
00020  *
00021  */
00022 
00023 #ifndef _MBSIMSERVER_H_
00024 #define _MBSIMSERVER_H_
00025 
00026 namespace MBXMLUtils {
00027   class TiXmlElement;
00028 }
00029 
00030 namespace MBSimInterface {
00031 
00032   class InterfaceIntegrator;
00033 
00034   class MBSimServer {
00035     public:
00036       MBSimServer(InterfaceIntegrator* ii_) {ii=ii_; }
00037 
00038       virtual void initializeUsingXML(MBXMLUtils::TiXmlElement *element) {};
00039 
00040       virtual void start() {};
00041     protected:
00042       InterfaceIntegrator* ii;
00043   };
00044 
00045   class MBSimTcpServer : public MBSimServer  {
00046     public:
00047       MBSimTcpServer(InterfaceIntegrator *ii);
00048       void setPort(unsigned short port_) {port=port_; }
00049       void setOutputPrecision(unsigned int p) {outputPrecision=p; }
00050       virtual void initializeUsingXML(MBXMLUtils::TiXmlElement *element);
00051       void start();
00052     private:
00053       unsigned int port;
00054       unsigned int outputPrecision;
00055   };
00056 
00057   class MBSimUdpServer : public MBSimServer  {
00058     public:
00059       MBSimUdpServer(InterfaceIntegrator *ii);
00060       void setPort(unsigned short port_) {port=port_; }
00061       virtual void initializeUsingXML(MBXMLUtils::TiXmlElement *element);
00062       void start();
00063     private:
00064       unsigned int port;
00065   };
00066 
00067 }
00068 
00069 #endif