1 // message.hxx -- Multiplayer Client/Server message base class
\r
3 // Written by John Barrett, started November 2003.
\r
5 // Copyright (C) 2003 John R. Barrett - jbarrett@accesshosting.com
\r
7 // This program is free software; you can redistribute it and/or
\r
8 // modify it under the terms of the GNU General Public License as
\r
9 // published by the Free Software Foundation; either version 2 of the
\r
10 // License, or (at your option) any later version.
\r
12 // This program is distributed in the hope that it will be useful, but
\r
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
15 // General Public License for more details.
\r
17 // You should have received a copy of the GNU General Public License
\r
18 // along with this program; if not, write to the Free Software
\r
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
\r
23 #ifndef _FG_MPS_MESSAGE_HXX
\r
24 #define _FG_MPS_MESSAGE_HXX
\r
26 #include <simgear/compiler.h>
\r
29 #include <stdexcept>
\r
31 SG_USING_STD(string);
\r
32 SG_USING_STD(invalid_argument);
\r
34 #include "messagebuf.hxx"
\r
42 fgmps_ulonglong = 0xf3,
\r
46 fgmps_longlong = 0xf7,
\r
48 fgmps_double = 0xf9,
\r
49 fgmps_string = 0xfa,
\r
50 fgmps_reserved = 0xfb,
\r
55 } FGMPSMsgElementType;
\r
59 FGMPSMsgElementType type;
\r
61 } FGMPSMsgElementEntry;
\r
63 #define FGMPSMsgElementArrayEnd {fgmps_null, 0}
\r
68 FGMPSMsgElementEntry elements[1];
\r
69 static unsigned int msgid;
\r
71 FGMPSMessageBuf msg;
\r
76 virtual string encodemsg() {}
\r
77 virtual FGMPSMessage* decodemsg(string msg) {}
\r
78 virtual FGMPSMsgElementEntry* getelements() { return elements; }
\r
79 virtual unsigned int getmessageid() { return msgid; }
\r