Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 11, 2015, 10:36:15 PM (10 years ago)
Author:
landauf
Message:

moved code from static initializer into new function in ConsoleCommandManager

Location:
code/branches/core7/src/libraries/core/command
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/command/ConsoleCommandIncludes.cc

    r10352 r10354  
    3535    void StaticallyInitializedConsoleCommand::load()
    3636    {
    37         for (size_t i = 0; i < this->command_->getNames().size(); ++i)
    38         {
    39             const ConsoleCommand::CommandName& name = this->command_->getNames()[i];
    40             ConsoleCommandManager::registerCommand(name.group_, name.name_, this->command_);
    41         }
     37        ConsoleCommandManager::registerCommand(this->command_);
    4238    }
    4339}
  • code/branches/core7/src/libraries/core/command/ConsoleCommandManager.cc

    r10346 r10354  
    118118        static std::map<std::string, std::map<std::string, ConsoleCommand*> > commandMapLC;
    119119        return commandMapLC;
     120    }
     121
     122    /**
     123        @brief Registers a new command with the groups and names that are defined by ConsoleCommand::getNames().
     124    */
     125    /* static */ void ConsoleCommandManager::registerCommand(ConsoleCommand* command)
     126    {
     127        for (size_t i = 0; i < command->getNames().size(); ++i)
     128        {
     129            const ConsoleCommand::CommandName& name = command->getNames()[i];
     130            ConsoleCommandManager::registerCommand(name.group_, name.name_, command);
     131        }
    120132    }
    121133
  • code/branches/core7/src/libraries/core/command/ConsoleCommandManager.h

    r10346 r10354  
    4545    {
    4646        public:
     47            static void registerCommand(ConsoleCommand* command);
    4748            static void registerCommand(const std::string& group, const std::string& name, ConsoleCommand* command);
    4849            static void unregisterCommand(ConsoleCommand* command);
Note: See TracChangeset for help on using the changeset viewer.