Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 10, 2008, 5:07:48 PM (16 years ago)
Author:
landauf
Message:

started implementing the Namespace hierarchy (still unfinished)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/XMLPort.h

    r878 r879  
    5959    xmlcontainer##loadfunction##savefunction->port(this, xmlelement, loading)
    6060
    61 #define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, loading, bApplyLoaderMask) \
     61#define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, loading, bApplyLoaderMask, bLoadBefore) \
    6262    orxonox::XMLPortClassObjectContainer<classname, objectclass>* xmlcontainer##loadfunction##savefunction = (orxonox::XMLPortClassObjectContainer<classname, objectclass>*)(this->getIdentifier()->getXMLPortObjectContainer(sectionname)); \
    6363    if (!xmlcontainer##loadfunction##savefunction) \
    6464    { \
    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); \
    6666        this->getIdentifier()->addXMLPortObjectContainer(sectionname, xmlcontainer##loadfunction##savefunction); \
    6767    } \
     
    202202            std::string sectionname_;
    203203            bool bApplyLoaderMask_;
     204            bool bLoadBefore_;
    204205
    205206        private:
     
    212213    {
    213214        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)
    215216            {
    216217                this->classname_ = classname;
     
    219220                this->savefunction_ = savefunction;
    220221                this->bApplyLoaderMask_ = bApplyLoaderMask;
     222                this->bLoadBefore_ = bLoadBefore;
    221223            }
    222224
     
    248250                                            newObject->setLoaderIndentation(object->getLoaderIndentation() + "  ");
    249251                                            newObject->setLevel(object->getLevel());
    250                                             newObject->XMLPort(*child, true);
     252                                            newObject->setNamespace(object->getNamespace());
     253                                            if (this->bLoadBefore_)
     254                                                newObject->XMLPort(*child, true);
    251255                                            COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->classname_ << " (objectname " << object->getName() << ")" << std::endl;
    252256                                            (*object.*this->loadfunction_)(newObject);
     257                                            if (!this->bLoadBefore_)
     258                                                newObject->XMLPort(*child, true);
    253259                                            COUT(5) << "  ...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
    254260                                        }
Note: See TracChangeset for help on using the changeset viewer.