Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9770 in orxonox.OLD


Ignore:
Timestamp:
Sep 19, 2006, 9:51:24 PM (18 years ago)
Author:
bensch
Message:

cleanup

Location:
branches/new_class_id/src/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/coord/p_node.cc

    r9757 r9770  
    7979{
    8080  PRINTF(4)("delete %s::%s\n", this->getClassCName(), this->getCName());
    81   this->debugNode(0);
    8281  // remove the Node, delete it's children (if required).
    8382  while(!this->children.empty())
  • branches/new_class_id/src/lib/util/loading/load_param.cc

    r9769 r9770  
    4444 * @returns a pointer to itself.
    4545 */
    46 void LoadParamBase::describe(const std::string& descriptionText)
     46void LoadParamBase::describe(const ClassID& classID, const std::string& descriptionText)
    4747{
     48  PRINTF(5)("Describing Class '%s'(id:%d) Parameter '%s': description '%s'\n",
     49  classID.name().c_str(), classID.id(), paramName.c_str(), descriptionText.c_str());
     50
     51//  LoadParamDescription
     52
    4853  /// TODO REIMPLEMENT
    4954  /*  if (LoadParamClassDescription::parametersDescription && this->paramDesc && this->paramDesc->getDescription().empty())
     
    6570 * @returns the Value of the parameter if found, NULL otherwise
    6671*/
    67 std::string grabParameter(const TiXmlElement* root, const std::string& parameterName)
     72const std::string& LoadParamBase::grabParameter(const TiXmlElement* root, const std::string& parameterName)
    6873{
    69   const TiXmlElement* element;
    70   const TiXmlNode* node;
    71 
    72   if (root == NULL)
    73     return "";
    74 
    75   element = root->FirstChildElement( parameterName);
    76   if( element == NULL) return "";
    77 
    78   node = element->FirstChild();
    79   while( node != NULL)
     74  const TiXmlElement* const element = grabParameterElement(root, parameterName);
     75  if (element != NULL)
     76    return element->Value();
     77  else
    8078  {
    81     if( node->ToText()) return node->Value();
    82     node = node->NextSibling();
     79    static std::string empty("");
     80    return empty;
    8381  }
    84   return "";
    8582}
    8683
     
    9087 * @returns the Element of the parameter if found, NULL otherwise
    9188 */
    92 const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName)
     89const TiXmlElement* LoadParamBase::grabParameterElement(const TiXmlElement* root, const std::string& parameterName)
    9390{
    9491  const TiXmlElement* element;
  • branches/new_class_id/src/lib/util/loading/load_param.h

    r9769 r9770  
    9292
    9393protected:
    94   void describe(const std::string& descriptionText);
     94  void describe(const ClassID& id, const std::string& descriptionText);
     95
     96private:
     97  const std::string& grabParameter(const TiXmlElement* root, const std::string& parameterName);
     98  const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName);
     99
    95100
    96101protected:
     
    146151                            const MultiType& value4 = MT_NULL)
    147152  { this->executor->defaultValues(value0, value1, value2, value3, value4); return *this;  };
    148   CLoadParam& describe(const std::string& descriptionText) { LoadParamBase::describe(descriptionText); return *this; };
     153  CLoadParam& describe(const std::string& descriptionText) { LoadParamBase::describe(OperateClass::staticClassID(), descriptionText); return *this; };
    149154  //     CLoadParam& attribute(const std::string& attributeName, const Executor<SubString>& executor);
    150 
    151155
    152156private:
     
    157161// helper function
    158162
    159 std::string grabParameter(const TiXmlElement* root, const std::string& parameterName);
    160 const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName);
    161163
    162164#endif /* _LOAD_PARAM_H */
  • branches/new_class_id/src/lib/util/loading/load_param_xml.h

    r9769 r9770  
    5050
    5151//! A Class that can load XML tags onto an Object.
    52 template <class BaseClass = BaseObject> class XmlLoadParam : public LoadParamBase
     52template <class OperateClass = BaseObject> class XmlLoadParam : public LoadParamBase
    5353{
    5454public:
     
    6161   * @param inLoadCycle If we are inside of a loading cycle. (Loading will be different here)
    6262   */
    63   XmlLoadParam(const TiXmlElement* root, const std::string& paramName, BaseClass* object, Executor<const TiXmlElement*>* executor, bool inLoadCycle = false)
     63  XmlLoadParam(const TiXmlElement* root, const std::string& paramName, OperateClass* object, Executor<const TiXmlElement*>* executor, bool inLoadCycle = false)
    6464      : LoadParamBase(root, paramName, inLoadCycle), object(object) , executor(executor)
    6565  {
     
    7676
    7777  /** @param descriptionText the description @returns self @brief describes the Loading parameter. */
    78   XmlLoadParam& describe(const std::string& descriptionText) { LoadParamBase::describe(descriptionText); return *this; };
     78  XmlLoadParam& describe(const std::string& descriptionText) { LoadParamBase::describe(OperateClass::staticClassID(), descriptionText); return *this; };
    7979
    8080private:
    81   BaseClass*                        object;         //!< The Object to apply this to.
     81  OperateClass*                        object;         //!< The Object to apply this to.
    8282  Executor<const TiXmlElement*>*    executor;       //!< The Executor, that does the actual loading process.
    8383};
Note: See TracChangeset for help on using the changeset viewer.