Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2008, 1:33:42 AM (16 years ago)
Author:
landauf
Message:

big commit, but not much changes in code:

  • put CommandEvaluation into it's own .cc and .h files
  • put some basic ConsoleCommands into ConsoleCommandCompilation.cc and .h
  • created a new class, ConsoleCommand, inheriting from ExecutorStatic, implementing all command-related features that were located in the Executor until now (at the moment only accessLevel_, but more will come - from reto and me)
  • renamed ConsoleCommand-macros to SetConsoleCommand (all related macros were changed the same way)
  • added a new command named "killdelays", that kills all delayed commands. helpful to stop disco ;)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/orxonox/tools/Timer.cc

    r1063 r1341  
    2727 */
    2828
     29#include <set>
     30
    2931#include "OrxonoxStableHeaders.h"
    3032#include "Timer.h"
     
    3739namespace orxonox
    3840{
    39     ConsoleCommandShortcutExtern(delay, AccessLevel::None);
     41    SetConsoleCommandShortcutExtern(delay);
     42    SetConsoleCommandShortcutExtern(killdelays);
     43
     44    static std::set<StaticTimer*> delaytimerset;
    4045
    4146    /**
     
    4752    {
    4853        StaticTimer *delaytimer = new StaticTimer();
     54        delaytimerset.insert(delaytimer);
     55
    4956        ExecutorStatic* delayexecutor = createExecutor(createFunctor(&executeDelayedCommand));
    5057        delayexecutor->setDefaultValues(delaytimer, command);
     
    6168        CommandExecutor::execute(command);
    6269        delete timer;
     70        delaytimerset.erase(timer);
     71    }
     72
     73    /**
     74        @brief Kills all delayed commands.
     75    */
     76    void killdelays()
     77    {
     78        for (std::set<StaticTimer*>::iterator it = delaytimerset.begin(); it != delaytimerset.end(); ++it)
     79            delete (*it);
     80
     81        delaytimerset.clear();
    6382    }
    6483
Note: See TracChangeset for help on using the changeset viewer.