Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6341 in orxonox.OLD for trunk/src/subprojects/network


Ignore:
Timestamp:
Dec 30, 2005, 1:57:12 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the network branche back to the trunk, so we do not get away from each other to fast

Location:
trunk/src/subprojects/network
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/subprojects/network/Makefile.am

    r6139 r6341  
    2222                  $(MAINSRCDIR)/lib/lang/class_list.cc \
    2323                  $(MAINSRCDIR)/util/loading/load_param.cc \
     24                  $(MAINSRCDIR)/util/loading/factory.cc \
    2425                  $(MAINSRCDIR)/lib/util/substring.cc \
    2526                  $(MAINSRCDIR)/util/loading/load_param_description.cc \
  • trunk/src/subprojects/network/network_unit_test.cc

    r6139 r6341  
    284284}
    285285
    286 
     286void testFloatConverter(float f)
     287{
     288  char* s = Converter::floatToBinString(f);
     289  printf("%f = ", f);
     290  printf(s); printf("\n");
     291 
     292  byte* res = Converter::floatToByteArray(f);
     293  printf("Byte Array: ");
     294  for (int i = 0; i < 4; i++)
     295    printf("%i  ", res[i]);
     296  printf("\n");
     297 
     298  float b = Converter::byteArrayToFloat(res);
     299  printf("ReConvert: %f \n", b);
     300}
     301
     302void testFloatConverter2(float f)
     303{
     304  char* s = Converter::floatToBinString(f);
     305  printf("### %f = ", f);
     306  printf(s); printf("\n");
     307 
     308  byte* res = Converter::_floatToByteArray(f);
     309  printf("Byte Array: ");
     310  for (int i = 0; i < 4; i++)
     311    printf("%i  ", res[i]);
     312  printf("\n");
     313 
     314  float b = Converter::_byteArrayToFloat(res);
     315  printf("ReConvert: %f \n", b);
     316}
    287317int converter(int argc, char** argv)
    288318{
     319  /*
    289320  int x = 200564786;
    290321  printf("To convert: %i\n", x);
     
    305336  printf("\n");
    306337 
     338  */
     339  /*
    307340  float y;
    308341  char* s;
     
    328361  printf(s); printf("\n");
    329362 
    330  
     363  y = -4.7824f;
     364  s = Converter::floatToBinString(y);
     365  printf("%f = ", y);
     366  printf(s); printf("\n");
     367 
     368  y = -14.35e14f;
     369  s = Converter::floatToBinString(y);
     370  printf("%f = ", y);
     371  printf(s); printf("\n");
     372                                                            */
     373 
     374 
     375  /*
     376  float a = 12.3f;
     377 
     378  char* s = Converter::floatToBinString(a);
     379  printf("%f = ", a);
     380  printf(s); printf("\n");
     381 
     382  byte* res = Converter::floatToByteArray(a);
     383  printf("Byte Array: \n");
     384  for (int i = 0; i < 4; i++)
     385    printf("%i  ", res[i]);
     386  printf("\n");
     387 
     388  float b = Converter::byteArrayToFloat(res);
     389  printf("ReConvert: %f \n", b);
     390  */
     391//  testFloatConverter(12.3e-53f); printf("\n");
     392//  testFloatConverter(134.26455646546548741661675165f); printf("\n");
     393 // testFloatConverter(35.67e14f); printf("\n");
     394 
     395  testFloatConverter(12.3e-7f); printf("\n");
     396  testFloatConverter(134.26455646546548741661675165f); printf("\n");
     397  testFloatConverter(35.67e14f); printf("\n");
    331398 
    332399  return 0;
  • trunk/src/subprojects/network/read_sync.cc

    r6139 r6341  
    6060 *  write data to Synchronizeable
    6161 */
    62 void ReadSync::writeBytes(const byte* data, int length)
     62int ReadSync::writeBytes(const byte* data, int length, int sender)
    6363{
    6464  PRINTF(0)("ReadSync: got %i bytes of data\n", length);
  • trunk/src/subprojects/network/read_sync.h

    r6139 r6341  
    1616    ~ReadSync();
    1717
    18     virtual void writeBytes(const byte* data, int length);
     18    virtual int writeBytes(const byte* data, int length, int sender);
    1919    virtual int readBytes(byte* data, int maxLength, int * reciever);
    2020
  • trunk/src/subprojects/network/simple_sync.cc

    r6139 r6341  
    6666 *  write data to Synchronizeable
    6767 */
    68 void SimpleSync::writeBytes(const byte* data, int length)
     68int SimpleSync::writeBytes(const byte* data, int length, int sender)
    6969{
    7070  PRINTF(0)("SimpleSync: got %i bytes of data\n", length);
  • trunk/src/subprojects/network/simple_sync.h

    r6139 r6341  
    1616    ~SimpleSync();
    1717
    18     virtual void writeBytes(const byte* data, int length);
     18    virtual int writeBytes(const byte* data, int length, int sender);
    1919    virtual int readBytes(byte* data, int maxLength, int * reciever);
    2020
  • trunk/src/subprojects/network/write_sync.cc

    r6139 r6341  
    6666 *  write data to Synchronizeable
    6767 */
    68 void WriteSync::writeBytes(const byte* data, int length)
     68int WriteSync::writeBytes(const byte* data, int length, int sender)
    6969{
    7070  PRINTF(0)("WriteSync: got %i bytes of data\n", length);
  • trunk/src/subprojects/network/write_sync.h

    r6139 r6341  
    1616    ~WriteSync();
    1717
    18     virtual void writeBytes(const byte* data, int length);
     18    virtual int writeBytes(const byte* data, int length, int sender);
    1919    virtual int readBytes(byte* data, int maxLength, int * reciever);
    2020
Note: See TracChangeset for help on using the changeset viewer.