Changeset 1502 for code/trunk/src/core/Executor.h
- Timestamp:
- Jun 1, 2008, 3:54:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/Executor.h
r1349 r1502 35 35 #include "util/SubString.h" 36 36 #include "util/String.h" 37 #include "util/Math.h" 37 38 #include "Functor.h" 38 39 #include "Debug.h" … … 100 101 COUT(5) << tokens[i]; \ 101 102 } \ 102 COUT(5) << ") and " << (paramCount - tokens.size()) << " default values ("; \103 COUT(5) << ") and " << max((int)paramCount - (int)tokens.size(), 0) << " default values ("; \ 103 104 for (unsigned int i = tokens.size(); i < paramCount; i++) \ 104 105 { \ … … 134 135 return true 135 136 136 namespace AccessLevel137 {138 enum Level139 {140 None,141 User,142 Admin,143 Offline,144 Debug,145 Disabled146 };147 }148 149 137 namespace orxonox 150 138 { … … 152 140 { 153 141 public: 154 Executor(Functor* functor, const std::string& name = "" , AccessLevel::Level level = AccessLevel::None);142 Executor(Functor* functor, const std::string& name = ""); 155 143 virtual ~Executor(); 156 144 … … 181 169 const std::string& getDescriptionReturnvalue(int param) const; 182 170 171 inline Functor* getFunctor() const 172 { return this->functor_; } 183 173 inline unsigned int getParamCount() const 184 174 { return this->functor_->getParamCount(); } … … 199 189 { return this->name_; } 200 190 201 inline void setAccessLevel(AccessLevel::Level level)202 { this->accessLevel_ = level; }203 inline AccessLevel::Level getAccessLevel() const204 { return this->accessLevel_; }205 206 inline Executor& setKeybindMode(KeybindMode::Enum mode)207 { this->keybindMode_ = mode; return *this; }208 inline KeybindMode::Enum getKeybindMode() const209 { return this->keybindMode_; }210 211 inline Executor& setAxisParamIndex(int index)212 { this->axisParamIndex_ = index; return *this; }213 inline int getAxisParamIndex() const214 { return this->axisParamIndex_; }215 216 inline Executor& setIsAxisRelative(bool val)217 { this->bAxisRelative_ = val; return *this; }218 inline int getIsAxisRelative() const219 { return this->bAxisRelative_; }220 221 191 Executor& setDefaultValues(const MultiTypeMath& param1); 222 192 Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2); … … 249 219 bool bAddedDefaultValue_[MAX_FUNCTOR_ARGUMENTS]; 250 220 251 KeybindMode::Enum keybindMode_;252 int axisParamIndex_;253 bool bAxisRelative_;254 255 221 private: 256 222 LanguageEntryLabel description_; … … 261 227 bool bAddedDescriptionReturnvalue_; 262 228 bool bAddedDescriptionParam_[MAX_FUNCTOR_ARGUMENTS]; 263 264 AccessLevel::Level accessLevel_;265 229 }; 266 230 … … 268 232 { 269 233 public: 270 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) {} 271 235 virtual ~ExecutorStatic() {} 272 236 }; … … 276 240 { 277 241 public: 278 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) {} 279 243 virtual ~ExecutorMember() {} 280 244 … … 322 286 }; 323 287 324 inline Executor* createExecutor(Functor* functor, const std::string& name = "" , AccessLevel::Level level = AccessLevel::None)325 { 326 return new Executor(functor, name , level);288 inline Executor* createExecutor(Functor* functor, const std::string& name = "") 289 { 290 return new Executor(functor, name); 327 291 } 328 292 329 293 template <class T> 330 inline ExecutorMember<T>* createExecutor(FunctorMember<T>* functor, const std::string& name = "" , AccessLevel::Level level = AccessLevel::None)331 { 332 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); 333 297 } 334 298 335 inline ExecutorStatic* createExecutor(FunctorStatic* functor, const std::string& name = "" , AccessLevel::Level level = AccessLevel::None)336 { 337 return new ExecutorStatic(functor, name , level);299 inline ExecutorStatic* createExecutor(FunctorStatic* functor, const std::string& name = "") 300 { 301 return new ExecutorStatic(functor, name); 338 302 } 339 303 }
Note: See TracChangeset
for help on using the changeset viewer.