Changeset 879 for code/branches/core2/src/orxonox/core/XMLPort.h
- Timestamp:
- Mar 10, 2008, 5:07:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/XMLPort.h
r878 r879 59 59 xmlcontainer##loadfunction##savefunction->port(this, xmlelement, loading) 60 60 61 #define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, loading, bApplyLoaderMask ) \61 #define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, loading, bApplyLoaderMask, bLoadBefore) \ 62 62 orxonox::XMLPortClassObjectContainer<classname, objectclass>* xmlcontainer##loadfunction##savefunction = (orxonox::XMLPortClassObjectContainer<classname, objectclass>*)(this->getIdentifier()->getXMLPortObjectContainer(sectionname)); \ 63 63 if (!xmlcontainer##loadfunction##savefunction) \ 64 64 { \ 65 xmlcontainer##loadfunction##savefunction = new orxonox::XMLPortClassObjectContainer<classname, objectclass>(this->getIdentifier()->getName(), std::string(sectionname), &classname::loadfunction, &classname::savefunction, bApplyLoaderMask ); \65 xmlcontainer##loadfunction##savefunction = new orxonox::XMLPortClassObjectContainer<classname, objectclass>(this->getIdentifier()->getName(), std::string(sectionname), &classname::loadfunction, &classname::savefunction, bApplyLoaderMask, bLoadBefore); \ 66 66 this->getIdentifier()->addXMLPortObjectContainer(sectionname, xmlcontainer##loadfunction##savefunction); \ 67 67 } \ … … 202 202 std::string sectionname_; 203 203 bool bApplyLoaderMask_; 204 bool bLoadBefore_; 204 205 205 206 private: … … 212 213 { 213 214 public: 214 XMLPortClassObjectContainer(const std::string classname, const std::string sectionname, void (T::*loadfunction)(O*), const O* (T::*savefunction)(unsigned int) const, bool bApplyLoaderMask )215 XMLPortClassObjectContainer(const std::string classname, const std::string sectionname, void (T::*loadfunction)(O*), const O* (T::*savefunction)(unsigned int) const, bool bApplyLoaderMask, bool bLoadBefore) 215 216 { 216 217 this->classname_ = classname; … … 219 220 this->savefunction_ = savefunction; 220 221 this->bApplyLoaderMask_ = bApplyLoaderMask; 222 this->bLoadBefore_ = bLoadBefore; 221 223 } 222 224 … … 248 250 newObject->setLoaderIndentation(object->getLoaderIndentation() + " "); 249 251 newObject->setLevel(object->getLevel()); 250 newObject->XMLPort(*child, true); 252 newObject->setNamespace(object->getNamespace()); 253 if (this->bLoadBefore_) 254 newObject->XMLPort(*child, true); 251 255 COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->classname_ << " (objectname " << object->getName() << ")" << std::endl; 252 256 (*object.*this->loadfunction_)(newObject); 257 if (!this->bLoadBefore_) 258 newObject->XMLPort(*child, true); 253 259 COUT(5) << " ...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl; 254 260 }
Note: See TracChangeset
for help on using the changeset viewer.