Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/network/data_stream.h @ 8802

Last change on this file since 8802 was 6981, checked in by bensch, 19 years ago

trunk: some virtuals

File size: 1.0 KB
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 10240
16
17class DataStream : public BaseObject
18{
19      public:
20      DataStream();
21      DataStream(DataStream& inStream, DataStream& outStream);
22      virtual ~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.