Changeset 7180 for code/branches/consolecommands3/src
- Timestamp:
- Aug 18, 2010, 3:43:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/Functor.h
r7179 r7180 185 185 void setBaseObject(BaseObject* object) 186 186 { 187 this->bConstObject_ = false;188 187 this->object_ = dynamic_cast<T*>(object); 188 this->constObject_ = 0; 189 189 } 190 190 191 191 void setBaseObject(const BaseObject* object) 192 192 { 193 this-> bConstObject_ = true;193 this->object_ = 0; 194 194 this->constObject_ = dynamic_cast<const T*>(object); 195 195 } … … 197 197 BaseObject* getBaseObject() const 198 198 { 199 if (this->bConstObject_) 199 if (this->object_) 200 return upcast<BaseObject*>(this->object_); 201 else 200 202 return const_cast<BaseObject*>(upcast<const BaseObject*>(this->constObject_)); 203 } 204 205 void setRawObjectPointer(void* object) 206 { 207 this->object_ = (T*)object; 208 this->constObject_ = 0; 209 } 210 211 void* getRawObjectPointer() const 212 { 213 if (this->object_) 214 return (void*)this->object_; 201 215 else 202 return upcast<BaseObject*>(this->object_);203 }204 205 void setRawObjectPointer(void* object)206 {207 this->bConstObject_ = false;208 this->object_ = (T*)object;209 }210 211 void* getRawObjectPointer() const212 {213 if (this->bConstObject_)214 216 return (void*)this->constObject_; 215 else216 return (void*)this->object_;217 217 } 218 218
Note: See TracChangeset
for help on using the changeset viewer.