Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/lib/network/data_stream.cc @ 5600

Last change on this file since 5600 was 5600, checked in by bknecht, 19 years ago

new Constructors and BaseObject registration for DataStream

File size: 3.2 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Knecht
13   co-programmer: ...
14*/
15
16/* include Data_stream Header */
17#include "data_stream.h"
18
19
20
21
22/* using namespace std is default, this needs to be here */
23using namespace std;
24
25
26/**
27 * This constructor creates a new DataStream and connects it to both streams (upStream, downStream)
28 */
29DataStream::DataStream(DataStream& upStream, DataStream& downStream)
30{
31    this->setClassID(CL_DATA_STREAM, "DataStream");
32}
33
34/**
35 * This constructor creates a new DataStream and connects it to a synchronizeable object and the NetworkSocket
36 */
37DataStream::DataStream(Synchronizeable& sync, NetworkSocket& socket)
38{
39    this->setClassID(CL_DATA_STREAM, "DataStream");
40}
41
42/**
43 * This constructor creates a new DataStream and connects the Synchronizeable to it
44 */
45DataStream::DataStream(Synchronizable& sync, DataStream& downStream)
46{
47    this->setClassID(CL_DATA_STREAM, "DataStream");
48}
49
50/**
51 * This constructor creates a new DataStream and connects the NetworkSocket to it
52 */
53DataStream::DataStream(DataStream& upStream, NetworkSocekt& socket)
54{
55     this->setClassID(CL_DATA_STREAM, "DataStream");
56}
57
58/**
59 *  standart deconstructor
60 */
61DataStream::~DataStream()
62{
63
64}
65
66/**
67 * This function connects this stream to another stream. The connected DataStream is an up-stream, meaning
68 * that the stream is "further away" from the NetworkSocket. The local reference upStream will be set to this
69 * Stream
70 */
71void DataStream::connectUpStream(DataStream& upStream)
72{
73
74}
75
76/**
77 * This function connects this stream to another stream. The connected DataStream is an down-stream, meaning
78 * that the stream is "closer" to the NetworkSocket.
79 */
80void DataStream::connectDownStream(DataStream& upStream)
81{
82
83}
84
85/**
86 * This function disconnects the upStream and sets it to NULL
87 */
88void DataStream::disconnectUpStream()
89{
90
91}
92
93/**
94 * This function disconnects the downStream and sets it to NULL
95 */
96void DataStream::disconnectDownStream()
97{
98
99}
100
101/**
102 * This function moves the data from the downStream object to the upStream object and changes the data if necessary.
103 * This function is virtual and therefore needs to be extended by the derived class
104 */
105void DataStream::processData()
106{
107
108}
109
110/**
111 * Following functions are protected and only visible inside the object and from derived classes
112 */
113
114/**
115 * This function writes the binary data to the local data. You will have to copy each byte and not only dublicate
116 * it.
117 */
118void DataStream::writeBytes(byte& data)
119{
120
121}
122
123
124/**
125 * This function returns a reference to the local upData data array. So it can be read by an upper Stream
126 * The reading function will have to copy the whole data and musn't just reference it!
127 * This function is only called from other connected DataStreams to read the data.
128 */
129byte& DataStream::readBytes()
130{
131
132}
Note: See TracBrowser for help on using the repository browser.