MBSim

Project Page
server_integrator.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 _SERVER_INTEGRATOR_H_
00024 #define _SERVER_INTEGRATOR_H_
00025 
00026 #include "integrator.h"
00027 
00028 namespace MBSim {
00029 
00032   class ServerIntegrator : public Integrator {
00033 
00034     protected:
00035       std::ofstream integPlot;
00036 
00037     public:
00038 
00039       ServerIntegrator();
00040       ~ServerIntegrator() {}
00041 
00042       void integrate(DynamicSystemSolver& system);
00043 
00044       virtual void initializeUsingXML(MBXMLUtils::TiXmlElement *element);
00045       virtual MBXMLUtils::TiXmlElement* writeXMLFile(MBXMLUtils::TiXmlNode *element);
00046 
00047       virtual std::string getType() const { return "ServerIntegrator"; }
00048 
00049       void setIP(std::string IP_) {IP=IP_; }
00050       void setPort(std::string port_) {port=port_; }
00051 
00052       DynamicSystemSolver* getDynamicSystemSolver() {return system; }
00053 
00054       int* getzSize() {return &zSize; }
00055       int* getsvSize() {return &nsv; }
00056       double* getTime() {return &t; }
00057       void setTime(double t_) {t=t_; }
00058       fmatvec::Vec& getz() {return z; }
00059       void setz(const fmatvec::Vec& z_) {z << z_; }
00060       fmatvec::VecInt& getjsv() {return jsv; }
00061       void setjsv(const fmatvec::VecInt& jsv_) {jsv << jsv_; }
00062 
00063     private:
00064       std::string IP, port;
00065       int zSize, nsv;
00066       double t;
00067       fmatvec::Vec z;
00068       fmatvec::VecInt jsv;
00069   };
00070 }
00071 
00072 #endif // _SERVER_INTEGRATOR_H_