Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9779 in orxonox.OLD for branches/new_class_id/src


Ignore:
Timestamp:
Sep 20, 2006, 10:08:58 AM (18 years ago)
Author:
bensch
Message:

load_params: caputring is now to be enabled for performance reasons

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  
    5656   */
    5757#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))
    5959
    6060
  • branches/new_class_id/src/lib/shell/some_shell_commands.cc

    r9777 r9779  
    5555SHELL_COMMAND(debug, ResourceManager, debug);
    5656#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)
     57SHELL_COMMAND_STATIC(printAll, LoadParamClassDescription, &LoadParamClassDescription::printAll)
    6158->defaultValues(MT_NULL, true);
     59SHELL_COMMAND_STATIC(capture, LoadParamClassDescription, &LoadParamClassDescription::captureDescriptions)
     60    ->defaultValues(true);
  • branches/new_class_id/src/lib/util/executor/functor_list.h

    r9748 r9779  
    6262
    6363  //! mixed values:
     64  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, bool);
    6465  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, int);
    6566  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, float);
  • branches/new_class_id/src/lib/util/loading/load_param.cc

    r9777 r9779  
    4747{
    4848  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());
    5050
    51   LoadParamClassDescription::describeClass(classID, paramName, descriptionText);
     51  if (LoadParamClassDescription::descriptionsCaptured())
     52    LoadParamClassDescription::describeClass(classID, paramName, descriptionText);
    5253}
    5354
     
    5758void LoadParamBase::setDescriptionValues(const ClassID& classID, unsigned int paramCount, const MultiType* const defaultValues, bool retVal)
    5859{
    59   if(LoadParamClassDescription::createsDescriptions())
     60  if(LoadParamClassDescription::descriptionsCaptured())
    6061    LoadParamClassDescription::setValuesOf(classID, paramName, paramCount, defaultValues, retVal);
    6162}
  • branches/new_class_id/src/lib/util/loading/load_param_class_description.cc

    r9778 r9779  
    2727 * @brief if the description of Parameters should be executed
    2828 */
    29 bool LoadParamClassDescription::_createParametersDescription = false;
     29bool LoadParamClassDescription::_captureDescriptions = false;
    3030
    3131/**
     
    114114}
    115115
     116void 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
    116129/**
    117130 * @brief prints out all loadable Classes, and their parameters
     
    147160       classIt ++)
    148161  {
    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);
    157163  }
    158164  fprintf(stream, "===============================================================\n");
  • branches/new_class_id/src/lib/util/loading/load_param_class_description.h

    r9777 r9779  
    5252
    5353  /** @param createThem: if the Parameters should be created/stored. */
    54   static void createDescriptions(bool createThem) { _createParametersDescription = createThem; };
     54  static void captureDescriptions(bool createThem) { _captureDescriptions = createThem; };
    5555  /** @returns if the Parameters are created/stored. */
    56   static bool createsDescriptions() { return _createParametersDescription; };
     56  static bool descriptionsCaptured() { return _captureDescriptions; };
    5757
    5858  static void deleteAllDescriptions();
    5959
     60  void print(FILE* stream = stdout, bool withComments = true) const;
    6061  static void printAll(const std::string& fileName = "", bool withComments = true);
    6162  static void printAllTo(FILE* stream = stdout, bool withComments = true);
     
    7273private:
    7374
    74   static bool                                  _createParametersDescription;  //!< if parameter-description should be enabled globally.
     75  static bool                                  _captureDescriptions;    //!< if parameter-description should be enabled globally.
    7576
    7677  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.