Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 20, 2005, 6:32:39 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new LoadParam procedure with all NON-cycling load-options, and it works perfectly (on first sight :))

now going to make the same for cycling LoadOptions

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

Legend:

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

    r5651 r5652  
    110110{
    111111  this->loadString = grabParameter(root, paramName);
     112  this->paramName = paramName;
    112113  this->object = object;
    113114  if (root != NULL)
     
    127128  if (likely(this->executor != NULL))
    128129  {
    129    if (likely(this->object != NULL))
    130      this->executor->execute(this->object, this->loadString);
    131 
     130    printf("%s: %s", this->paramName, this->loadString);
     131    if (likely(this->object != NULL && this->executor != NULL) &&
     132        ( this->loadString != NULL ||
     133         ((this->executor->getType() & Executor_NoLoadString) == Executor_NoLoadString)))
     134    {
     135      printf(" - exec");
     136      this->executor->execute(this->object, this->loadString);
     137    }
     138    printf ("\n");
    132139    delete this->executor;
    133140  }
    134141
     142}
     143
     144
     145LoadParamBase* LoadParamBase::defaultValues(unsigned int count, ...)
     146{
     147  if (this == NULL)
     148    return NULL;
     149
     150  va_list values;
     151  va_start(values, count);
     152
     153  assert(executor != NULL);
     154  this->executor->defaultValues(count, values);
     155
     156  return this;
    135157}
    136158
  • trunk/src/util/loading/load_param.h

    r5651 r5652  
    2222#define _LOAD_PARAM_H
    2323
    24 #include "functor_list.h"
    25 
    26 #include "debug.h"
    27 
    28 #include "factory.h"
    29 #include "substring.h"
    30 #include "tinyxml.h"
     24#include "base_object.h"
     25
    3126#include "executor/executor.h"
    3227#include "executor/executor_specials.h"
     
    7469
    7570  protected:
     71    bool                     withLoadString;       //!< If we need the loadString to execute this.
    7672    Executor*                executor;
    7773    BaseObject*              object;
     74    const char*              paramName;
    7875
    7976    LoadClassDescription*    classDesc;            //!< The LoadClassDescription of this LoadParameter
Note: See TracChangeset for help on using the changeset viewer.