Changeset 10765 for code/branches/cpp11_v2/src/libraries/core/command
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/core/command
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc
r10624 r10765 119 119 /** 120 120 @brief Executes the command which was evaluated by this object and returns its return-value. 121 @param error A pointer to an integer (or NULL) which will be used to write error codes to (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")121 @param error A pointer to an integer (or nullptr) which will be used to write error codes to (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 122 122 @return Returns the result of the command (or MultiType::Null if there is no return value) 123 123 */ -
code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.h
r8079 r10765 137 137 static std::string getCommonBegin(const ArgumentCompletionList& list); 138 138 139 const ConsoleCommand* execCommand_; ///< The command that will be executed (can be NULLif the command is not valid)139 const ConsoleCommand* execCommand_; ///< The command that will be executed (can be nullptr if the command is not valid) 140 140 const ConsoleCommand* hintCommand_; ///< The command that is used to display hints and argument lists (can be different to execCommand_ in some cases) 141 141 SubString tokens_; ///< The single words of the command string, split into tokens -
code/branches/cpp11_v2/src/libraries/core/command/CommandExecutor.cc
r10624 r10765 81 81 @brief Executes a command and returns its return-value. 82 82 @param command A string containing the command 83 @param error A pointer to a value (or NULL) where the error-code should be written to (see @ref CommandExecutorErrorCodes "error codes")83 @param error A pointer to a value (or nullptr) where the error-code should be written to (see @ref CommandExecutorErrorCodes "error codes") 84 84 @param useTcl If true, the command is passed to tcl (see TclBind) 85 85 @return Returns the return-value of the command (if any - MultiType::Null otherwise) … … 127 127 @brief Executes a command and returns its return-value as string. 128 128 @param command A string containing the command 129 @param error A pointer to a value (or NULL) where the error-code should be written to (see @ref CommandExecutorErrorCodes "error codes")129 @param error A pointer to a value (or nullptr) where the error-code should be written to (see @ref CommandExecutorErrorCodes "error codes") 130 130 @param useTcl If true, the command is passed to tcl (see TclBind) 131 131 @return Returns the return-value of the command converted to a string (or "" if there's no return value) -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc
r10624 r10765 348 348 349 349 /** 350 @brief Sets the functor to NULL(which also deactivates the command).350 @brief Sets the functor to nullptr (which also deactivates the command). 351 351 */ 352 352 void ConsoleCommand::resetFunction() -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.h
r10624 r10765 195 195 { if (this->command_) { this->command_->popFunction(); } return *this; } 196 196 197 /// Sets the current function-pointer to NULL, which also deactivates the command.197 /// Sets the current function-pointer to nullptr, which also deactivates the command. 198 198 inline ConsoleCommandManipulator& resetFunction() 199 199 { if (this->command_) { this->command_->resetFunction(); } return *this; } … … 205 205 inline ConsoleCommandManipulator& pushObject(void* object) 206 206 { if (this->command_) { this->command_->pushObject(object); } return *this; } 207 /// Removes the current object from the object-stack and restores the old object (or NULLif there's no object left on the stack).207 /// Removes the current object from the object-stack and restores the old object (or nullptr if there's no object left on the stack). 208 208 inline ConsoleCommandManipulator& popObject() 209 209 { if (this->command_) { this->command_->popObject(); } return *this; } -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommandIncludes.h
r10624 r10765 331 331 @brief Returns a manipulator for a command with the given name. 332 332 333 @note If the command doesn't exist, the manipulator contains a NULL pointer to the command,333 @note If the command doesn't exist, the manipulator contains a nullptr to the command, 334 334 but it can still be used without checks, because all functions of ConsoleCommandManipulator 335 335 check internally if the command exists. … … 340 340 @brief Returns a manipulator for a command with the given group and name. 341 341 342 @note If the command doesn't exist, the manipulator contains a NULL pointer to the command,342 @note If the command doesn't exist, the manipulator contains a nullptr to the command, 343 343 but it can still be used without checks, because all functions of ConsoleCommandManipulator 344 344 check internally if the command exists. -
code/branches/cpp11_v2/src/libraries/core/command/Executor.cc
r9550 r10765 76 76 @brief Calls the wrapped function with arguments that are passed in a string. 77 77 @param arguments The arguments that should be passed to the function, separated by @a delimiter 78 @param error A pointer to a variable (or NULL) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")78 @param error A pointer to a variable (or nullptr) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 79 79 @param delimiter The delimiter that is used to separate the arguments in the string @a arguments 80 80 @param bPrintError If true, errors are printed to the console if the function couldn't be executed with the given arguments … … 89 89 @brief Calls the wrapped function with arguments that are passed as tokens in a SubString 90 90 @param arguments The arguments that should be passed to the function 91 @param error A pointer to a variable (or NULL) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")91 @param error A pointer to a variable (or nullptr) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 92 92 @param delimiter The delimiter that was used to separate the arguments in the SubString @a arguments (used to join the surplus arguments) 93 93 @param bPrintError If true, errors are printed to the console if the function couldn't be executed with the given arguments … … 127 127 @param arguments The arguments that should be converted 128 128 @param arg An array of MultiType where the converted arguments will be stored 129 @param error A pointer to a variable (or NULL) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")129 @param error A pointer to a variable (or nullptr) that is used to store the error code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 130 130 @param delimiter The delimiter that was used to separate the arguments in the SubString @a arguments (used to join the surplus arguments) 131 131 @return Returns the number of evaluated arguments -
code/branches/cpp11_v2/src/libraries/core/command/Functor.h
r9667 r10765 215 215 virtual void* getRawObjectPointer() const = 0; 216 216 217 /// Enables or disables the safe mode which causes the functor to change the object pointer to NULLif the object is deleted (only member functors).217 /// Enables or disables the safe mode which causes the functor to change the object pointer to nullptr if the object is deleted (only member functors). 218 218 virtual void setSafeMode(bool bSafeMode) = 0; 219 219 … … 245 245 virtual ~FunctorMember() { if (this->bSafeMode_) { this->unregisterObject(this->object_); } } 246 246 247 /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be NULL. @return Returns the return-value of the function (if any; MultiType::Null otherwise)247 /// 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) 248 248 virtual MultiType operator()(O* object, 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) = 0; 249 249 … … 312 312 { this->object_ = 0; } 313 313 314 O* object_; ///< The stored object-pointer, used to execute a member-function (or NULLfor static functions)315 bool bSafeMode_; ///< If true, the functor is in safe mode and registers itself as listener at the object and changes the pointer to NULLif the object is deleted314 O* object_; ///< The stored object-pointer, used to execute a member-function (or nullptr for static functions) 315 bool bSafeMode_; ///< If true, the functor is in safe mode and registers itself as listener at the object and changes the pointer to nullptr if the object is deleted 316 316 }; 317 317 … … 324 324 FunctorMember(void* object = 0) {} 325 325 326 /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be NULL. @return Returns the return-value of the function (if any; MultiType::Null otherwise)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) 327 327 virtual MultiType operator()(void* object, 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) = 0; 328 328 -
code/branches/cpp11_v2/src/libraries/core/command/IOConsolePOSIX.cc
r9667 r10765 44 44 namespace orxonox 45 45 { 46 IOConsole* IOConsole::singletonPtr_s = NULL;46 IOConsole* IOConsole::singletonPtr_s = nullptr; 47 47 48 48 namespace EscapeMode … … 353 353 const char* s; 354 354 if (!this->terminalWidth_ && (s = getenv("COLUMNS"))) 355 this->terminalWidth_ = strtol(s, NULL, 10);355 this->terminalWidth_ = strtol(s, nullptr, 10); 356 356 if (!this->terminalWidth_) 357 357 this->terminalWidth_ = 80; 358 358 if (!this->terminalHeight_ && (s = getenv("LINES"))) 359 this->terminalHeight_ = strtol(s, NULL, 10);359 this->terminalHeight_ = strtol(s, nullptr, 10); 360 360 if (!this->terminalHeight_) 361 361 this->terminalHeight_ = 24; -
code/branches/cpp11_v2/src/libraries/core/command/IOConsoleWindows.cc
r9676 r10765 41 41 namespace orxonox 42 42 { 43 IOConsole* IOConsole::singletonPtr_s = NULL;43 IOConsole* IOConsole::singletonPtr_s = nullptr; 44 44 45 45 //! Redirects std::cout, creates the corresponding Shell and changes the terminal mode … … 300 300 this->terminalWidth_ - 1, this->inputLineRow_ + this->inputLineHeight_ + this->statusLines_ - 1); 301 301 this->inputLineRow_ += linesDown; 302 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, this->inputLineRow_), &fillChar);302 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, nullptr, makeCOORD(0, this->inputLineRow_), &fillChar); 303 303 // Move cursor down to the new bottom so the user can see the status lines 304 304 COORD pos = makeCOORD(0, this->inputLineRow_ + this->inputLineHeight_ - 1 + this->statusLines_); … … 312 312 // Scroll output up 313 313 SMALL_RECT oldRect = makeSMALL_RECT(0, lines - linesDown, this->terminalWidth_ - 1, this->inputLineRow_ - 1); 314 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, 0), &fillChar);314 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, nullptr, makeCOORD(0, 0), &fillChar); 315 315 } 316 316 } … … 360 360 SMALL_RECT oldRect = makeSMALL_RECT(0, statusLineRow, this->terminalWidth_ - 1, statusLineRow + this->statusLines_); 361 361 CHAR_INFO fillChar = {{' '}, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED}; 362 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, NULL, makeCOORD(0, statusLineRow + newLines), &fillChar);362 ScrollConsoleScreenBuffer(stdOutHandle_, &oldRect, nullptr, makeCOORD(0, statusLineRow + newLines), &fillChar); 363 363 // Clear potential leftovers 364 364 if (-newLines - this->statusLines_ > 0) -
code/branches/cpp11_v2/src/libraries/core/command/TclBind.cc
r10624 r10765 228 228 @brief Executes Tcl-code and returns the return-value. 229 229 @param tclcode A string that contains Tcl-code 230 @param error A pointer to an integer (or NULL) that is used to write an error-code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes")230 @param error A pointer to an integer (or nullptr) that is used to write an error-code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 231 231 @return Returns the return-value of the executed code (or an empty string if there's no return-value) 232 232 */
Note: See TracChangeset
for help on using the changeset viewer.