Changeset 10768 for code/branches/cpp11_v2/src/libraries/core
- Timestamp:
- Nov 6, 2015, 10:54:34 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/core
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/ApplicationPaths.cc
r10765 r10768 68 68 69 69 //! Static pointer to the singleton 70 ApplicationPaths* ApplicationPaths::singletonPtr_s = 0;70 ApplicationPaths* ApplicationPaths::singletonPtr_s = nullptr; 71 71 72 72 ApplicationPaths::ApplicationPaths() -
code/branches/cpp11_v2/src/libraries/core/BaseObject.cc
r10765 r10768 65 65 this->bRegisteredEventStates_ = false; 66 66 67 this->lastLoadedXMLElement_ = 0;68 69 this->mainStateFunctor_ = 0;67 this->lastLoadedXMLElement_ = nullptr; 68 69 this->mainStateFunctor_ = nullptr; 70 70 71 71 if (context) … … 86 86 else 87 87 { 88 this->file_ = 0;88 this->file_ = nullptr; 89 89 this->sceneID_ = OBJECTID_UNKNOWN; 90 90 } … … 132 132 XMLPortObject(BaseObject, BaseObject, "eventlisteners", addEventListener, getEventListener, xmlelement, mode); 133 133 134 Element* events = 0;134 Element* events = nullptr; 135 135 if (mode == XMLPort::LoadObject || mode == XMLPort::ExpandObject) 136 136 events = xmlelement.FirstChildElement("events", false); … … 240 240 i++; 241 241 } 242 return 0;242 return nullptr; 243 243 } 244 244 … … 278 278 ++i; 279 279 } 280 return 0;280 return nullptr; 281 281 } 282 282 … … 302 302 ++i; 303 303 } 304 return 0;304 return nullptr; 305 305 } 306 306 … … 331 331 return (it->second); 332 332 else 333 return 0;333 return nullptr; 334 334 } 335 335 … … 423 423 void BaseObject::changedMainStateName() 424 424 { 425 this->mainStateFunctor_ = 0;425 this->mainStateFunctor_ = nullptr; 426 426 427 427 if (!this->mainStateName_.empty()) -
code/branches/cpp11_v2/src/libraries/core/BaseObject.h
r10765 r10768 218 218 bool bInitialized_; //!< True if the object was initialized (passed the object registration) 219 219 const XMLFile* file_; //!< The XMLFile that loaded this object 220 Element* lastLoadedXMLElement_; //!< Non 0if the TinyXML attributes have already been copied to our own lowercase map220 Element* lastLoadedXMLElement_; //!< Non nullptr if the TinyXML attributes have already been copied to our own lowercase map 221 221 std::map<std::string, std::string> xmlAttributes_; //!< Lowercase XML attributes 222 222 std::string loaderIndentation_; //!< Indentation of the debug output in the Loader -
code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc
r10624 r10768 207 207 return ((*this->nodes_.top().first) == compare); 208 208 else 209 return (compare == 0);209 return (compare == nullptr); 210 210 } 211 211 … … 218 218 return ((*this->nodes_.top().first) != compare); 219 219 else 220 return (compare != 0);220 return (compare != nullptr); 221 221 } 222 222 -
code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.h
r10693 r10768 211 211 inline const ClassTreeMask& begin() const { return (*this); } 212 212 /// End of the ClassTreeMaskObjectIterator. 213 inline BaseObject* end() const { return 0; }213 inline BaseObject* end() const { return nullptr; } 214 214 215 215 ClassTreeMask& operator=(const ClassTreeMask& other); … … 285 285 286 286 /// Returns true if the ClassTreeMaskObjectIterator points at the given object. 287 inline bool operator==(BaseObject* pointer) const { return (this->objectIterator_ && (*this->objectIterator_) == pointer) || (!this->objectIterator_ && pointer == 0); }287 inline bool operator==(BaseObject* pointer) const { return (this->objectIterator_ && (*this->objectIterator_) == pointer) || (!this->objectIterator_ && pointer == nullptr); } 288 288 /// Returns true if the ClassTreeMaskObjectIterator doesn't point at the given object. 289 inline bool operator!=(BaseObject* pointer) const { return (this->objectIterator_ && (*this->objectIterator_) != pointer) || (!this->objectIterator_ && pointer != 0); }289 inline bool operator!=(BaseObject* pointer) const { return (this->objectIterator_ && (*this->objectIterator_) != pointer) || (!this->objectIterator_ && pointer != nullptr); } 290 290 /// Returns true if the ClassTreeMaskObjectIterator hasn't already reached the end. 291 291 inline operator bool() const { return (this->objectIterator_); } -
code/branches/cpp11_v2/src/libraries/core/ConfigurablePaths.cc
r10765 r10768 67 67 68 68 //! Static pointer to the singleton 69 ConfigurablePaths* ConfigurablePaths::singletonPtr_s = 0;69 ConfigurablePaths* ConfigurablePaths::singletonPtr_s = nullptr; 70 70 71 71 SetCommandLineArgument(externalDataPath, "").information("Path to the external data files"); -
code/branches/cpp11_v2/src/libraries/core/Core.cc
r10765 r10768 83 83 { 84 84 //! Static pointer to the singleton 85 Core* Core::singletonPtr_s = 0;85 Core* Core::singletonPtr_s = nullptr; 86 86 87 87 SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file"); -
code/branches/cpp11_v2/src/libraries/core/GUIManager.cc
r10765 r10768 248 248 static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button); 249 249 250 GUIManager* GUIManager::singletonPtr_s = 0;250 GUIManager* GUIManager::singletonPtr_s = nullptr; 251 251 /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen"; //Alternative: Orxonox (not fully complete yet, see the graphics menu) 252 252 … … 337 337 // Create the CEGUI system singleton 338 338 #ifdef ORXONOX_OLD_CEGUI 339 guiSystem_ = new System(guiRenderer_, resourceProvider_, 0, scriptModule_);339 guiSystem_ = new System(guiRenderer_, resourceProvider_, nullptr, scriptModule_); 340 340 // Add functions that have been renamed in newer versions 341 341 luaState_->doString("CEGUI.SchemeManager.create = CEGUI.SchemeManager.loadScheme"); … … 343 343 luaState_->doString("CEGUI.ImagesetManager.createFromImageFile= CEGUI.ImagesetManager.createImagesetFromImageFile"); 344 344 #else 345 guiSystem_ = &System::create(*guiRenderer_, resourceProvider_, 0, imageCodec_, scriptModule_);345 guiSystem_ = &System::create(*guiRenderer_, resourceProvider_, nullptr, imageCodec_, scriptModule_); 346 346 #endif 347 347 … … 468 468 #ifdef ORXONOX_OLD_CEGUI 469 469 if (camera == nullptr) 470 this->guiRenderer_->setTargetSceneManager( 0);470 this->guiRenderer_->setTargetSceneManager(nullptr); 471 471 else 472 472 this->guiRenderer_->setTargetSceneManager(camera->getSceneManager()); -
code/branches/cpp11_v2/src/libraries/core/GUIManager.h
r9675 r10768 135 135 inline void setPlayer(const std::string& guiname, PlayerInfo* player) 136 136 { this->players_[guiname] = player; } 137 inline orxonox::PlayerInfo* getPlayer(const std::string& guiname) const { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : 0; } // tolua_export137 inline orxonox::PlayerInfo* getPlayer(const std::string& guiname) const { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : nullptr; } // tolua_export 138 138 139 139 // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work -
code/branches/cpp11_v2/src/libraries/core/Game.cc
r10765 r10768 66 66 67 67 std::map<std::string, GameStateInfo> Game::gameStateDeclarations_s; 68 Game* Game::singletonPtr_s = 0;68 Game* Game::singletonPtr_s = nullptr; 69 69 70 70 //! Represents one node of the game state tree. -
code/branches/cpp11_v2/src/libraries/core/GraphicsManager.cc
r10765 r10768 93 93 }; 94 94 95 GraphicsManager* GraphicsManager::singletonPtr_s = 0;95 GraphicsManager* GraphicsManager::singletonPtr_s = nullptr; 96 96 97 97 RegisterAbstractClass(GraphicsManager).inheritsFrom<Configurable>(); … … 99 99 GraphicsManager::GraphicsManager(bool bLoadRenderer) 100 100 : ogreWindowEventListener_(new OgreWindowEventListener()) 101 , renderWindow_( 0)102 , viewport_( 0)101 , renderWindow_(nullptr) 102 , viewport_(nullptr) 103 103 , lastFrameStartTime_(0.0f) 104 104 , lastFrameEndTime_(0.0f) … … 304 304 // But in our case we only have one viewport for now anyway, therefore 305 305 // no ScopeGuards or anything to handle exceptions. 306 this->viewport_ = this->renderWindow_->addViewport( 0, 0);306 this->viewport_ = this->renderWindow_->addViewport(nullptr, 0); 307 307 308 308 Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(Ogre::MIP_UNLIMITED); … … 312 312 HWND hwnd; 313 313 this->renderWindow_->getCustomAttribute("WINDOW", (void*)&hwnd); 314 LONG iconID = (LONG)LoadIcon(GetModuleHandle( 0), MAKEINTRESOURCE(101));314 LONG iconID = (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(101)); 315 315 SetClassLong(hwnd, GCL_HICON, iconID); 316 316 #endif -
code/branches/cpp11_v2/src/libraries/core/Language.cc
r10624 r10768 88 88 // ############################### 89 89 90 Language* Language::singletonPtr_s = 0;90 Language* Language::singletonPtr_s = nullptr; 91 91 92 92 /** -
code/branches/cpp11_v2/src/libraries/core/Loader.cc
r10765 r10768 48 48 namespace orxonox 49 49 { 50 Loader* Loader::singletonPtr_s = 0;50 Loader* Loader::singletonPtr_s = nullptr; 51 51 52 52 /** -
code/branches/cpp11_v2/src/libraries/core/Namespace.cc
r10624 r10768 109 109 const BaseObject* Namespace::saveObjects(unsigned int index) const 110 110 { 111 return 0; // todo111 return nullptr; // todo 112 112 } 113 113 -
code/branches/cpp11_v2/src/libraries/core/NamespaceNode.h
r7401 r10768 46 46 { 47 47 public: 48 NamespaceNode(const std::string& name, NamespaceNode* parent = 0);48 NamespaceNode(const std::string& name, NamespaceNode* parent = nullptr); 49 49 ~NamespaceNode(); 50 50 -
code/branches/cpp11_v2/src/libraries/core/Template.cc
r9667 r10768 49 49 this->bLoadDefaults_ = true; 50 50 this->bIsReturningXMLElement_ = false; 51 this->baseclassIdentifier_ = 0;51 this->baseclassIdentifier_ = nullptr; 52 52 } 53 53 … … 176 176 { 177 177 orxout(internal_warning, context::templates) << "Template with name " << name << " doesn't exist." << endl; 178 return 0;178 return nullptr; 179 179 } 180 180 } -
code/branches/cpp11_v2/src/libraries/core/Thread.cc
r8399 r10768 48 48 49 49 Thread::Thread(): 50 executor_( 0),50 executor_(nullptr), 51 51 isWorking_(false), 52 52 stopThread_(false) … … 102 102 (*executor)(); 103 103 this->executorMutex_->lock(); 104 this->executor_ = 0;104 this->executor_ = nullptr; 105 105 this->executorMutex_->unlock(); 106 106 this->isWorkingMutex_->lock(); -
code/branches/cpp11_v2/src/libraries/core/ThreadWin.cc
r8706 r10768 45 45 46 46 Thread::Thread(): 47 executor_( 0),47 executor_(nullptr), 48 48 isWorking_(false), 49 49 stopThread_(false) … … 101 101 // (*executor)(); 102 102 // this->executorMutex_->lock(); 103 // this->executor_ = 0;103 // this->executor_ = nullptr; 104 104 // this->executorMutex_->unlock(); 105 105 // this->isWorkingMutex_->lock(); -
code/branches/cpp11_v2/src/libraries/core/XMLPort.h
r9667 r10768 245 245 return my_added_objects[index]; 246 246 else 247 return 0;247 return nullptr; 248 248 } 249 249 @endcode … … 399 399 // Iterate through the attributes manually in order to make them case insensitive 400 400 ticpp::Attribute* attribute = xmlelement.FirstAttribute(false); 401 while (attribute != 0)401 while (attribute != nullptr) 402 402 { 403 403 this->owner_->xmlAttributes_[getLowercase(attribute->Name())] = attribute->Value(); -
code/branches/cpp11_v2/src/libraries/core/class/Identifiable.cc
r10624 r10768 48 48 Identifiable::Identifiable() 49 49 { 50 this->identifier_ = 0;50 this->identifier_ = nullptr; 51 51 this->objectPointers_.reserve(6); // Optimisation 52 52 -
code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc
r10624 r10768 117 117 orxout(user_error) << "Aborting..." << endl; 118 118 abort(); 119 return 0;119 return nullptr; 120 120 } 121 121 } … … 393 393 return it->second; 394 394 else 395 return 0;395 return nullptr; 396 396 } 397 397 … … 407 407 return it->second; 408 408 else 409 return 0;409 return nullptr; 410 410 } 411 411 … … 438 438 return it->second; 439 439 else 440 return 0;440 return nullptr; 441 441 } 442 442 -
code/branches/cpp11_v2/src/libraries/core/class/Identifier.h
r10765 r10768 56 56 object->getIdentifier()->getName(); // returns "MyClass" 57 57 58 Identifiable* other = object->getIdentifier()->fabricate( 0); // fabricates a new instance of MyClass58 Identifiable* other = object->getIdentifier()->fabricate(nullptr); // fabricates a new instance of MyClass 59 59 60 60 … … 137 137 138 138 /// Returns true if the Identifier has a Factory. 139 inline bool hasFactory() const { return (this->factory_ != 0); }139 inline bool hasFactory() const { return (this->factory_ != nullptr); } 140 140 141 141 Identifiable* fabricate(Context* context); … … 297 297 298 298 virtual bool canDynamicCastObjectToIdentifierClass(Identifiable* object) const 299 { return dynamic_cast<T*>(object) != 0; }299 { return dynamic_cast<T*>(object) != nullptr; } 300 300 301 301 virtual void destroyObjects(); … … 408 408 void ClassIdentifier<T>::destroyObjects() 409 409 { 410 this->destroyObjects((T*) 0);410 this->destroyObjects((T*)nullptr); 411 411 } 412 412 -
code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.cc
r10765 r10768 44 44 namespace orxonox 45 45 { 46 IdentifierManager* IdentifierManager::singletonPtr_s = 0;46 IdentifierManager* IdentifierManager::singletonPtr_s = nullptr; 47 47 48 48 IdentifierManager::IdentifierManager() … … 221 221 return it->second; 222 222 else 223 return 0;223 return nullptr; 224 224 } 225 225 … … 235 235 return it->second; 236 236 else 237 return 0;237 return nullptr; 238 238 } 239 239 … … 249 249 return it->second; 250 250 else 251 return 0;251 return nullptr; 252 252 } 253 253 … … 263 263 if ((*it)->getTypeInfo() == typeInfo) 264 264 return (*it); 265 return 0;265 return nullptr; 266 266 } 267 267 -
code/branches/cpp11_v2/src/libraries/core/class/SubclassIdentifier.h
r10765 r10768 189 189 orxout(user_error) << "Aborting..." << endl; 190 190 abort(); 191 return 0;191 return nullptr; 192 192 } 193 193 } -
code/branches/cpp11_v2/src/libraries/core/class/Super.h
r10624 r10768 94 94 static void superCheck() \ 95 95 { \ 96 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>( 0)); \96 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(nullptr)); \ 97 97 SuperFunctionCondition<functionnumber + 1, T, 0, templatehack2>::superCheck(); \ 98 98 } \ … … 108 108 { \ 109 109 delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_; \ 110 ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = 0; \110 ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = nullptr; \ 111 111 ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false; \ 112 112 } \ … … 154 154 // This call to the apply-function is the whole check. By calling the function with 155 155 // a T* pointer, the right function get's called. 156 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>( 0));156 SuperFunctionCondition<functionnumber, T, 0, templatehack2>::apply(static_cast<T*>(nullptr)); 157 157 158 158 // Go go the superCheck for of next super-function (functionnumber + 1) … … 178 178 // Delete the fallback caller an prepare to get a real caller 179 179 delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_; 180 ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = 0;180 ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = nullptr; 181 181 ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false; 182 182 } -
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 } -
code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc
r10542 r10768 40 40 namespace orxonox 41 41 { 42 CommandLineParser* CommandLineParser::singletonPtr_s = 0;42 CommandLineParser* CommandLineParser::singletonPtr_s = nullptr; 43 43 44 44 /** -
code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc
r10765 r10768 113 113 if (file.is_open()) 114 114 { 115 ConfigFileSection* newsection = 0;115 ConfigFileSection* newsection = nullptr; 116 116 117 117 while (file.good() && !file.eof()) … … 140 140 } 141 141 142 if (newsection != 0)142 if (newsection != nullptr) 143 143 { 144 144 if (isComment(line)) -
code/branches/cpp11_v2/src/libraries/core/config/ConfigFileManager.cc
r10765 r10768 42 42 /////////////////////// 43 43 44 ConfigFileManager* ConfigFileManager::singletonPtr_s = 0;44 ConfigFileManager* ConfigFileManager::singletonPtr_s = nullptr; 45 45 46 46 /// Constructor: Initializes the array of config files with nullptr. -
code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.cc
r9559 r10768 53 53 this->sectionname_ = sectionname; 54 54 this->varname_ = varname; 55 this->callback_ = 0;55 this->callback_ = nullptr; 56 56 this->bContainerIsNew_ = true; 57 57 this->bDoInitialCallback_ = false; -
code/branches/cpp11_v2/src/libraries/core/config/SettingsConfigFile.cc
r10765 r10768 57 57 SetConsoleCommand(__CC_getConfig_name, &SettingsConfigFile::getConfig).argumentCompleter(0, autocompletion::settingssections()).argumentCompleter(1, autocompletion::settingsentries()); 58 58 59 SettingsConfigFile* SettingsConfigFile::singletonPtr_s = 0;59 SettingsConfigFile* SettingsConfigFile::singletonPtr_s = nullptr; 60 60 61 61 /** … … 77 77 SettingsConfigFile::~SettingsConfigFile() 78 78 { 79 ModifyConsoleCommand(__CC_load_name).setObject( 0);80 ModifyConsoleCommand(__CC_setFilename_name).setObject( 0);81 ModifyConsoleCommand(__CC_config_name).setObject( 0);82 ModifyConsoleCommand(__CC_tconfig_name).setObject( 0);83 ModifyConsoleCommand(__CC_getConfig_name).setObject( 0);79 ModifyConsoleCommand(__CC_load_name).setObject(nullptr); 80 ModifyConsoleCommand(__CC_setFilename_name).setObject(nullptr); 81 ModifyConsoleCommand(__CC_config_name).setObject(nullptr); 82 ModifyConsoleCommand(__CC_tconfig_name).setObject(nullptr); 83 ModifyConsoleCommand(__CC_getConfig_name).setObject(nullptr); 84 84 } 85 85 -
code/branches/cpp11_v2/src/libraries/core/input/Button.cc
r9983 r10768 53 53 Button::Button() 54 54 : bButtonThresholdUser_(false) 55 , paramCommandBuffer_( 0)55 , paramCommandBuffer_(nullptr) 56 56 { 57 57 nCommands_[0]=0; … … 75 75 delete commands_[j][i]; 76 76 delete[] commands_[j]; 77 commands_[j] = 0;77 commands_[j] = nullptr; 78 78 nCommands_[j] = 0; 79 79 } … … 206 206 } 207 207 } 208 if (cmd->paramCommand_ == 0)208 if (cmd->paramCommand_ == nullptr) 209 209 { 210 210 cmd->paramCommand_ = new BufferedParamCommand(); … … 239 239 } 240 240 else 241 commands_[j] = 0;241 commands_[j] = nullptr; 242 242 } 243 243 } -
code/branches/cpp11_v2/src/libraries/core/input/HalfAxis.h
r7859 r10768 49 49 : relVal_(0.0f) 50 50 , absVal_(0.0f) 51 , paramCommands_( 0)51 , paramCommands_(nullptr) 52 52 , nParamCommands_(0) 53 53 , pressed_(false) -
code/branches/cpp11_v2/src/libraries/core/input/InputCommands.h
r9978 r10768 103 103 { 104 104 public: 105 ParamCommand() : scale_(1.0f), paramCommand_( 0) { }105 ParamCommand() : scale_(1.0f), paramCommand_(nullptr) { } 106 106 bool execute(float abs = 1.0f, float rel = 1.0f); 107 107 CommandEvaluation* getEvaluation(); … … 118 118 return &this->paramCommand_->evaluation_; 119 119 else 120 return 0;120 return nullptr; 121 121 } 122 122 } -
code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
r10765 r10768 72 72 InputHandler InputHandler::EMPTY; 73 73 74 InputManager* InputManager::singletonPtr_s = 0;74 InputManager* InputManager::singletonPtr_s = nullptr; 75 75 76 76 //! Defines the |= operator for easier use. … … 94 94 InputManager::InputManager() 95 95 : internalState_(Bad) 96 , oisInputManager_( 0)96 , oisInputManager_(nullptr) 97 97 , devices_(2) 98 98 , exclusiveMouse_(false) 99 , emptyState_( 0)100 , calibratorCallbackHandler_( 0)99 , emptyState_(nullptr) 100 , calibratorCallbackHandler_(nullptr) 101 101 { 102 102 RegisterObject(InputManager); … … 149 149 // When loading the devices they should not already be loaded 150 150 assert(internalState_ & Bad); 151 assert(devices_[InputDeviceEnumerator::Mouse] == 0);152 assert(devices_[InputDeviceEnumerator::Keyboard] == 0);151 assert(devices_[InputDeviceEnumerator::Mouse] == nullptr); 152 assert(devices_[InputDeviceEnumerator::Keyboard] == nullptr); 153 153 assert(devices_.size() == InputDeviceEnumerator::FirstJoyStick); 154 154 … … 294 294 295 295 // Reset console commands 296 ModifyConsoleCommand(__CC_InputManager_name, __CC_calibrate_name).setObject( 0);297 ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject( 0);296 ModifyConsoleCommand(__CC_InputManager_name, __CC_calibrate_name).setObject(nullptr); 297 ModifyConsoleCommand(__CC_InputManager_name, __CC_reload_name).setObject(nullptr); 298 298 299 299 orxout(internal_status, context::input) << "InputManager: Destruction complete." << endl; … … 316 316 const std::string& className = device->getClassName(); 317 317 delete device; 318 device = 0;318 device = nullptr; 319 319 orxout(verbose, context::input) << className << " destroyed." << endl; 320 320 } … … 526 526 { 527 527 if (name.empty()) 528 return 0;528 return nullptr; 529 529 if (statesByName_.find(name) == statesByName_.end()) 530 530 { … … 539 539 orxout(internal_warning, context::input) << "Could not add an InputState with the same priority '" 540 540 << static_cast<int>(priority) << "' != 0." << endl; 541 return 0;541 return nullptr; 542 542 } 543 543 } … … 551 551 { 552 552 orxout(internal_warning, context::input) << "Could not add an InputState with the same name '" << name << "'." << endl; 553 return 0;553 return nullptr; 554 554 } 555 555 } … … 561 561 return it->second; 562 562 else 563 return 0;563 return nullptr; 564 564 } 565 565 -
code/branches/cpp11_v2/src/libraries/core/input/InputState.cc
r10765 r10768 40 40 , bExpired_(true) 41 41 , handlers_(2) 42 , joyStickHandlerAll_( 0)43 , enterFunctor_( 0)44 , leaveFunctor_( 0)42 , joyStickHandlerAll_(nullptr) 43 , enterFunctor_(nullptr) 44 , leaveFunctor_(nullptr) 45 45 { 46 46 if (priority >= InputStatePriority::HighPriority || priority == InputStatePriority::Empty) -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc
r10765 r10768 439 439 { 440 440 delete[] button->commands_[mode_index]; 441 button->commands_[mode_index] = 0;441 button->commands_[mode_index] = nullptr; 442 442 } 443 443 -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc
r10765 r10768 80 80 81 81 // Reset console commands 82 ModifyConsoleCommand(__CC_keybind_name ).setObject( 0);83 ModifyConsoleCommand(__CC_tkeybind_name).setObject( 0);84 ModifyConsoleCommand(__CC_unbind_name ).setObject( 0);85 ModifyConsoleCommand(__CC_tunbind_name ).setObject( 0);82 ModifyConsoleCommand(__CC_keybind_name ).setObject(nullptr); 83 ModifyConsoleCommand(__CC_tkeybind_name).setObject(nullptr); 84 ModifyConsoleCommand(__CC_unbind_name ).setObject(nullptr); 85 ModifyConsoleCommand(__CC_tunbind_name ).setObject(nullptr); 86 86 } 87 87 -
code/branches/cpp11_v2/src/libraries/core/input/Mouse.cc
r10624 r10768 68 68 { 69 69 #ifdef ORXONOX_PLATFORM_LINUX 70 ModifyConsoleCommand(__CC_Mouse_name, __CC_grab_name).setObject( 0);71 ModifyConsoleCommand(__CC_Mouse_name, __CC_ungrab_name).setObject( 0);70 ModifyConsoleCommand(__CC_Mouse_name, __CC_grab_name).setObject(nullptr); 71 ModifyConsoleCommand(__CC_Mouse_name, __CC_ungrab_name).setObject(nullptr); 72 72 #endif 73 73 } -
code/branches/cpp11_v2/src/libraries/core/module/DynLibManager.cc
r10540 r10768 38 38 //----------------------------------------------------------------------- 39 39 //! Static pointer to the singleton 40 DynLibManager* DynLibManager::singletonPtr_s = 0;40 DynLibManager* DynLibManager::singletonPtr_s = nullptr; 41 41 42 42 //----------------------------------------------------------------------- -
code/branches/cpp11_v2/src/libraries/core/module/PluginManager.cc
r10765 r10768 46 46 SetConsoleCommand("PluginManager", __CC_PluginManager_unload_name, &PluginManager::unloadPlugin); 47 47 48 PluginManager* PluginManager::singletonPtr_s = 0;48 PluginManager* PluginManager::singletonPtr_s = nullptr; 49 49 50 50 PluginManager::PluginManager() -
code/branches/cpp11_v2/src/libraries/core/module/StaticInitializationManager.cc
r10542 r10768 33 33 namespace orxonox 34 34 { 35 StaticInitializationManager* StaticInitializationManager::singletonPtr_s = 0;35 StaticInitializationManager* StaticInitializationManager::singletonPtr_s = nullptr; 36 36 37 37 void StaticInitializationManager::addHandler(StaticInitializationHandler* handler) -
code/branches/cpp11_v2/src/libraries/core/object/Context.cc
r10765 r10768 40 40 RegisterClass(Context); 41 41 42 Context* Context::rootContext_s = 0;42 Context* Context::rootContext_s = nullptr; 43 43 44 44 Context* getContextForInitializationOfOtherContexts() -
code/branches/cpp11_v2/src/libraries/core/object/ObjectListBase.cc
r9975 r10768 58 58 ObjectListBase::ObjectListBase() 59 59 { 60 this->first_ = 0;61 this->last_ = 0;60 this->first_ = nullptr; 61 this->last_ = nullptr; 62 62 this->size_ = 0; 63 63 } … … 73 73 ObjectListBaseElement* next = current->next_; 74 74 75 current->list_ = 0;76 current->next_ = 0;77 current->prev_ = 0;75 current->list_ = nullptr; 76 current->next_ = nullptr; 77 current->prev_ = nullptr; 78 78 79 79 current = next; … … 155 155 this->first_ = element->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list 156 156 157 element->list_ = 0;158 element->next_ = 0;159 element->prev_ = 0;157 element->list_ = nullptr; 158 element->next_ = nullptr; 159 element->prev_ = nullptr; 160 160 --this->size_; 161 161 } -
code/branches/cpp11_v2/src/libraries/core/object/ObjectListBase.h
r10736 r10768 57 57 @param objectBase The object to store 58 58 */ 59 ObjectListBaseElement(Listable* object) : next_( 0), prev_(0), objectBase_(object), list_(0) {}59 ObjectListBaseElement(Listable* object) : next_(nullptr), prev_(nullptr), objectBase_(object), list_(nullptr) {} 60 60 virtual ~ObjectListBaseElement() { this->removeFromList(); } 61 61 … … 136 136 inline ObjectListBaseElement* begin() const { return this->first_; } 137 137 /// Returns a pointer to the element after the last element in the list. Works only with Iterator. 138 inline ObjectListBaseElement* end() const { return 0; }138 inline ObjectListBaseElement* end() const { return nullptr; } 139 139 /// Returns a pointer to the last element in the list. Works only with Iterator. 140 140 inline ObjectListBaseElement* rbegin() const { return this->last_; } 141 141 /// Returns a pointer to the element in front of the first element in the list. Works only with Iterator. 142 inline ObjectListBaseElement* rend() const { return 0; }142 inline ObjectListBaseElement* rend() const { return nullptr; } 143 143 144 144 inline void registerRemovalListener(ObjectListElementRemovalListener* listener) { this->listeners_.push_back(listener); } -
code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h
r10765 r10768 138 138 public: 139 139 /// Constructor: Initializes the strong pointer with a null pointer. 140 inline StrongPtr() : pointer_( 0), base_(0)140 inline StrongPtr() : pointer_(nullptr), base_(nullptr) 141 141 { 142 142 } … … 237 237 inline T* operator->() const 238 238 { 239 assert(this->pointer_ != 0);239 assert(this->pointer_ != nullptr); 240 240 return this->pointer_; 241 241 } … … 244 244 inline T& operator*() const 245 245 { 246 assert(this->pointer_ != 0);246 assert(this->pointer_ != nullptr); 247 247 return *this->pointer_; 248 248 } … … 251 251 inline bool operator!() const 252 252 { 253 return (this->pointer_ == 0);253 return (this->pointer_ == nullptr); 254 254 } 255 255 -
code/branches/cpp11_v2/src/libraries/core/object/WeakPtr.h
r10765 r10768 100 100 public: 101 101 /// Constructor: Initializes the weak pointer with a null pointer. 102 inline WeakPtr() : pointer_( 0), base_(0), callback_(0)102 inline WeakPtr() : pointer_(nullptr), base_(nullptr), callback_(nullptr) 103 103 { 104 104 } 105 105 106 106 /// Constructor: Initializes the weak pointer with a pointer to an object. 107 inline WeakPtr(T* pointer) : pointer_(pointer), base_(pointer), callback_( 0)107 inline WeakPtr(T* pointer) : pointer_(pointer), base_(pointer), callback_(nullptr) 108 108 { 109 109 this->registerAsDestructionListener(this->base_); … … 111 111 112 112 /// Copy-constructor 113 inline WeakPtr(const WeakPtr& other) : pointer_(other.pointer_), base_(other.base_), callback_( 0)113 inline WeakPtr(const WeakPtr& other) : pointer_(other.pointer_), base_(other.base_), callback_(nullptr) 114 114 { 115 115 this->registerAsDestructionListener(this->base_); … … 118 118 /// Copy-constructor for weak pointers to objects of another class. 119 119 template <class O> 120 inline WeakPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.getBase()), callback_( 0)120 inline WeakPtr(const WeakPtr<O>& other) : pointer_(other.get()), base_(other.getBase()), callback_(nullptr) 121 121 { 122 122 this->registerAsDestructionListener(this->base_); … … 172 172 inline T* operator->() const 173 173 { 174 assert(this->pointer_ != 0);174 assert(this->pointer_ != nullptr); 175 175 return this->pointer_; 176 176 } … … 179 179 inline T& operator*() const 180 180 { 181 assert(this->pointer_ != 0);181 assert(this->pointer_ != nullptr); 182 182 return *this->pointer_; 183 183 } … … 186 186 inline bool operator!() const 187 187 { 188 return (this->pointer_ == 0);188 return (this->pointer_ == nullptr); 189 189 } 190 190 … … 232 232 inline void objectDeleted() 233 233 { 234 this->base_ = 0;235 this->pointer_ = 0;234 this->base_ = nullptr; 235 this->pointer_ = nullptr; 236 236 if (this->callback_) 237 237 (*this->callback_)(); -
code/branches/cpp11_v2/src/libraries/core/singleton/ScopeManager.cc
r10542 r10768 38 38 namespace orxonox 39 39 { 40 ScopeManager* ScopeManager::singletonPtr_s = 0;40 ScopeManager* ScopeManager::singletonPtr_s = nullptr; 41 41 42 42 void ScopeManager::addScope(ScopeID::Value scope)
Note: See TracChangeset
for help on using the changeset viewer.