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