Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

orxonox/trunk: further cleanup

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

Legend:

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

    r5652 r5653  
    107107}
    108108
     109/**
     110 * Constructs a new LoadParameter
     111 * @param root the XML-element to load this Parameter from
     112 * @param paramName the Parameter to load
     113 * @param object the BaseObject, to load this parameter on to (will be cast to executor's Parameter)
     114 * @param executor the Executor, that executes the loading procedure.
     115 */
    109116LoadParamBase::LoadParamBase(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor)
    110117{
     
    123130}
    124131
    125 
     132/**
     133 * This is a VERY SPECIAL deconsrtuctor.
     134 * It is made, so that it loads the Parameters on destruction.
     135 * meaning, if an Executor a valid Object exist, and all
     136 * Execution-Conditions are met, they are executed here.
     137 */
    126138LoadParamBase::~LoadParamBase()
    127139{
    128140  if (likely(this->executor != NULL))
    129141  {
    130     printf("%s: %s", this->paramName, this->loadString);
    131142    if (likely(this->object != NULL && this->executor != NULL) &&
    132143        ( this->loadString != NULL ||
    133144         ((this->executor->getType() & Executor_NoLoadString) == Executor_NoLoadString)))
    134145    {
    135       printf(" - exec");
     146      PRINTF(4)("Loading '%s' with Parameters '%s' onto: '%s'(%s)\n", this->paramName, this->loadString, this->object->getName(), this->object->getClassName());
    136147      this->executor->execute(this->object, this->loadString);
    137148    }
    138     printf ("\n");
    139149    delete this->executor;
    140150  }
     
    142152}
    143153
    144 
     154/**
     155 * set the default values of the executor
     156 * @param count how many default values to set.
     157 * @param ... the default values !! must be at least count parameters!!
     158 */
    145159LoadParamBase* LoadParamBase::defaultValues(unsigned int count, ...)
    146160{
  • trunk/src/util/loading/load_param.h

    r5652 r5653  
    284284#include "functor_list.h"
    285285#undef FUNCTOR_LIST
    286 
    287   //! makes functions with one Vector loadable
    288   //LoadParam1(l_VECTOR);
    289 
    290   // loads a Ti-XML-element
    291   LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const TiXmlElement*), bool multi = false)
    292   : LoadParamBase(root, pt2Object, paramName, 1, multi, NULL, "XML")
    293   {
    294     if (root != NULL)
    295     {
    296       const TiXmlElement* elem = root->FirstChildElement(paramName);
    297       if (elem != NULL)
    298         (*pt2Object.*function)(elem);
    299       else
    300         PRINTF(4)("%s of %s is empty\n", paramName, pt2Object->getClassName());
    301     }
    302     else
    303       PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
    304   }
    305 
    306   //LoadParamPT(l_XML_ELEM);
    307286};
    308287
Note: See TracChangeset for help on using the changeset viewer.