Changeset 7954 in orxonox.OLD for trunk/src/lib/lang
- Timestamp:
- May 29, 2006, 3:28:41 PM (19 years ago)
- Location:
- trunk/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/base_object.cc
r7661 r7954 82 82 assert (!(this->classID & classID & !CL_MASK_SUBSUPER_CLASS_IDA )); 83 83 84 this->leafClassID = classID; 84 85 this->classID |= (long)classID; 85 86 this->className = className; … … 105 106 * Factory::fabricate(Object->getLeafClassID()); 106 107 */ 107 ClassIDBaseObject::getLeafClassID() const108 const ClassID& BaseObject::getLeafClassID() const 108 109 { 109 assert (this->classList != NULL); 110 return this->classList->getLeafClassID(); 110 return this->leafClassID; 111 111 } 112 112 … … 176 176 177 177 } 178 179 /**180 * Writes data from network containing information about the state181 * @param data pointer to data182 * @param length length of data183 * @param sender hostID of sender184 */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 host196 * @param data pointer to data197 * @param maxLength max length of data198 * @return the number of bytes writen199 */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 42 42 /** @returns the classID of the corresponding Object */ 43 43 inline int getClassID() const { return this->classID; }; 44 ClassIDgetLeafClassID() const;44 const ClassID& getLeafClassID() const; 45 45 46 46 bool isA (ClassID classID) const; … … 52 52 bool operator==(ClassID classID) { return this->isA(classID); }; 53 53 54 int writeState(const byte* data, int length, int sender);55 int readState(byte* data, int maxLength );56 57 54 protected: 58 55 void setClassID(ClassID classID, const std::string& className); 56 std::string objectName; //!< The name of this object 59 57 60 58 private: 61 59 std::string className; //!< the name of the class 62 60 long classID; //!< this is the id from the class_id.h enumeration 63 std::string objectName; //!< The name of this object61 ClassID leafClassID; //!< The Leaf Class ID 64 62 65 63 ClassList* classList; //!< Pointer to the ClassList this Object is inside of
Note: See TracChangeset
for help on using the changeset viewer.