Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6341 in orxonox.OLD for trunk/src/lib/lang


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/lib/lang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/base_object.cc

    r6282 r6341  
    2222#include "compiler.h"
    2323#include "class_list.h"
     24
     25#include "synchronizeable.h"
    2426
    2527using namespace std;
     
    180182
    181183}
     184
     185/**
     186 * Writes data from network containing information about the state
     187 * @param data pointer to data
     188 * @param length length of data
     189 * @param sender hostID of sender
     190 */
     191int BaseObject::writeState( const byte * data, int length, int sender )
     192{
     193  SYNCHELP_READ_BEGIN();
     194
     195  if ( objectName )
     196  {
     197    delete[] objectName;
     198    objectName = NULL;
     199  }
     200  SYNCHELP_READ_STRINGM( this->objectName );
     201
     202  return SYNCHELP_READ_N;
     203}
     204
     205/**
     206 * data copied in data will bee sent to another host
     207 * @param data pointer to data
     208 * @param maxLength max length of data
     209 * @return the number of bytes writen
     210 */
     211int BaseObject::readState( byte * data, int maxLength )
     212{
     213  SYNCHELP_WRITE_BEGIN();
     214
     215  SYNCHELP_WRITE_STRING( this->objectName );
     216
     217  return SYNCHELP_WRITE_N;
     218}
  • trunk/src/lib/lang/base_object.h

    r6280 r6341  
    1515#define NULL     0    //!< NULL
    1616#endif
     17
     18#include "stdincl.h"
    1719
    1820class TiXmlElement;
     
    4547  bool operator==(ClassID classID) { return this->isA(classID); };
    4648
     49  int       writeState(const byte* data, int length, int sender);
     50  int       readState(byte* data, int maxLength );
    4751 protected:
    4852  void setClassID(ClassID classID, const char* className);
Note: See TracChangeset for help on using the changeset viewer.