Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4599 in orxonox.OLD for orxonox/trunk/src/util/loading


Ignore:
Timestamp:
Jun 11, 2005, 3:23:35 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: loading of XML-elements is real smooth now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/loading/load_param.h

    r4598 r4599  
    306306  LoadParam4(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
    307307
    308   LoadParamPT(l_XML_ELEM);
     308
     309  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const TiXmlElement*), bool multi = false)
     310  : BaseLoadParam(root, pt2Object, paramName, 1, multi, NULL, "XML-Element")
     311  {
     312    if (root != NULL)
     313    {
     314      const TiXmlElement* elem = root->FirstChildElement(paramName);
     315      if (likely(elem != NULL))
     316        (*pt2Object.*function)(elem);
     317      else
     318        PRINTF(2)("%s of %s is empty", paramName, pt2Object->getClassName());
     319    }
     320    else
     321      PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
     322  }
     323
     324  //LoadParamPT(l_XML_ELEM);
    309325};
    310326
Note: See TracChangeset for help on using the changeset viewer.