Changeset 9770 in orxonox.OLD for branches/new_class_id/src
- Timestamp:
- Sep 19, 2006, 9:51:24 PM (18 years ago)
- 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 79 79 { 80 80 PRINTF(4)("delete %s::%s\n", this->getClassCName(), this->getCName()); 81 this->debugNode(0);82 81 // remove the Node, delete it's children (if required). 83 82 while(!this->children.empty()) -
branches/new_class_id/src/lib/util/loading/load_param.cc
r9769 r9770 44 44 * @returns a pointer to itself. 45 45 */ 46 void LoadParamBase::describe(const std::string& descriptionText)46 void LoadParamBase::describe(const ClassID& classID, const std::string& descriptionText) 47 47 { 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 48 53 /// TODO REIMPLEMENT 49 54 /* if (LoadParamClassDescription::parametersDescription && this->paramDesc && this->paramDesc->getDescription().empty()) … … 65 70 * @returns the Value of the parameter if found, NULL otherwise 66 71 */ 67 std::stringgrabParameter(const TiXmlElement* root, const std::string& parameterName)72 const std::string& LoadParamBase::grabParameter(const TiXmlElement* root, const std::string& parameterName) 68 73 { 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 80 78 { 81 if( node->ToText()) return node->Value();82 node = node->NextSibling();79 static std::string empty(""); 80 return empty; 83 81 } 84 return "";85 82 } 86 83 … … 90 87 * @returns the Element of the parameter if found, NULL otherwise 91 88 */ 92 const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName)89 const TiXmlElement* LoadParamBase::grabParameterElement(const TiXmlElement* root, const std::string& parameterName) 93 90 { 94 91 const TiXmlElement* element; -
branches/new_class_id/src/lib/util/loading/load_param.h
r9769 r9770 92 92 93 93 protected: 94 void describe(const std::string& descriptionText); 94 void describe(const ClassID& id, const std::string& descriptionText); 95 96 private: 97 const std::string& grabParameter(const TiXmlElement* root, const std::string& parameterName); 98 const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName); 99 95 100 96 101 protected: … … 146 151 const MultiType& value4 = MT_NULL) 147 152 { 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; }; 149 154 // CLoadParam& attribute(const std::string& attributeName, const Executor<SubString>& executor); 150 151 155 152 156 private: … … 157 161 // helper function 158 162 159 std::string grabParameter(const TiXmlElement* root, const std::string& parameterName);160 const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName);161 163 162 164 #endif /* _LOAD_PARAM_H */ -
branches/new_class_id/src/lib/util/loading/load_param_xml.h
r9769 r9770 50 50 51 51 //! A Class that can load XML tags onto an Object. 52 template <class BaseClass = BaseObject> class XmlLoadParam : public LoadParamBase52 template <class OperateClass = BaseObject> class XmlLoadParam : public LoadParamBase 53 53 { 54 54 public: … … 61 61 * @param inLoadCycle If we are inside of a loading cycle. (Loading will be different here) 62 62 */ 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) 64 64 : LoadParamBase(root, paramName, inLoadCycle), object(object) , executor(executor) 65 65 { … … 76 76 77 77 /** @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; }; 79 79 80 80 private: 81 BaseClass* object; //!< The Object to apply this to.81 OperateClass* object; //!< The Object to apply this to. 82 82 Executor<const TiXmlElement*>* executor; //!< The Executor, that does the actual loading process. 83 83 };
Note: See TracChangeset
for help on using the changeset viewer.