Changeset 10768 for code/branches/cpp11_v2/src/libraries
- Timestamp:
- Nov 6, 2015, 10:54:34 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries
- Files:
-
- 88 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) -
code/branches/cpp11_v2/src/libraries/network/Connection.cc
r8858 r10768 46 46 47 47 Connection::Connection(uint32_t firstPeerID): 48 host_( 0), bCommunicationThreadRunning_(false), nextPeerID_(firstPeerID)48 host_(nullptr), bCommunicationThreadRunning_(false), nextPeerID_(firstPeerID) 49 49 { 50 50 enet_initialize(); … … 81 81 { 82 82 // this->overallMutex_->lock(); 83 outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, 0, 0 };83 outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, nullptr, 0 }; 84 84 85 85 this->outgoingEventsMutex_->lock(); … … 91 91 void Connection::disconnectPeers() 92 92 { 93 outgoingEvent outEvent = { 0, outgoingEventType::disconnectPeers, 0, 0 };93 outgoingEvent outEvent = { 0, outgoingEventType::disconnectPeers, nullptr, 0 }; 94 94 95 95 this->outgoingEventsMutex_->lock(); … … 323 323 324 324 // create new peerEvent and return it 325 incomingEvent inEvent = { peerID, incomingEventType::peerConnect, 0};325 incomingEvent inEvent = { peerID, incomingEventType::peerConnect, nullptr }; 326 326 return inEvent; 327 327 } … … 338 338 339 339 // create new peerEvent and return it 340 incomingEvent inEvent = { peerID, incomingEventType::peerDisconnect, 0};340 incomingEvent inEvent = { peerID, incomingEventType::peerDisconnect, nullptr }; 341 341 return inEvent; 342 342 } -
code/branches/cpp11_v2/src/libraries/network/GamestateHandler.cc
r7801 r10768 32 32 namespace orxonox { 33 33 34 // GamestateHandler *GamestateHandler::instance_= 0;34 // GamestateHandler *GamestateHandler::instance_=nullptr; 35 35 36 36 GamestateHandler::GamestateHandler() -
code/branches/cpp11_v2/src/libraries/network/GamestateManager.cc
r8858 r10768 60 60 { 61 61 GamestateManager::GamestateManager() : 62 currentGamestate_( 0), id_(0)62 currentGamestate_(nullptr), id_(0) 63 63 { 64 64 // trafficControl_ = new TrafficControl(); … … 140 140 141 141 bool GamestateManager::getSnapshot(){ 142 if ( currentGamestate_ != 0)142 if ( currentGamestate_ != nullptr ) 143 143 delete currentGamestate_; 144 144 uint8_t gsMode; … … 165 165 { //we have no data to send 166 166 delete currentGamestate_; 167 currentGamestate_= 0;167 currentGamestate_=nullptr; 168 168 return false; 169 169 } … … 191 191 unsigned int lastAckedGamestateID = peerIt->second.lastAckedGamestateID; 192 192 193 packet::Gamestate* baseGamestate= 0;193 packet::Gamestate* baseGamestate=nullptr; 194 194 if(lastAckedGamestateID != GAMESTATEID_INITIAL) 195 195 { … … 200 200 } 201 201 202 peerGamestates.push_back( 0); // insert an empty gamestate* to be changed202 peerGamestates.push_back(nullptr); // insert an empty gamestate* to be changed 203 203 finishGamestate( peerID, peerGamestates.back(), baseGamestate, currentGamestate_ ); 204 if( peerGamestates.back()== 0)204 if( peerGamestates.back()==nullptr ) 205 205 // nothing to send to remove pointer from vector 206 206 peerGamestates.pop_back(); … … 243 243 { 244 244 delete diffed1; 245 destgamestate = 0;245 destgamestate = nullptr; 246 246 return; 247 247 } -
code/branches/cpp11_v2/src/libraries/network/Host.cc
r10624 r10768 44 44 SetConsoleCommand(__CC_printRTT_group, __CC_printRTT_name, &Host::printRTT); 45 45 46 // Host* Host::instance_= 0;46 // Host* Host::instance_=nullptr; 47 47 uint32_t Host::clientID_s=0; 48 48 // uint32_t Host::shipID_s=-1; … … 54 54 Host::Host() 55 55 { 56 // assert(instance_== 0);56 // assert(instance_==nullptr); 57 57 instances_s.push_back(this); 58 58 ModifyConsoleCommand(__CC_printRTT_group, __CC_printRTT_name).setObject(this); … … 62 62 63 63 /** 64 * @brief Destructor: resets the instance pointer to 064 * @brief Destructor: resets the instance pointer to nullptr 65 65 */ 66 66 Host::~Host() … … 68 68 assert( std::find( instances_s.begin(), instances_s.end(), this )!=instances_s.end() ); 69 69 instances_s.erase(std::find( instances_s.begin(), instances_s.end(), this )); 70 ModifyConsoleCommand(__CC_printRTT_group, __CC_printRTT_name).setObject( 0);70 ModifyConsoleCommand(__CC_printRTT_group, __CC_printRTT_name).setObject(nullptr); 71 71 } 72 72 … … 135 135 ++it; 136 136 } 137 return 0;137 return nullptr; 138 138 } 139 139 -
code/branches/cpp11_v2/src/libraries/network/LANDiscoverable.cc
r10765 r10768 51 51 this->setConfigValues(); 52 52 // this->setActivity(true); 53 this->host_ = 0;53 this->host_ = nullptr; 54 54 this->bActive_ = false; 55 55 } … … 83 83 bindAddress.host = ENET_HOST_ANY; 84 84 bindAddress.port = LAN_DISCOVERY_PORT; 85 assert( this->host_ == 0);85 assert( this->host_ == nullptr ); 86 86 this->host_ = enet_host_create( &bindAddress, 10, 0, 0, 0 ); 87 87 if ( this->host_ == nullptr ) … … 91 91 { 92 92 enet_host_destroy( this->host_ ); 93 this->host_ = 0;93 this->host_ = nullptr; 94 94 } 95 95 this->bActive_ = bActive; -
code/branches/cpp11_v2/src/libraries/network/NetworkFunction.h
r10624 r10768 144 144 inline bool call(uint32_t objectID) 145 145 { 146 if ( Synchronisable::getSynchronisable(objectID)!= 0)146 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 147 147 { 148 148 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID))); … … 154 154 inline bool call(uint32_t objectID, const MultiType& mt1) 155 155 { 156 if ( Synchronisable::getSynchronisable(objectID)!= 0)156 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 157 157 { 158 158 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1); … … 164 164 inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2) 165 165 { 166 if ( Synchronisable::getSynchronisable(objectID)!= 0)166 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 167 167 { 168 168 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2); … … 174 174 inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3) 175 175 { 176 if ( Synchronisable::getSynchronisable(objectID)!= 0)176 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 177 177 { 178 178 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3); … … 184 184 inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4) 185 185 { 186 if ( Synchronisable::getSynchronisable(objectID)!= 0)186 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 187 187 { 188 188 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4); … … 194 194 inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5) 195 195 { 196 if ( Synchronisable::getSynchronisable(objectID)!= 0)196 if ( Synchronisable::getSynchronisable(objectID)!=nullptr ) 197 197 { 198 198 (*this->functor_)(orxonox_cast<T*>(Synchronisable::getSynchronisable(objectID)), mt1, mt2, mt3, mt4, mt5); -
code/branches/cpp11_v2/src/libraries/network/NetworkFunctionManager.cc
r10765 r10768 32 32 namespace orxonox 33 33 { 34 NetworkFunctionManager* NetworkFunctionManager::singletonPtr_s = 0;34 NetworkFunctionManager* NetworkFunctionManager::singletonPtr_s = nullptr; 35 35 36 36 void NetworkFunctionManager::registerFunction(NetworkFunctionBase* function) -
code/branches/cpp11_v2/src/libraries/network/Server.cc
r10765 r10768 194 194 void Server::printRTT() 195 195 { 196 // for( ClientInformation* temp=ClientInformation::getBegin(); temp!= 0; temp=temp->next() )196 // for( ClientInformation* temp=ClientInformation::getBegin(); temp!=nullptr; temp=temp->next() ) 197 197 // orxout(message) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl; 198 198 } -
code/branches/cpp11_v2/src/libraries/network/TrafficControl.cc
r9667 r10768 64 64 *Initializing protected members 65 65 */ 66 TrafficControl *TrafficControl::instance_= 0;66 TrafficControl *TrafficControl::instance_=nullptr; 67 67 68 68 /** … … 72 72 { 73 73 RegisterObject(TrafficControl); 74 assert(instance_== 0);74 assert(instance_==nullptr); 75 75 instance_=this; 76 76 this->setConfigValues(); … … 78 78 79 79 /** 80 * @brief Destructor: resets the instance pointer to 080 * @brief Destructor: resets the instance pointer to nullptr 81 81 */ 82 82 TrafficControl::~TrafficControl() 83 83 { 84 instance_= 0;84 instance_=nullptr; 85 85 } 86 86 -
code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc
r10765 r10768 106 106 { 107 107 uint32_t tempsize=0, currentsize=0; 108 assert(data_== 0);108 assert(data_==nullptr); 109 109 uint32_t size = calcGamestateSize(id, mode); 110 110 -
code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.h
r7801 r10768 54 54 { 55 55 public: 56 GamestateHeader(){ data_= 0; }56 GamestateHeader(){ data_=nullptr; } 57 57 GamestateHeader(uint8_t* data) 58 58 { assert(data); data_ = data; *(uint32_t*)data_ = Type::Gamestate; } -
code/branches/cpp11_v2/src/libraries/network/packet/Packet.cc
r10765 r10768 69 69 packetDirection_ = Direction::Outgoing; 70 70 peerID_=0; 71 data_= 0;72 enetPacket_= 0;71 data_=nullptr; 72 enetPacket_=nullptr; 73 73 bDataENetAllocated_ = false; 74 74 } … … 80 80 peerID_=peerID; 81 81 data_=data; 82 enetPacket_= 0;82 enetPacket_=nullptr; 83 83 bDataENetAllocated_ = false; 84 84 } … … 95 95 memcpy(data_, p.data_, p.getSize()); 96 96 }else 97 data_= 0;97 data_=nullptr; 98 98 bDataENetAllocated_ = p.bDataENetAllocated_; 99 99 } … … 175 175 #endif 176 176 // ENetPacket *temp = enetPacket_; 177 // enetPacket_ = 0; // otherwise we have a double free because enet already handles the deallocation of the packet177 // enetPacket_ = nullptr; // otherwise we have a double free because enet already handles the deallocation of the packet 178 178 if( this->flags_ & PacketFlag::Reliable ) 179 179 host->addPacket( enetPacket_, peerID_, NETWORK_CHANNEL_DEFAULT); … … 191 191 // if( peerID==static_cast<unsigned int>(-2)) 192 192 // peerID = NETWORK_PEER_ID_SERVER; 193 Packet *p = 0;193 Packet *p = nullptr; 194 194 // orxout(verbose_ultra, context::packets) << "packet type: " << *(Type::Value *)&data[_PACKETID] << endl; 195 195 switch( *(Type::Value *)(data + _PACKETID) ) … … 251 251 assert(it != packetMap_.end()); 252 252 // Make sure we don't delete it again in the destructor 253 it->second->enetPacket_ = 0;253 it->second->enetPacket_ = nullptr; 254 254 delete it->second; 255 255 packetMap_.erase(it); -
code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc
r10765 r10768 140 140 { 141 141 mem += header.getDataSize() + header.getSize(); 142 return 0;142 return nullptr; 143 143 } 144 144 // assert( !header.isDiffed() ); … … 156 156 } 157 157 assert(id); 158 Context* context = 0;158 Context* context = nullptr; 159 159 if (header.getContextID() != OBJECTID_UNKNOWN) 160 160 { … … 164 164 mem += header.getDataSize()+SynchronisableHeader::getSize(); //.TODO: this suckz.... remove size from header 165 165 assert(0); // TODO: uncomment this if we have a clean objecthierarchy (with destruction of children of objects) ^^ 166 return 0;166 return nullptr; 167 167 } 168 168 else … … 172 172 context = Context::getRootContext(); 173 173 174 assert(getSynchronisable(header.getObjectID())== 0); //make sure no object with this id exists174 assert(getSynchronisable(header.getObjectID())==nullptr); //make sure no object with this id exists 175 175 BaseObject *bo = orxonox_cast<BaseObject*>(id->fabricate(context)); 176 176 assert(bo); -
code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.h
r9667 r10768 171 171 protected: 172 172 Synchronisable(Context* context); 173 template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb= 0, bool bidirectional=false);174 template <class T> void registerVariable(std::set<T>& variable, uint8_t mode=0x1, NetworkCallbackBase *cb= 0, bool bidirectional=false);173 template <class T> void registerVariable(T& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=nullptr, bool bidirectional=false); 174 template <class T> void registerVariable(std::set<T>& variable, uint8_t mode=0x1, NetworkCallbackBase *cb=nullptr, bool bidirectional=false); 175 175 template <class T> void unregisterVariable(T& var); 176 176 -
code/branches/cpp11_v2/src/libraries/network/synchronisable/SynchronisableVariable.h
r10624 r10768 71 71 { 72 72 public: 73 SynchronisableVariable(T& variable, uint8_t syncDirection=VariableDirection::ToClient, NetworkCallbackBase *cb= 0);73 SynchronisableVariable(T& variable, uint8_t syncDirection=VariableDirection::ToClient, NetworkCallbackBase *cb=nullptr); 74 74 virtual ~SynchronisableVariable(); 75 75 … … 89 89 { 90 90 public: 91 SynchronisableVariableBidirectional(T& variable, uint8_t master=Bidirectionality::ServerMaster, NetworkCallbackBase *cb= 0);91 SynchronisableVariableBidirectional(T& variable, uint8_t master=Bidirectionality::ServerMaster, NetworkCallbackBase *cb=nullptr); 92 92 virtual ~SynchronisableVariableBidirectional(); 93 93 -
code/branches/cpp11_v2/src/libraries/tools/BillboardSet.cc
r8858 r10768 46 46 BillboardSet::BillboardSet() 47 47 { 48 this->billboardSet_ = 0;48 this->billboardSet_ = nullptr; 49 49 } 50 50 … … 81 81 { 82 82 orxout(internal_error) << "Couldn't load billboard \"" << file << '"' << endl; 83 this->billboardSet_ = 0;83 this->billboardSet_ = nullptr; 84 84 } 85 85 … … 104 104 { 105 105 orxout(internal_error) << "Couldn't load billboard \"" << file << '"' << endl; 106 this->billboardSet_ = 0;106 this->billboardSet_ = nullptr; 107 107 } 108 108 … … 114 114 if (this->billboardSet_ && this->scenemanager_) 115 115 this->scenemanager_->destroyBillboardSet(this->billboardSet_); 116 this->billboardSet_ = 0;116 this->billboardSet_ = nullptr; 117 117 } 118 118 -
code/branches/cpp11_v2/src/libraries/tools/DebugDrawer.cc
r10262 r10768 21 21 { 22 22 DebugDrawer::DebugDrawer(Ogre::SceneManager *_sceneManager, float _fillAlpha) : 23 sceneManager(_sceneManager), fillAlpha(_fillAlpha), manualObject( 0), isEnabled(true), linesIndex(0), trianglesIndex(0)23 sceneManager(_sceneManager), fillAlpha(_fillAlpha), manualObject(nullptr), isEnabled(true), linesIndex(0), trianglesIndex(0) 24 24 { 25 25 initialise(); -
code/branches/cpp11_v2/src/libraries/tools/Mesh.cc
r8858 r10768 44 44 Mesh::Mesh() 45 45 { 46 this->entity_ = 0;46 this->entity_ = nullptr; 47 47 this->bCastShadows_ = true; 48 48 } … … 73 73 { 74 74 orxout(internal_error) << "Couldn't load mesh \"" << meshsource << '"' << endl; 75 this->entity_ = 0;75 this->entity_ = nullptr; 76 76 } 77 77 } -
code/branches/cpp11_v2/src/libraries/tools/ParticleInterface.cc
r10624 r10768 59 59 60 60 this->scenemanager_ = scenemanager; 61 this->particleSystem_ = 0;61 this->particleSystem_ = nullptr; 62 62 63 63 this->bEnabled_ = true; … … 80 80 { 81 81 orxout(internal_error) << "Couldn't load particle system \"" << templateName << '"' << endl; 82 this->particleSystem_ = 0;82 this->particleSystem_ = nullptr; 83 83 } 84 84 } … … 110 110 } 111 111 else 112 return 0;112 return nullptr; 113 113 } 114 114 Ogre::ParticleEmitter* ParticleInterface::getEmitter(unsigned int emitterNr) const … … 117 117 return this->particleSystem_->getEmitter(emitterNr); 118 118 else 119 return 0;119 return nullptr; 120 120 } 121 121 void ParticleInterface::removeEmitter(unsigned int emitterNr) … … 142 142 return this->particleSystem_->addAffector(name); 143 143 else 144 return 0;144 return nullptr; 145 145 } 146 146 Ogre::ParticleAffector* ParticleInterface::getAffector(unsigned int affectorNr) … … 149 149 return this->particleSystem_->getAffector(affectorNr); 150 150 else 151 return 0;151 return nullptr; 152 152 } 153 153 void ParticleInterface::removeAffector(unsigned int affectorNr) -
code/branches/cpp11_v2/src/libraries/tools/Shader.cc
r10765 r10768 44 44 @brief Initializes the values and sets the scene manager. 45 45 */ 46 Shader::Shader(Ogre::SceneManager* scenemanager) : compositorInstance_( 0)46 Shader::Shader(Ogre::SceneManager* scenemanager) : compositorInstance_(nullptr) 47 47 { 48 48 RegisterObject(Shader); … … 127 127 Ogre::CompositorManager::getSingleton().removeCompositor(viewport, this->oldcompositorName_); 128 128 this->compositorInstance_->removeListener(this); 129 this->compositorInstance_ = 0;129 this->compositorInstance_ = nullptr; 130 130 } 131 131 if (!this->compositorName_.empty()) -
code/branches/cpp11_v2/src/libraries/tools/Shader.h
r10727 r10768 48 48 { 49 49 public: 50 Shader(Ogre::SceneManager* scenemanager = 0);50 Shader(Ogre::SceneManager* scenemanager = nullptr); 51 51 virtual ~Shader(); 52 52 -
code/branches/cpp11_v2/src/libraries/tools/Timer.cc
r10624 r10768 163 163 void Timer::init() 164 164 { 165 this->executor_ = 0;165 this->executor_ = nullptr; 166 166 this->interval_ = 0; 167 167 this->bLoop_ = false; -
code/branches/cpp11_v2/src/libraries/util/Math.h
r10742 r10768 200 200 template <> inline long double zeroise<long double>() { return 0; } 201 201 template <> inline bool zeroise<bool>() { return 0; } 202 template <> inline void* zeroise<void*>() { return 0; }202 template <> inline void* zeroise<void*>() { return nullptr; } 203 203 template <> inline std::string zeroise<std::string>() { return std::string(); } 204 204 template <> inline orxonox::Radian zeroise<orxonox::Radian>() { return orxonox::Radian(0.0f); } -
code/branches/cpp11_v2/src/libraries/util/MultiType.h
r10197 r10768 266 266 267 267 /// Default constructor: Assigns no value and no type. The type will be determined by the first assignment of a value. 268 inline MultiType() : value_( 0) { }268 inline MultiType() : value_(nullptr) { } 269 269 /// Constructor: Assigns the given value and sets the type. 270 270 template <typename V> 271 inline MultiType(const V& value) : value_( 0) { this->set(value); }271 inline MultiType(const V& value) : value_(nullptr) { this->set(value); } 272 272 /// Copyconstructor: Assigns value and type of the other MultiType. 273 inline MultiType(const MultiType& other) : value_( 0) { this->set(other); }273 inline MultiType(const MultiType& other) : value_(nullptr) { this->set(other); } 274 274 275 275 /// Destructor: Deletes the MT_Value. … … 325 325 if (this->value_) 326 326 delete this->value_; 327 this->value_ = (other.value_) ? other.value_->clone() : 0;327 this->value_ = (other.value_) ? other.value_->clone() : nullptr; 328 328 } 329 329 … … 332 332 333 333 /// Resets value and type. Type will be void afterwards and null() returns true. 334 inline void reset() { if (this->value_) delete this->value_; this->value_ = 0; }334 inline void reset() { if (this->value_) delete this->value_; this->value_ = nullptr; } 335 335 /// Resets the value and changes the internal type to T. 336 336 template <typename T> inline void reset() { this->assignValue(typename Loki::TypeTraits<T>::UnqualifiedReferredType()); } … … 486 486 template <> inline long double MultiType::get() const { return (this->value_ ? this->value_->get<long double>() : 0); } 487 487 template <> inline bool MultiType::get() const { return (this->value_ ? this->value_->get<bool>() : 0); } 488 template <> inline void* MultiType::get() const { return (this->value_ ? this->value_->get<void*>() : 0); }488 template <> inline void* MultiType::get() const { return (this->value_ ? this->value_->get<void*>() : nullptr); } 489 489 template <> inline std::string MultiType::get() const { return (this->value_ ? this->value_->get<std::string>() : NilValue<std::string>()); } 490 490 template <> inline orxonox::Vector2 MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::Vector2>() : NilValue<orxonox::Vector2>()); } -
code/branches/cpp11_v2/src/libraries/util/MultiTypeValue.h
r9550 r10768 77 77 inline bool getValue(long double* value) const { return convertValue<T, long double >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 78 78 inline bool getValue(bool* value) const { return convertValue<T, bool >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 79 inline bool getValue(void** value) const { return convertValue<T, void* >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match.79 inline bool getValue(void** value) const { return convertValue<T, void* >(value, value_, nullptr); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 80 80 inline bool getValue(std::string* value) const { return convertValue<T, std::string >(value, value_, NilValue<std::string> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 81 81 inline bool getValue(orxonox::Vector2* value) const { return convertValue<T, orxonox::Vector2 >(value, value_, NilValue<orxonox::Vector2> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. -
code/branches/cpp11_v2/src/libraries/util/SharedPtr.h
r10765 r10768 216 216 public: 217 217 /// Default constructor, the pointer is set to nullptr. 218 inline SharedPtr() : pointer_( 0), counter_(0)218 inline SharedPtr() : pointer_(nullptr), counter_(nullptr) 219 219 { 220 220 } 221 221 222 222 /// Constructor, creates a SharedPtr that points to @a pointer, increments the counter. 223 inline SharedPtr(T* pointer) : pointer_(pointer), counter_( 0)223 inline SharedPtr(T* pointer) : pointer_(pointer), counter_(nullptr) 224 224 { 225 225 if (this->pointer_) … … 293 293 inline T* operator->() const 294 294 { 295 assert(this->pointer_ != 0);295 assert(this->pointer_ != nullptr); 296 296 return this->pointer_; 297 297 } … … 300 300 inline T& operator*() const 301 301 { 302 assert(this->pointer_ != 0);302 assert(this->pointer_ != nullptr); 303 303 return *this->pointer_; 304 304 } … … 313 313 inline operator bool() const 314 314 { 315 return (this->pointer_ != 0);315 return (this->pointer_ != nullptr); 316 316 } 317 317 -
code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc
r10765 r10768 127 127 } 128 128 // if the signalhandler has already been destroyed then don't do anything 129 if( SignalHandler::singletonPtr_s == 0)129 if( SignalHandler::singletonPtr_s == nullptr ) 130 130 { 131 131 orxout(user_error) << "Received signal " << sigName.c_str() << endl << "Can't write backtrace because SignalHandler is already destroyed" << endl; … … 430 430 431 431 // if the signalhandler has already been destroyed then don't do anything 432 if (SignalHandler::singletonPtr_s == 0)432 if (SignalHandler::singletonPtr_s == nullptr) 433 433 { 434 434 orxout(user_error) << "Caught an unhandled exception" << endl << "Can't write backtrace because SignalHandler is already destroyed" << endl; -
code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc
r10765 r10768 45 45 this->chunkSize_ = std::max(objectSize, sizeof(Chunk)); // the chunk's size will be the maximum of the object's size and the size of a Chunk object itself 46 46 this->numChunksPerBlock_ = numObjects; 47 this->first_ = 0;47 this->first_ = nullptr; 48 48 } 49 49 … … 98 98 99 99 // the next_ pointer of the last chunk must point to nullptr 100 setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, 0);100 setNext(block + (this->numChunksPerBlock_ - 1) * this->chunkSize_, nullptr); 101 101 102 102 // The second chunk in the block is assigned to the first_ pointer -
code/branches/cpp11_v2/src/libraries/util/output/OutputManager.cc
r9550 r10768 57 57 58 58 this->isInitialized_ = false; 59 this->memoryWriterInstance_ = 0;60 this->consoleWriterInstance_ = 0;61 this->logWriterInstance_ = 0;59 this->memoryWriterInstance_ = nullptr; 60 this->consoleWriterInstance_ = nullptr; 61 this->logWriterInstance_ = nullptr; 62 62 63 63 // register 'undefined' context in order to give it always the first context-ID
Note: See TracChangeset
for help on using the changeset viewer.