- Timestamp:
- Nov 19, 2005, 9:48:38 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/base_object.cc
r5642 r5645 62 62 { 63 63 // name setup 64 LoadParam<BaseObject>(root, "name", this, &BaseObject::setName) 65 .describe("the name of the Object at hand"); 64 LoadParamBase(root, "name", this, ExecutorObjective<BaseObject>(&BaseObject::setName)) 65 .describe("the Name of the Object."); 66 // LoadParam<BaseObject>(root, "name", this, &BaseObject::setName) 67 //.describe("the name of the Object at hand"); 66 68 } 67 69 … … 86 88 if (this->objectName) 87 89 delete[] this->objectName; 88 if (objectName )90 if (objectName != NULL) 89 91 { 90 92 this->objectName = new char[strlen(objectName)+1]; -
trunk/src/util/loading/load_param.cc
r5634 r5645 35 35 { 36 36 this->setClassID(CL_LOAD_PARAM, "LoadParam"); 37 this->executor = NULL; 37 38 38 39 this->loadString = NULL; … … 106 107 } 107 108 109 LoadParamBase::LoadParamBase(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor) 110 { 111 this->loadString = grabParameter(root, paramName); 112 113 if (loadString != NULL && root != NULL) 114 { 115 this->executor = executor.clone(); 116 this->executor->execute(object, loadString); 117 } 118 else 119 { 120 this->executor = NULL; 121 } 122 } 123 LoadParamBase::~LoadParamBase() 124 { 125 if (likely(this->executor != NULL)) 126 delete this->executor; 127 128 } 129 130 131 108 132 /** 109 133 * @param descriptionText The text to set as a description for this Parameter -
trunk/src/util/loading/load_param.h
r5644 r5645 29 29 #include "substring.h" 30 30 #include "tinyxml.h" 31 #include "executor/executor.h" 31 32 32 33 #include "helper_functions.h" … … 44 45 class LoadParamBase : public BaseObject 45 46 { 46 public: 47 LoadParamBase* describe(const char* descriptionText); 48 LoadParamBase* defaultValues(unsigned int count, ...); 49 50 protected: 51 LoadParamBase(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, bool multi, const void* pointerToParam, ...); 52 53 protected: 54 LoadClassDescription* classDesc; //!< The LoadClassDescription of this LoadParameter 55 LoadParamDescription* paramDesc; //!< The LoadParameterDescription of this LoadParameter 56 const char* loadString; //!< The string loaded by this LoadParam 57 const void* pointerToParam; //!< A Pointer to a Parameter. 58 59 MultiType* defaultValue; 47 public: 48 LoadParamBase(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& exeutor); 49 ~LoadParamBase(); 50 51 LoadParamBase* describe(const char* descriptionText); 52 LoadParamBase* defaultValues(unsigned int count, ...); 53 54 protected: 55 LoadParamBase(const TiXmlElement* root, BaseObject* object, const char* paramName, int paramCount, bool multi, const void* pointerToParam, ...); 56 57 protected: 58 Executor* executor; 59 60 LoadClassDescription* classDesc; //!< The LoadClassDescription of this LoadParameter 61 LoadParamDescription* paramDesc; //!< The LoadParameterDescription of this LoadParameter 62 const char* loadString; //!< The string loaded by this LoadParam 63 const void* pointerToParam; //!< A Pointer to a Parameter. 64 65 MultiType* defaultValue; 60 66 }; 61 67 … … 75 81 * called element, and that you must say true at the Fith parameter, or it will fail 76 82 * also you will have to close the Cycle again with LOAD_PARAM_END_CYCLE 83 * 77 84 * @param ROOT The root XLM-element to search element under. 78 85 * @param ELEMENT the element to search
Note: See TracChangeset
for help on using the changeset viewer.