source:
orxonox.OLD/trunk/src/lib/network/data_stream.h
@
5924
Last change on this file since 5924 was 5822, checked in by bensch, 19 years ago | |
---|---|
File size: 1015 bytes |
Rev | Line | |
---|---|---|
[5554] | 1 | /*! |
2 | * @file data_stream.h | |
3 | * Main class for a data stream, used for our network stream | |
4 | * network stream will get data, and will send it with a network socket | |
5 | * to another network stream | |
[5524] | 6 | |
[5554] | 7 | */ |
8 | ||
9 | #ifndef _DATA_STREAM_H | |
10 | #define _DATA_STREAM_H | |
11 | ||
12 | #include "base_object.h" | |
[5562] | 13 | #include "netdefs.h" |
[5554] | 14 | |
[5747] | 15 | #define DATA_STREAM_BUFFER_SIZE 1024 |
16 | ||
[5554] | 17 | class DataStream : public BaseObject |
[5524] | 18 | { |
[5602] | 19 | public: |
[5612] | 20 | DataStream(); |
[5611] | 21 | DataStream(DataStream& inStream, DataStream& outStream); |
[5554] | 22 | ~DataStream(); |
[5569] | 23 | |
[5747] | 24 | |
[5562] | 25 | void connectUpStream(DataStream& upStream); |
[5569] | 26 | |
[5562] | 27 | void disconnectUpStream(); |
[5569] | 28 | |
[5562] | 29 | void connectDownStream(DataStream& downStream); |
[5569] | 30 | |
[5562] | 31 | void disconnectDownStream(); |
[5569] | 32 | |
[5562] | 33 | virtual void processData() = 0; |
[5569] | 34 | |
[5562] | 35 | protected: |
[5719] | 36 | void passDown(byte* data, int length); |
[5569] | 37 | |
[5719] | 38 | int passUp(byte* data); |
[5722] | 39 | |
[5808] | 40 | byte* upBuffer; |
41 | byte* downBuffer; | |
[5602] | 42 | unsigned int bufferSize; |
43 | DataStream* upStream; | |
44 | DataStream* downStream; | |
45 | ||
[5562] | 46 | }; |
[5554] | 47 | |
48 | #endif /* _DATA_STREAM_ */ |
Note: See TracBrowser
for help on using the repository browser.