00001 // ---------------------------------------------------------------------------- 00002 // 00003 // $Id$ 00004 // 00005 // Copyright 2008, 2009, 2010, 2011 Antonio Franchi 00006 // 00007 // This file is part of dscope. 00008 // 00009 // MIP is free software: you can redistribute it and/or modify 00010 // it under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation, either version 3 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // MIP is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with dscope. If not, see <http://www.gnu.org/licenses/>. 00021 // 00022 // Contact info: antonio.franchi@tuebingen.mpg.de 00023 // 00024 // ---------------------------------------------------------------------------- 00025 00026 00027 #ifndef __DS_MESSAGE_H__ 00028 #define __DS_MESSAGE_H__ 00029 00030 #include <iostream> 00031 #include <vector> 00032 #include <Message.h> 00033 #include <Spaces.h> 00034 00035 #include "DsTypes.h" 00036 00037 using namespace std; 00038 using namespace MipBaselib; 00039 00040 enum DsConnType { 00041 DS_CONN_UDP, 00042 DS_CONN_FIFO 00043 }; 00044 00047 enum DsHeaders { 00048 DS_HEAD_VECTOR, 00049 DS_HEAD_VECTOR_REM, 00050 DS_HEAD_NUM 00051 }; 00052 00053 00054 static const char* DsHeaderNames[DS_HEAD_NUM] = { 00055 "Display vector", 00056 "Remove vector display", 00057 }; 00058 00059 00062 class DsMessage : public Message{ 00063 protected: 00064 DsMessage(); 00065 00066 public: 00067 DsHeaders header; 00068 char sessionName[12]; 00069 int size; 00070 char displayName[12]; 00071 00072 DsMessage(const string& inMessage); 00073 }; 00074 00075 class DsMsgVector : public DsMessage{ 00076 public: 00077 vector <double> values; 00078 00079 DsMsgVector(string& sessionName_, string& displayName_, vector <double>& values_); 00080 00081 DsMsgVector(const string& inMessage); 00082 00083 void encode(string& outMessage); 00084 }; 00085 00086 class DsMsgVectorRem : public DsMessage{ 00087 public: 00088 00089 DsMsgVectorRem(string& sessionName_, string& displayName_); 00090 00091 DsMsgVectorRem(const string& inMessage); 00092 00093 void encode(string& outMessage); 00094 }; 00095 00096 00097 #endif 00098 00099 00100 00101