Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2006, 5:28:10 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: compiles again, BUT well…. i do not expect it to run anymore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/util/loading/load_param.cc

    r7201 r7203  
    2828 * @param executor the Executor, that executes the loading procedure.
    2929 */
    30 CLoadParam::CLoadParam(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor, bool inLoadCycle)
    31 {
    32   this->paramName = paramName;
     30CLoadParam::CLoadParam(const TiXmlElement* root, const std::string& paramName, BaseObject* object, const Executor& executor, bool inLoadCycle)
     31  :  paramName(paramName), object(object)
     32{
    3333  this->object = object;
    3434  this->inLoadCycle = inLoadCycle;
     
    3737  if (likely(!inLoadCycle))
    3838    this->loadElem = grabParameterElement(root, paramName);
    39   //this->loadString = grabParameter(root, paramName);
    40   else if (!strcmp(root->Value(), paramName))
     39  else if (paramName == root->Value())
    4140    this->loadElem = (TiXmlElement*)root->FirstChild();
    4241  else
     
    4645  this->executor = executor.clone();
    4746
    48   if (this->executor)
    49     this->executor->setName(paramName);
     47  //if (this->executor)
     48  //  this->executor->setName(paramName);
    5049}
    5150
     
    6059  if (likely(this->executor != NULL))
    6160  {
     61    std::string loadString;
    6262    if (this->loadElem != NULL &&  this->loadElem->ToText())
    63       this->loadString = this->loadElem->Value();
    64     else
    65       this->loadString = NULL;
     63      loadString = this->loadElem->Value();
    6664    if (likely(this->object != NULL) &&
    67         ( this->loadString != NULL ||
     65        ( !loadString.empty() ||
    6866          ((this->executor->getType() & Executor_NoLoadString) == Executor_NoLoadString)))
    6967    {
    70       PRINTF(4)("Loading '%s' with Parameters '%s' onto: '%s'(%s)\n", this->paramName, this->loadString, this->object->getName(), this->object->getClassName());
    71       this->executor->execute(this->object, this->loadString);
     68      PRINTF(4)("Loading '%s' with Parameters '%s' onto: '%s'(%s)\n", this->paramName, loadString, this->object->getName(), this->object->getClassName());
     69      this->executor->execute(this->object, &loadString);
    7270    }
    7371    delete this->executor;
     
    9997 * @returns a pointer to itself.
    10098*/
    101 CLoadParam& CLoadParam::describe(const char* descriptionText)
    102 {
    103   if (LoadClassDescription::parametersDescription && this->paramDesc && !this->paramDesc->getDescription())
     99CLoadParam& CLoadParam::describe(const std::string& descriptionText)
     100{
     101  if (LoadClassDescription::parametersDescription && this->paramDesc && this->paramDesc->getDescription().empty())
    104102  {
    105103    this->paramDesc->setDescription(descriptionText);
     
    230228 * @returns the Value of the parameter if found, NULL otherwise
    231229*/
    232 const char* grabParameter(const TiXmlElement* root, const char* parameterName)
     230std::string grabParameter(const TiXmlElement* root, const std::string& parameterName)
    233231{
    234232  const TiXmlElement* element;
    235233  const TiXmlNode* node;
    236234
    237   if (root == NULL || parameterName == NULL)
     235  if (root == NULL)
    238236    return NULL;
    239   assert( parameterName != NULL);
    240237
    241238  element = root->FirstChildElement( parameterName);
     
    256253 * @returns the Element of the parameter if found, NULL otherwise
    257254 */
    258 const TiXmlElement* grabParameterElement(const TiXmlElement* root, const char* parameterName)
     255const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName)
    259256{
    260257  const TiXmlElement* element;
    261258  const TiXmlNode* node;
    262259
    263   if (root == NULL || parameterName == NULL)
     260  if (root == NULL)
    264261    return NULL;
    265   assert( parameterName != NULL);
    266262
    267263  element = root->FirstChildElement( parameterName);
Note: See TracChangeset for help on using the changeset viewer.