Last change
on this file since 5736 was
5736,
checked in by bwuest, 18 years ago
|
network_protocol.cc and network_protocol.h changed
|
File size:
792 bytes
|
Line | |
---|
1 | /*! |
---|
2 | |
---|
3 | */ |
---|
4 | |
---|
5 | #ifndef _NETWORK_PROTOCOL_H |
---|
6 | #define _NETWORK_PROTOCOL_H |
---|
7 | |
---|
8 | #include "base_object.h" |
---|
9 | |
---|
10 | /* include this file, it contains some default definitions */ |
---|
11 | #include "netdefs.h" |
---|
12 | |
---|
13 | #define HEADER_LENGTH 1 |
---|
14 | |
---|
15 | typedef struct Header |
---|
16 | { |
---|
17 | byte protocol; |
---|
18 | byte version; |
---|
19 | byte senderID; |
---|
20 | byte receiverID; |
---|
21 | byte length; |
---|
22 | byte* data; |
---|
23 | }; |
---|
24 | |
---|
25 | class Synchronizeable; |
---|
26 | |
---|
27 | /*! |
---|
28 | |
---|
29 | */ |
---|
30 | class NetworkProtocol : virtual public BaseObject |
---|
31 | { |
---|
32 | public: |
---|
33 | NetworkProtocol(); |
---|
34 | ~NetworkProtocol(); |
---|
35 | |
---|
36 | int createHeader(byte* data, int length, int bufferLength, const Synchronizeable& source, unsigned int remoteID); |
---|
37 | Header ExtractHeader(byte* data, int length); |
---|
38 | |
---|
39 | private: |
---|
40 | unsigned int headerLength; //The Length of the Header in bytes |
---|
41 | }; |
---|
42 | |
---|
43 | #endif //_NETWORK_PROTOCOL_H |
---|
Note: See
TracBrowser
for help on using the repository browser.