Changeset 10768 for code/branches/cpp11_v2/src/libraries/core/command
- Timestamp:
- Nov 6, 2015, 10:54:34 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/core/command
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc
r10765 r10768 54 54 void CommandEvaluation::initialize(const std::string& command) 55 55 { 56 this->execCommand_ = 0;57 this->hintCommand_ = 0;56 this->execCommand_ = nullptr; 57 this->hintCommand_ = nullptr; 58 58 this->string_ = command; 59 59 this->execArgumentsOffset_ = 0; -
code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.h
r10765 r10768 86 86 87 87 int execute(); 88 MultiType query(int* error = 0);88 MultiType query(int* error = nullptr); 89 89 90 90 std::string complete(); … … 97 97 /// Returns true if the command evaluation contains a valid command that can be executed. 98 98 inline bool isValid() const 99 { return (this->execCommand_ != 0); }99 { return (this->execCommand_ != nullptr); } 100 100 101 101 /// Returns the console command that was evaluated by this object. -
code/branches/cpp11_v2/src/libraries/core/command/CommandExecutor.h
r8858 r10768 113 113 static int execute(const std::string& command, bool useTcl = true, bool printErrors = true); // tolua_export 114 114 115 static MultiType queryMT(const std::string& command, int* error = 0, bool useTcl = true);116 static std::string query(const std::string& command, int* error = 0, bool useTcl = true); // tolua_export115 static MultiType queryMT(const std::string& command, int* error = nullptr, bool useTcl = true); 116 static std::string query(const std::string& command, int* error = NULL, bool useTcl = true); // tolua_export 117 117 118 118 static CommandEvaluation evaluate(const std::string& command); -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc
r10765 r10768 76 76 77 77 for (size_t i = 0; i < MAX_FUNCTOR_ARGUMENTS; ++i) 78 this->argumentCompleter_[i] = 0;78 this->argumentCompleter_[i] = nullptr; 79 79 80 80 this->keybindMode_ = KeybindMode::OnPress; … … 353 353 { 354 354 if (this->executor_) 355 this->executor_->setFunctor( 0);355 this->executor_->setFunctor(nullptr); 356 356 this->objectStack_.clear(); 357 357 } … … 405 405 void ConsoleCommand::popObject() 406 406 { 407 void* newobject = 0;407 void* newobject = nullptr; 408 408 if (!this->objectStack_.empty()) 409 409 { … … 422 422 return this->executor_->getFunctor()->getRawObjectPointer(); 423 423 else 424 return 0;424 return nullptr; 425 425 } 426 426 … … 528 528 return this->argumentCompleter_[index]; 529 529 else 530 return 0;530 return nullptr; 531 531 } 532 532 -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommandManager.cc
r10624 r10768 39 39 namespace orxonox 40 40 { 41 ConsoleCommandManager* ConsoleCommandManager::singletonPtr_s = 0;41 ConsoleCommandManager* ConsoleCommandManager::singletonPtr_s = nullptr; 42 42 43 43 /** … … 68 68 orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl; 69 69 } 70 return 0;70 return nullptr; 71 71 } 72 72 … … 101 101 orxout(internal_error, context::commands) << "Couldn't find console command with group \"" << group << "\" and name \"" << name << "\"" << endl; 102 102 } 103 return 0;103 return nullptr; 104 104 } 105 105 … … 125 125 126 126 // check if a command with this name already exists 127 if (this->getCommand(group, name) != 0)127 if (this->getCommand(group, name) != nullptr) 128 128 { 129 129 if (group == "") -
code/branches/cpp11_v2/src/libraries/core/command/Executor.h
r9550 r10768 121 121 { return (*this->functor_)(arg1, arg2, arg3, arg4, arg5); } 122 122 123 MultiType parse(const std::string& arguments, int* error = 0, const std::string& delimiter = " ", bool bPrintError = false) const;124 MultiType parse(const SubString& arguments, int* error = 0, const std::string& delimiter = " ", bool bPrintError = false) const;125 126 int evaluateArguments(const SubString& arguments, MultiType arg[MAX_FUNCTOR_ARGUMENTS], int* error = 0, const std::string& delimiter = " ") const;123 MultiType parse(const std::string& arguments, int* error = nullptr, const std::string& delimiter = " ", bool bPrintError = false) const; 124 MultiType parse(const SubString& arguments, int* error = nullptr, const std::string& delimiter = " ", bool bPrintError = false) const; 125 126 int evaluateArguments(const SubString& arguments, MultiType arg[MAX_FUNCTOR_ARGUMENTS], int* error = nullptr, const std::string& delimiter = " ") const; 127 127 128 128 /// Changes the functor. … … 249 249 250 250 /// Overloads Executor::parse() with an additional object-pointer. 251 MultiType parse(T* object, const std::string& arguments, int* error = 0, const std::string& delimiter = " ", bool bPrintError = false) const251 MultiType parse(T* object, const std::string& arguments, int* error = nullptr, const std::string& delimiter = " ", bool bPrintError = false) const 252 252 { 253 253 T* oldobject = this->functorMember_->getObject(); -
code/branches/cpp11_v2/src/libraries/core/command/Functor.h
r10765 r10768 242 242 public: 243 243 /// Constructor: Stores the object-pointer. 244 FunctorMember(O* object = 0) : object_(object), bSafeMode_(false) {}244 FunctorMember(O* object = nullptr) : object_(object), bSafeMode_(false) {} 245 245 virtual ~FunctorMember() { if (this->bSafeMode_) { this->unregisterObject(this->object_); } } 246 246 … … 310 310 /// Will be called by Destroyable::~Destroyable() if the stored object is deleted and the Functor is in safe mode. 311 311 inline void objectDeleted() 312 { this->object_ = 0; }312 { this->object_ = nullptr; } 313 313 314 314 O* object_; ///< The stored object-pointer, used to execute a member-function (or nullptr for static functions) … … 322 322 public: 323 323 /// Constructor: Stores the object-pointer. 324 FunctorMember(void* object = 0) {}324 FunctorMember(void* object = nullptr) {} 325 325 326 326 /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be nullptr. @return Returns the return-value of the function (if any; MultiType::Null otherwise) … … 330 330 MultiType operator()(const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null) 331 331 { 332 return (*this)((void*) 0, param1, param2, param3, param4, param5);332 return (*this)((void*)nullptr, param1, param2, param3, param4, param5); 333 333 } 334 334 … … 342 342 // see Functor::getRawObjectPointer() 343 343 inline void* getRawObjectPointer() const 344 { return 0; }344 { return nullptr; } 345 345 346 346 // see Functor::setSafeMode() … … 369 369 public: 370 370 /// Constructor: Initializes the base class and stores the function-pointer. 371 FunctorPointer(F functionPointer, O* object = 0) : FunctorMember<O>(object), functionPointer_(functionPointer) {}371 FunctorPointer(F functionPointer, O* object = nullptr) : FunctorMember<O>(object), functionPointer_(functionPointer) {} 372 372 373 373 /// Changes the function-pointer. … … 494 494 public: 495 495 /// Constructor: Initializes the base class. 496 FunctorTemplate(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object = 0) : FunctorPointer<typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type, O>(functionPointer, object) {}496 FunctorTemplate(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object = nullptr) : FunctorPointer<typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type, O>(functionPointer, object) {} 497 497 498 498 // see FunctorMember::operator()() -
code/branches/cpp11_v2/src/libraries/core/command/IOConsolePOSIX.cc
r10765 r10768 62 62 , promptString_("orxonox # ") 63 63 , bStatusPrinted_(false) 64 , originalTerminalSettings_( 0)64 , originalTerminalSettings_(nullptr) 65 65 { 66 66 this->setTerminalMode(); … … 326 326 tcsetattr(0, TCSANOW, IOConsole::singletonPtr_s->originalTerminalSettings_); 327 327 delete IOConsole::singletonPtr_s->originalTerminalSettings_; 328 IOConsole::singletonPtr_s->originalTerminalSettings_ = 0;328 IOConsole::singletonPtr_s->originalTerminalSettings_ = nullptr; 329 329 } 330 330 } -
code/branches/cpp11_v2/src/libraries/core/command/IRC.cc
r10624 r10768 66 66 IRC::IRC() 67 67 { 68 this->interpreter_ = 0;68 this->interpreter_ = nullptr; 69 69 } 70 70 -
code/branches/cpp11_v2/src/libraries/core/command/TclBind.cc
r10765 r10768 47 47 SetConsoleCommand("bgerror", &TclBind::bgerror).hide(); 48 48 49 TclBind* TclBind::singletonPtr_s = 0;49 TclBind* TclBind::singletonPtr_s = nullptr; 50 50 51 51 /** … … 55 55 TclBind::TclBind(const std::string& datapath) 56 56 { 57 this->interpreter_ = 0;57 this->interpreter_ = nullptr; 58 58 this->bSetTclDataPath_ = false; 59 59 this->setDataPath(datapath); -
code/branches/cpp11_v2/src/libraries/core/command/TclBind.h
r8079 r10768 121 121 static void tcl_execute(Tcl::object const &args); 122 122 123 static std::string eval(const std::string& tclcode, int* error = 0);123 static std::string eval(const std::string& tclcode, int* error = nullptr); 124 124 125 125 private: -
code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc
r10624 r10768 86 86 }; 87 87 88 TclThreadManager* TclThreadManager::singletonPtr_s = 0;88 TclThreadManager* TclThreadManager::singletonPtr_s = nullptr; 89 89 90 90 /** … … 289 289 catch (const Tcl::tcl_error& e) 290 290 { 291 bundle->interpreter_ = 0;291 bundle->interpreter_ = nullptr; 292 292 orxout(user_error, context::tcl) << "Tcl error while creating Tcl-interpreter (" << id_string << "): " << e.what() << endl; 293 293 } … … 521 521 { 522 522 TclThreadManager::error("No Tcl-interpreter with ID " + multi_cast<std::string>(id) + " existing."); 523 return 0;523 return nullptr; 524 524 } 525 525 }
Note: See TracChangeset
for help on using the changeset viewer.