Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5644 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Nov 19, 2005, 5:08:53 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better loadparam start and end-cycle.

Location:
trunk/src/util
Files:
2 edited

Legend:

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

    r5556 r5644  
    7575 * called element, and that you must say true at the Fith parameter, or it will fail
    7676 * also you will have to close the Cycle again with LOAD_PARAM_END_CYCLE
    77  */
    78 #define LOAD_PARAM_START_CYCLE   const TiXmlElement* element; \
    79                                  element = root->FirstChildElement(); \
    80                                  while( element != NULL) \
    81 {
    82 /**
    83    * closes a LoadParam Loop
    84    * @see LOAD_PARAM_START_CYCLE
    85  */
    86 #define LOAD_PARAM_END_CYCLE        element = element->NextSiblingElement(); \
    87 }
     77 * @param ROOT The root XLM-element to search element under.
     78 * @param ELEMENT the element to search
     79 */
     80#define LOAD_PARAM_START_CYCLE(ROOT, ELEMENT) \
     81  const TiXmlElement* ELEMENT; \
     82  ELEMENT= ROOT->FirstChildElement(); \
     83  while( ELEMENT != NULL) \
     84  {
     85/**
     86 * closes a LoadParam Loop
     87 * @see LOAD_PARAM_START_CYCLE
     88 * @param ELEMENT the Element to step through.
     89 */
     90#define LOAD_PARAM_END_CYCLE(ELEMENT) \
     91  ELEMENT = ELEMENT->NextSiblingElement(); \
     92  }
    8893
    8994
  • trunk/src/util/track/track_manager.cc

    r5344 r5644  
    398398  double x, y, z, d;
    399399
    400   LOAD_PARAM_START_CYCLE
     400  LOAD_PARAM_START_CYCLE(root, element)
    401401
    402402      LoadParam<TrackManager>(element, "WorkOn", this, &TrackManager::workOnS, true)
     
    445445        }
    446446      */
    447       LOAD_PARAM_END_CYCLE;
     447      LOAD_PARAM_END_CYCLE(element);
    448448}
    449449
Note: See TracChangeset for help on using the changeset viewer.