Changeset 9727 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/load_param.cc
- Timestamp:
- Sep 14, 2006, 5:24:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/load_param.cc
r9406 r9727 18 18 #include "util/loading/load_param.h" 19 19 #include "load_param_description.h" 20 21 #include <stdarg.h> 22 20 #include "compiler.h" 21 #include "debug.h" 23 22 /** 24 23 * Constructs a new LoadParameter … … 28 27 * @param executor the Executor, that executes the loading procedure. 29 28 */ 30 CLoadParam::CLoadParam(const TiXmlElement* root, const std::string& paramName, BaseObject* object, Executor* executor, bool inLoadCycle) 31 : object(object), paramName(paramName) 32 { 33 this->inLoadCycle = inLoadCycle; 34 29 LoadParamBase::LoadParamBase(const TiXmlElement* root, const std::string& paramName, BaseObject* object, bool inLoadCycle) 30 : object(object), paramName(paramName), inLoadCycle(inLoadCycle) 31 { 35 32 // determin the LoadString. 36 33 if (likely(!inLoadCycle)) … … 40 37 else 41 38 this->loadElem = NULL; 42 39 } 40 41 42 /** 43 * @param descriptionText The text to set as a description for this Parameter 44 * @returns a pointer to itself. 45 */ 46 void LoadParamBase::describe(const std::string& descriptionText) 47 { 48 if (LoadClassDescription::parametersDescription && this->paramDesc && this->paramDesc->getDescription().empty()) 49 { 50 this->paramDesc->setDescription(descriptionText); 51 } 52 } 53 54 55 56 57 CLoadParam::CLoadParam(const TiXmlElement* root, const std::string& paramName, BaseObject* object, Executor<const SubString>* executor, bool inLoadCycle) 58 : LoadParamBase(root, paramName, object, inLoadCycle) 59 { 60 assert (executor != NULL); 43 61 // set the Executor. 44 62 this->executor = executor; 45 46 63 //if (this->executor) 47 64 // this->executor->setName(paramName); … … 56 73 CLoadParam::~CLoadParam() 57 74 { 58 if (likely(this->executor != NULL)) 59 { 60 std::string loadString = ""; 61 if (this->loadElem != NULL && this->loadElem->ToText()) 62 loadString = this->loadElem->Value(); 63 if (likely(this->object != NULL) && 64 ( !loadString.empty() || 65 ((this->executor->getType() & Executor_NoLoadString) == Executor_NoLoadString))) 75 assert(this->object != NULL); 76 77 std::string loadString; 78 if (this->loadElem != NULL && this->loadElem->ToText()) 79 { 80 loadString = this->loadElem->Value(); 81 if (!loadString.empty()) 66 82 { 67 PRINTF(4)("Loading value '%s' with Parameters '%s' onto: %s::%s\n", this->paramName.c_str(), loadString.c_str(), this->object->getClassCName(), this->object->getCName()); 83 PRINTF(0)("Loading value '%s' with Parameters '%s' onto: %s::%s\n", 84 this->paramName.c_str(), loadString.c_str(), this->object->getClassCName(), this->object->getCName()); 68 85 (*this->executor)(this->object, SubString(loadString, ",", SubString::WhiteSpaces, false, '\\')); 69 86 } 70 delete this->executor;71 }87 } 88 delete this->executor; 72 89 } 73 90 … … 90 107 } 91 108 92 93 94 /**95 * @param descriptionText The text to set as a description for this Parameter96 * @returns a pointer to itself.97 */98 CLoadParam& CLoadParam::describe(const std::string& descriptionText)99 {100 if (LoadClassDescription::parametersDescription && this->paramDesc && this->paramDesc->getDescription().empty())101 {102 this->paramDesc->setDescription(descriptionText);103 }104 return *this;105 }106 109 107 110 // const LoadParamDescription* LoadParamDescription::getClass(const char* className)
Note: See TracChangeset
for help on using the changeset viewer.