Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
May 29, 2006, 3:28:41 PM (19 years ago)
Author:
patrick
Message:

trunk: merged the network branche back to trunk.

Location:
trunk/src/lib/lang
Files:
2 edited

Legend:

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

    r7661 r7954  
    8282  assert (!(this->classID & classID & !CL_MASK_SUBSUPER_CLASS_IDA ));
    8383
     84  this->leafClassID = classID;
    8485  this->classID |= (long)classID;
    8586  this->className = className;
     
    105106 * Factory::fabricate(Object->getLeafClassID());
    106107 */
    107 ClassID BaseObject::getLeafClassID() const
     108const ClassID& BaseObject::getLeafClassID() const
    108109{
    109   assert (this->classList != NULL);
    110   return this->classList->getLeafClassID();
     110  return this->leafClassID;
    111111}
    112112
     
    176176
    177177}
    178 
    179 /**
    180  * Writes data from network containing information about the state
    181  * @param data pointer to data
    182  * @param length length of data
    183  * @param sender hostID of sender
    184  */
    185 int BaseObject::writeState( const byte * data, int length, int sender )
    186 {
    187   SYNCHELP_READ_BEGIN();
    188 
    189   SYNCHELP_READ_STRING( this->objectName, NWT_BO_NAME );
    190 
    191   return SYNCHELP_READ_N;
    192 }
    193 
    194 /**
    195  * data copied in data will bee sent to another host
    196  * @param data pointer to data
    197  * @param maxLength max length of data
    198  * @return the number of bytes writen
    199  */
    200 int BaseObject::readState( byte * data, int maxLength )
    201 {
    202   SYNCHELP_WRITE_BEGIN();
    203 
    204   //PRINTF(0)("objectname = %s\n", this->objectName);
    205   SYNCHELP_WRITE_STRING( this->objectName, NWT_BO_NAME );
    206 
    207   return SYNCHELP_WRITE_N;
    208 }
  • trunk/src/lib/lang/base_object.h

    r7779 r7954  
    4242  /** @returns the classID of the corresponding Object */
    4343  inline int getClassID() const { return this->classID; };
    44   ClassID    getLeafClassID() const;
     44  const ClassID& getLeafClassID() const;
    4545
    4646  bool isA (ClassID classID) const;
     
    5252  bool operator==(ClassID classID) { return this->isA(classID); };
    5353
    54   int       writeState(const byte* data, int length, int sender);
    55   int       readState(byte* data, int maxLength );
    56 
    5754 protected:
    5855   void setClassID(ClassID classID, const std::string& className);
     56   std::string        objectName;        //!< The name of this object
    5957
    6058 private:
    6159    std::string        className;        //!< the name of the class
    6260    long               classID;          //!< this is the id from the class_id.h enumeration
    63     std::string        objectName;       //!< The name of this object
     61    ClassID            leafClassID;      //!< The Leaf Class ID
    6462
    6563    ClassList*         classList;        //!< Pointer to the ClassList this Object is inside of
Note: See TracChangeset for help on using the changeset viewer.