Changeset 9779 in orxonox.OLD for branches/new_class_id
- Timestamp:
- Sep 20, 2006, 10:08:58 AM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/shell/shell_command.h
r9777 r9779 56 56 */ 57 57 #define SHELL_COMMAND_STATIC(command, class, function) \ 58 OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class, BaseObject>( &class::function))58 OrxShell::ShellCommand* shell_command_##class##_##command = OrxShell::ShellCommand::registerCommand(#command, #class, createExecutor<class, BaseObject>(function)) 59 59 60 60 -
branches/new_class_id/src/lib/shell/some_shell_commands.cc
r9777 r9779 55 55 SHELL_COMMAND(debug, ResourceManager, debug); 56 56 #include "loading/load_param_class_description.h" 57 OrxShell::ShellCommand* shell_command_LPCD_printAll = 58 OrxShell::ShellCommand::registerCommand("printAll", "LoadParamClassDescription", 59 new Executor2_static<LoadParamClassDescription, const SubString, const std::string&, bool>(&LoadParamClassDescription::printAll)) 60 //SHELL_COMMAND_STATIC(print, LoadParamClassDescription, printAll) 57 SHELL_COMMAND_STATIC(printAll, LoadParamClassDescription, &LoadParamClassDescription::printAll) 61 58 ->defaultValues(MT_NULL, true); 59 SHELL_COMMAND_STATIC(capture, LoadParamClassDescription, &LoadParamClassDescription::captureDescriptions) 60 ->defaultValues(true); -
branches/new_class_id/src/lib/util/executor/functor_list.h
r9748 r9779 62 62 63 63 //! mixed values: 64 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, bool); 64 65 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, int); 65 66 FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, float); -
branches/new_class_id/src/lib/util/loading/load_param.cc
r9777 r9779 47 47 { 48 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());49 classID.name().c_str(), classID.id(), paramName.c_str(), descriptionText.c_str()); 50 50 51 LoadParamClassDescription::describeClass(classID, paramName, descriptionText); 51 if (LoadParamClassDescription::descriptionsCaptured()) 52 LoadParamClassDescription::describeClass(classID, paramName, descriptionText); 52 53 } 53 54 … … 57 58 void LoadParamBase::setDescriptionValues(const ClassID& classID, unsigned int paramCount, const MultiType* const defaultValues, bool retVal) 58 59 { 59 if(LoadParamClassDescription:: createsDescriptions())60 if(LoadParamClassDescription::descriptionsCaptured()) 60 61 LoadParamClassDescription::setValuesOf(classID, paramName, paramCount, defaultValues, retVal); 61 62 } -
branches/new_class_id/src/lib/util/loading/load_param_class_description.cc
r9778 r9779 27 27 * @brief if the description of Parameters should be executed 28 28 */ 29 bool LoadParamClassDescription::_c reateParametersDescription= false;29 bool LoadParamClassDescription::_captureDescriptions = false; 30 30 31 31 /** … … 114 114 } 115 115 116 void LoadParamClassDescription::print(FILE* stream, bool withComments) const 117 { 118 fprintf(stream, "<%s>\n", this->_className.c_str()); 119 for (ParamDescriptionMap::const_iterator param = this->_parameters.begin(); 120 param != this->_parameters.end(); 121 ++param) 122 { 123 (*param).second.print(stream, withComments); 124 } 125 fprintf(stream, "</%s>\n\n", this->_className.c_str()); 126 } 127 128 116 129 /** 117 130 * @brief prints out all loadable Classes, and their parameters … … 147 160 classIt ++) 148 161 { 149 fprintf(stream, "<%s>\n", (*classIt).second._className.c_str()); 150 for (ParamDescriptionMap::const_iterator param = (*classIt).second._parameters.begin(); 151 param != (*classIt).second._parameters.end(); 152 ++param) 153 { 154 (*param).second.print(stream, withComments); 155 } 156 fprintf(stream, "</%s>\n\n", (*classIt).second._className.c_str()); 162 (*classIt).second.print(stream, withComments); 157 163 } 158 164 fprintf(stream, "===============================================================\n"); -
branches/new_class_id/src/lib/util/loading/load_param_class_description.h
r9777 r9779 52 52 53 53 /** @param createThem: if the Parameters should be created/stored. */ 54 static void c reateDescriptions(bool createThem) { _createParametersDescription= createThem; };54 static void captureDescriptions(bool createThem) { _captureDescriptions = createThem; }; 55 55 /** @returns if the Parameters are created/stored. */ 56 static bool createsDescriptions() { return _createParametersDescription; };56 static bool descriptionsCaptured() { return _captureDescriptions; }; 57 57 58 58 static void deleteAllDescriptions(); 59 59 60 void print(FILE* stream = stdout, bool withComments = true) const; 60 61 static void printAll(const std::string& fileName = "", bool withComments = true); 61 62 static void printAllTo(FILE* stream = stdout, bool withComments = true); … … 72 73 private: 73 74 74 static bool _c reateParametersDescription;//!< if parameter-description should be enabled globally.75 static bool _captureDescriptions; //!< if parameter-description should be enabled globally. 75 76 76 77 static ClassDescriptionMap _classList; //!< a list, that stores all the loadable classes. (after one instance has been loaded)
Note: See TracChangeset
for help on using the changeset viewer.