Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5806 in orxonox.OLD


Ignore:
Timestamp:
Nov 28, 2005, 6:49:58 PM (18 years ago)
Author:
patrick
Message:

network: made some functions and arguments const, since they musn't change any data.

Location:
branches/network/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/synchronizeable.cc

    r5804 r5806  
    4040                          \brief write data to NetworkStream
    4141 */
    42  void Synchronizeable::writeBytes(byte* data, int length)
     42 void Synchronizeable::writeBytes(const byte* data, int length)
    4343{
    4444
     
    5151                                 \brief read data from NetworkStream
    5252 */
    53  int Synchronizeable::readBytes(byte* data)
     53 int Synchronizeable::readBytes(byte* data) const
    5454{
    5555
     
    5959}
    6060
    61  void Synchronizeable::writeDebug()
     61 void Synchronizeable::writeDebug() const
    6262{
    6363
    6464}
    6565
    66  void Synchronizeable::readDebug()
     66 void Synchronizeable::readDebug() const
    6767{
    6868
  • branches/network/src/lib/network/synchronizeable.h

    r5804 r5806  
    1717    ~Synchronizeable();
    1818
    19     virtual void      writeBytes(byte* data, int length);
    20     virtual int       readBytes(byte* data);
    21     virtual void      writeDebug();
    22     virtual void      readDebug();
     19    virtual void      writeBytes(const byte* data, int length);
     20    virtual int       readBytes(byte* data) const;
     21    virtual void      writeDebug() const;
     22    virtual void      readDebug() const;
    2323
    24     inline const char* getName() { return this->name; }
     24    inline const char* getName() const { return this->name; }
    2525
    2626  private:
  • branches/network/src/subprojects/network/network_unit_test.cc

    r5805 r5806  
    143143  if(error == -1) printf("\n\nerror on address resolution, program inconsistancy\n\n");
    144144  nm->establishConnection(ip, *clientSync);
    145   SDL_Delay(1000);
     145  /* adding some break for connection setup */
     146  SDL_Delay(20);
    146147
    147148  /* synchronize the data 1 time (increment for longer tests) */
  • branches/network/src/subprojects/network/simple_sync.cc

    r5805 r5806  
    6060 *  write data to Synchronizeable
    6161 */
    62 void SimpleSync::writeBytes(byte* data, int length)
     62void SimpleSync::writeBytes(const byte* data, int length)
    6363{
    6464  PRINTF(0)("SimpleSync: got %i bytes of data\n", length);
     
    8080 *  read data from Synchronizeable
    8181 */
    82 int SimpleSync::readBytes(byte* data)
     82int SimpleSync::readBytes(byte* data) const
    8383{
    8484  PRINTF(0)("SimpleSync: sent %i bytes of data\n", this->outLength);
    8585
     86  /* debug msg */
     87  this->readDebug();
     88
    8689  /* write the test message */
    8790  for( int i = 0; i < this->outLength; i++)
    88   {
    8991    data[i] = this->outData[i];
    90   }
    9192
    92   /* debug msg */
    93   this->readDebug();
    9493  /* return the length of the test */
    9594  return this->outLength;
     
    9796
    9897
    99 void SimpleSync::writeDebug()
     98void SimpleSync::writeDebug() const
    10099{
    101100  PRINTF(0)("Write in bytes: \t(0 <-) |");
     
    108107
    109108
    110 void SimpleSync::readDebug()
     109void SimpleSync::readDebug() const
    111110{
    112111  PRINTF(0)("Read out bytes: \t(0 ->) |");
  • branches/network/src/subprojects/network/simple_sync.h

    r5804 r5806  
    1616    ~SimpleSync();
    1717
    18     virtual void writeBytes(byte* data, int length);
    19     virtual int readBytes(byte* data);
     18    virtual void writeBytes(const byte* data, int length);
     19    virtual int readBytes(byte* data) const;
    2020
    2121
    2222  private:
    23     virtual void writeDebug();
    24     virtual void readDebug();
     23    virtual void writeDebug() const;
     24    virtual void readDebug() const;
    2525
    2626
Note: See TracChangeset for help on using the changeset viewer.