Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5646 in orxonox.OLD


Ignore:
Timestamp:
Nov 19, 2005, 10:01:46 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: new Macro for LoadParam

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/base_object.cc

    r5645 r5646  
    6262{
    6363  // name setup
    64   LoadParamBase(root, "name", this, ExecutorObjective<BaseObject>(&BaseObject::setName))
     64  LoadParamNEW(root, "name", this, BaseObject, setName)
     65  //LoadParamBase(root, "name", this, ExecutorObjective<BaseObject>(&BaseObject::setName))
    6566      .describe("the Name of the Object.");
    6667//  LoadParam<BaseObject>(root, "name", this, &BaseObject::setName)
  • trunk/src/util/loading/load_param.cc

    r5645 r5646  
    110110{
    111111  this->loadString = grabParameter(root, paramName);
    112 
     112  this->object = object;
    113113  if (loadString != NULL && root != NULL)
    114114  {
    115115    this->executor = executor.clone();
    116     this->executor->execute(object, loadString);
    117116  }
    118117  else
     
    124123{
    125124  if (likely(this->executor != NULL))
     125  {
     126    if (this->loadString!= NULL && likely(this->object != NULL))
     127    this->executor->execute(this->object, this->loadString);
     128
    126129    delete this->executor;
     130  }
    127131
    128132}
  • trunk/src/util/loading/load_param.h

    r5645 r5646  
    3838class LoadParamDescription;
    3939class MultiType;
     40
     41
     42/**
     43 * Loads a Parameter from ROOT named PARAMETER_NAME
     44 * onto OBJECT of CLASS, trough the FUNCTION
     45 * @param ROOT the TiXmlElement to load the Parameter from
     46 * @param PARAMETER_NAME the Name of the Parameter to load
     47 * @param OBJECT The BaseObject to load the new setting to.
     48 * @param CLASS What Class the BaseObejct is of (this is for identifying the Functuon)
     49 * @param FUNCTION The function of Class to Load (if you want to call &CLASS::FUNCTION write FUNCTION here).
     50 */
     51#define LoadParamNEW(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \
     52         LoadParamBase(ROOT, PARAMETER_NAME, OBJECT, ExecutorObjective<CLASS>(&CLASS::FUNCTION))
     53
    4054
    4155/**************************
     
    5771  protected:
    5872    Executor*                executor;
     73    BaseObject*              object;
    5974
    6075    LoadClassDescription*    classDesc;            //!< The LoadClassDescription of this LoadParameter
Note: See TracChangeset for help on using the changeset viewer.