Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 20, 2005, 5:14:27 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new (LoadParam && ExecutorSpecials)-Functionality that enables the Loading of XML-elements.
The new Executor really works out, and makes the understanding of loadParam way easier (given you won't read Executor :)

Location:
trunk/src/util/loading
Files:
2 edited

Legend:

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

    r5646 r5651  
    111111  this->loadString = grabParameter(root, paramName);
    112112  this->object = object;
    113   if (loadString != NULL && root != NULL)
     113  if (root != NULL)
    114114  {
    115115    this->executor = executor.clone();
     
    119119    this->executor = NULL;
    120120  }
     121
    121122}
     123
     124
    122125LoadParamBase::~LoadParamBase()
    123126{
    124127  if (likely(this->executor != NULL))
    125128  {
    126     if (this->loadString!= NULL && likely(this->object != NULL))
    127     this->executor->execute(this->object, this->loadString);
     129   if (likely(this->object != NULL))
     130     this->executor->execute(this->object, this->loadString);
    128131
    129132    delete this->executor;
     
    175178  const TiXmlNode* node;
    176179
    177   if (root == NULL)
     180  if (root == NULL || parameterName == NULL)
    178181    return NULL;
    179182  assert( parameterName != NULL);
  • trunk/src/util/loading/load_param.h

    r5646 r5651  
    3030#include "tinyxml.h"
    3131#include "executor/executor.h"
     32#include "executor/executor_specials.h"
    3233
    3334#include "helper_functions.h"
     
    5152#define LoadParamNEW(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \
    5253         LoadParamBase(ROOT, PARAMETER_NAME, OBJECT, ExecutorObjective<CLASS>(&CLASS::FUNCTION))
     54
     55#define LoadParamXML(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \
     56         LoadParamBase(ROOT, PARAMETER_NAME, OBJECT, ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME))
    5357
    5458
Note: See TracChangeset for help on using the changeset viewer.