Changeset 10768 for code/branches/cpp11_v2/src/libraries/util
- Timestamp:
- Nov 6, 2015, 10:54:34 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/util
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
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.