Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

orxonox/trunk: merged branches/network to the trunk
merged with command:
svn merge -r 5505:HEAD branches/network trunk

conflicts resolved in favor of the trunk (as always :))
also fixed a typo in the #include "SDL_tread.h"

File size: 1015 bytes
Line 
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
6
7*/
8
9#ifndef _DATA_STREAM_H
10#define _DATA_STREAM_H
11
12#include "base_object.h"
13#include "netdefs.h"
14
15#define DATA_STREAM_BUFFER_SIZE 1024
16
17class DataStream : public BaseObject
18{
19      public:
20      DataStream();
21      DataStream(DataStream& inStream, DataStream& outStream);
22      ~DataStream();
23
24
25      void connectUpStream(DataStream& upStream);
26
27      void disconnectUpStream();
28
29      void connectDownStream(DataStream& downStream);
30
31      void disconnectDownStream();
32
33      virtual void processData() = 0;
34
35      protected:
36      void passDown(byte* data, int length);
37
38      int passUp(byte* data);
39
40      byte* upBuffer;
41      byte* downBuffer;
42      unsigned int bufferSize;
43      DataStream* upStream;
44      DataStream* downStream;
45
46};
47
48#endif /* _DATA_STREAM_ */
Note: See TracBrowser for help on using the repository browser.