mbsiminterface 1.0.0 MBSim Interface Module

mbsim_server.h
1 /* Copyright (C) 2013 Markus Schneider
2
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17 *
18 * Contact:
19 * markus.ms.schneider@live.de
20 *
21 */
22
23 #ifndef _MBSIMSERVER_H_
24 #define _MBSIMSERVER_H_
25
26 #include <mbxmlutilshelper/dom.h>
27
28 namespace MBSimInterface {
29
30 const MBXMLUtils::NamespaceURI MBSIMINTERFACE("http://www.mbsim-env.de/MBSimInterface");
31
32 class InterfaceIntegrator;
33
34 class MBSimServer {
35 public:
36 MBSimServer(InterfaceIntegrator* ii_) {ii=ii_; }
37
38 virtual void initializeUsingXML(xercesc::DOMElement *element) {};
39
40 virtual void start() {};
41 protected:
42 InterfaceIntegrator* ii;
43 };
44
45 class MBSimTcpServer : public MBSimServer {
46 public:
47 MBSimTcpServer(InterfaceIntegrator *ii);
48 void setPort(unsigned short port_) {port=port_; }
49 void setOutputPrecision(unsigned int p) {outputPrecision=p; }
50 void initializeUsingXML(xercesc::DOMElement *element) override;
51 void start() override;
52 private:
53 unsigned int port;
54 unsigned int outputPrecision;
55 };
56
57 class MBSimUdpServer : public MBSimServer {
58 public:
59 MBSimUdpServer(InterfaceIntegrator *ii);
60 void setPort(unsigned short port_) {port=port_; }
61 void initializeUsingXML(xercesc::DOMElement *element) override;
62 void start() override;
63 private:
64 unsigned int port;
65 };
66
67 }
68
69 #endif
MBXMLUtils::NamespaceURI
MBSimInterface::MBSimTcpServer
Definition: mbsim_server.h:45
MBSimInterface::MBSimServer
Definition: mbsim_server.h:34
MBSimInterface::MBSimUdpServer
Definition: mbsim_server.h:57
MBSimInterface::InterfaceIntegrator
Dummy-Integrator InterfaceIntegrator This integrator is an interface for other integration tool.
Definition: interface_integrator.h:39