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/core/Executor.h

    r1247 r1341  
    135135    return true
    136136
    137 namespace AccessLevel
    138 {
    139     enum Level
    140     {
    141         None,
    142         User,
    143         Admin,
    144         Offline,
    145         Debug,
    146         Disabled
    147     };
    148 }
    149 
    150137namespace orxonox
    151138{
     
    153140    {
    154141        public:
    155             Executor(Functor* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None);
     142            Executor(Functor* functor, const std::string& name = "");
    156143            virtual ~Executor();
    157144
     
    182169            const std::string& getDescriptionReturnvalue(int param) const;
    183170
     171            inline Functor* getFunctor() const
     172                { return this->functor_; }
    184173            inline unsigned int getParamCount() const
    185174                { return this->functor_->getParamCount(); }
     
    200189                { return this->name_; }
    201190
    202             inline void setAccessLevel(AccessLevel::Level level)
    203                 { this->accessLevel_ = level; }
    204             inline AccessLevel::Level getAccessLevel() const
    205                 { return this->accessLevel_; }
    206 
    207191            Executor& setDefaultValues(const MultiTypeMath& param1);
    208192            Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2);
     
    243227            bool bAddedDescriptionReturnvalue_;
    244228            bool bAddedDescriptionParam_[MAX_FUNCTOR_ARGUMENTS];
    245 
    246             AccessLevel::Level accessLevel_;
    247229    };
    248230
     
    250232    {
    251233        public:
    252             ExecutorStatic(FunctorStatic* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None) : Executor(functor, name, level) {}
     234            ExecutorStatic(FunctorStatic* functor, const std::string& name = "") : Executor(functor, name) {}
    253235            virtual ~ExecutorStatic() {}
    254236    };
     
    258240    {
    259241        public:
    260             ExecutorMember(FunctorMember<T>* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None) : Executor(functor, name, level) {}
     242            ExecutorMember(FunctorMember<T>* functor, const std::string& name = "") : Executor(functor, name) {}
    261243            virtual ~ExecutorMember() {}
    262244
     
    304286    };
    305287
    306     inline Executor* createExecutor(Functor* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
    307     {
    308         return new Executor(functor, name, level);
     288    inline Executor* createExecutor(Functor* functor, const std::string& name = "")
     289    {
     290        return new Executor(functor, name);
    309291    }
    310292
    311293    template <class T>
    312     inline ExecutorMember<T>* createExecutor(FunctorMember<T>* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
    313     {
    314         return new ExecutorMember<T>(functor, name, level);
     294    inline ExecutorMember<T>* createExecutor(FunctorMember<T>* functor, const std::string& name = "")
     295    {
     296        return new ExecutorMember<T>(functor, name);
    315297    }
    316298
    317     inline ExecutorStatic* createExecutor(FunctorStatic* functor, const std::string& name = "", AccessLevel::Level level = AccessLevel::None)
    318     {
    319         return new ExecutorStatic(functor, name, level);
     299    inline ExecutorStatic* createExecutor(FunctorStatic* functor, const std::string& name = "")
     300    {
     301        return new ExecutorStatic(functor, name);
    320302    }
    321303}
Note: See TracChangeset for help on using the changeset viewer.