Changeset 4256 in orxonox.OLD for orxonox/branches/levelLoader/src/util/loading
- Timestamp:
- May 22, 2005, 2:31:08 AM (20 years ago)
- Location:
- orxonox/branches/levelLoader/src/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelLoader/src/util/loading/load_param.cc
r4255 r4256 21 21 #include <stdarg.h> 22 22 23 23 /** 24 \param object The object this Parameter is loaded too. 25 \param paramName The name of the parameter loaded. 26 \param paramCount how many parameters this loading-function takes 27 \param ... the parameter information 28 */ 24 29 BaseLoadParam::BaseLoadParam(BaseObject* object, const char* paramName, int paramCount, ...) 25 30 { … … 48 53 } 49 54 50 55 /** 56 \param descriptionText The text to set as a description for this Parameter 57 */ 51 58 void BaseLoadParam::describe(const char* descriptionText) 52 59 { … … 57 64 } 58 65 66 /** 67 \param paramName the name of the parameter to load 68 */ 59 69 LoadParamDescription::LoadParamDescription(const char* paramName) 60 70 { … … 65 75 } 66 76 67 77 /** 78 \brief removes all the alocated memory 79 */ 68 80 LoadParamDescription::~LoadParamDescription(void) 69 81 { … … 74 86 delete []this->types; 75 87 delete []this->paramName; 76 } 77 88 delete []this->description; 89 } 90 91 /** 92 \param descriptionText The text to set as a description for this Parameter 93 */ 78 94 void LoadParamDescription::setDescription(const char* descriptionText) 79 95 { 80 this->description = descriptionText; 81 } 82 96 this->description = new char[strlen(descriptionText)+1]; 97 strcpy(this->description, descriptionText); 98 } 99 100 /** 101 \brief prints out this parameter, its input method and the description (if availiable) 102 */ 83 103 void LoadParamDescription::print(void) const 84 104 { … … 96 116 } 97 117 98 118 /** 119 \brief A list, that holds all the classes that are loadable (classes not objects!!) 120 */ 99 121 tList<LoadClassDescription>* LoadClassDescription::classList = new tList<LoadClassDescription>; 100 122 … … 104 126 bool LoadClassDescription::parametersDescription = true; 105 127 128 /** 129 \param className the name of the class to be loadable 130 */ 106 131 LoadClassDescription::LoadClassDescription(const char* className) 107 132 { … … 114 139 } 115 140 116 141 /** 142 \brief deletes a classDescription (deletes all the parameterDescriptions as well 143 */ 117 144 LoadClassDescription::~LoadClassDescription(void) 118 145 { … … 129 156 } 130 157 131 158 /** 159 \brief adds a class to the list of loadable classes 160 \param className The name of the class to add 161 162 this function searches for the className string, and if found just returns the appropriate Class. 163 Otherwise it returns a new classDescription 164 */ 132 165 LoadClassDescription* LoadClassDescription::addClass(const char* className) 133 166 { … … 148 181 } 149 182 150 183 /** 184 \brief does the same as addClass(const char* className), but with params 185 \param paramName the name of the parameter to add. 186 */ 151 187 LoadParamDescription* LoadClassDescription::addParam(const char* paramName) 152 188 { … … 168 204 } 169 205 206 /** 207 \brief prints out all loadable Classes, and their parameters 208 */ 170 209 void LoadClassDescription::printAll(void) 171 210 { -
orxonox/branches/levelLoader/src/util/loading/load_param.h
r4255 r4256 155 155 156 156 157 //! A class that handles the description of loadable parameters 157 158 class LoadParamDescription 158 159 { … … 169 170 void print(void) const; 170 171 private: 171 char* paramName; 172 int paramCount; 173 char** types; 174 c onst char* description;172 char* paramName; //!< The name of the parameter 173 int paramCount; //!< The count of parameters 174 char** types; //!< What kind of parameters does this function take ?? 175 char* description; //!< A longer description about this function 175 176 }; 176 177 … … 187 188 static void printAll(void); 188 189 189 static bool parametersDescription; 190 static tList<LoadClassDescription>* classList; 190 static bool parametersDescription; //!< if parameter-description should be enabled. 191 static tList<LoadClassDescription>* classList; //!< a list, that holds all the loadable classes. (after one instance has been loaded) 191 192 private: 192 char* className; 193 tList<LoadParamDescription>* paramList; 193 char* className; //!< name of the class 194 tList<LoadParamDescription>* paramList; //!< List of parameters this class knows. 194 195 }; 195 196 … … 204 205 205 206 protected: 206 LoadClassDescription* classDesc; 207 LoadParamDescription* paramDesc; 208 }; 209 210 211 // derived template class207 LoadClassDescription* classDesc; //!< The LoadClassDescription of this LoadParameter 208 LoadParamDescription* paramDesc; //!< The LoadParameterDescription of this LoadParameter 209 }; 210 211 212 //! derived template class, so all the Classes can load something. 212 213 template<class T> class LoadParam : public BaseLoadParam 213 214 {
Note: See TracChangeset
for help on using the changeset viewer.