- Timestamp:
- Aug 22, 2010, 12:48:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/SharedPtr.h
r7197 r7201 50 50 void destroy() 51 51 { 52 // COUT(0) << "delete " << this->pointer_ << std::endl;53 52 delete this->pointer_; 54 53 } … … 67 66 inline SharedPtr() : pointer_(0), counter_(0), destroyer_(0) 68 67 { 69 // COUT(0) << "SharedPtr (1): " << this->pointer_ << std::endl;70 68 } 71 69 72 70 inline SharedPtr(T* pointer) : pointer_(pointer), counter_(0), destroyer_(0) 73 71 { 74 // COUT(0) << "SharedPtr (2): " << this->pointer_ << std::endl;75 72 if (this->pointer_) 76 73 { … … 82 79 inline SharedPtr(const SharedPtr& other) : pointer_(other.pointer_), counter_(other.counter_), destroyer_(other.destroyer_) 83 80 { 84 // COUT(0) << "SharedPtr (3): " << this->pointer_ << std::endl;85 81 if (this->pointer_) 86 82 ++(*this->counter_); … … 90 86 inline SharedPtr(const SharedPtr<O>& other) : pointer_(other.pointer_), counter_(other.counter_), destroyer_(other.destroyer_) 91 87 { 92 // COUT(0) << "SharedPtr (4): " << this->pointer_ << std::endl;93 88 if (this->pointer_) 94 89 ++(*this->counter_); … … 97 92 inline ~SharedPtr() 98 93 { 99 // COUT(0) << "~SharedPtr: " << this->pointer_ << std::endl;100 94 if (this->pointer_) 101 95 { … … 113 107 inline const SharedPtr& operator=(const SharedPtr& other) 114 108 { 115 // COUT(0) << "SharedPtr= (1)" << std::endl;116 109 SharedPtr(other).swap(*this); 117 110 return *this; … … 121 114 inline const SharedPtr& operator=(const SharedPtr<O>& other) 122 115 { 123 // COUT(0) << "SharedPtr= (2)" << std::endl;124 116 SharedPtr(other).swap(*this); 125 117 return *this; … … 160 152 inline SharedPtr(T* pointer, int* counter, SharedPtrDestroyer* destroyer) : pointer_(pointer), counter_(counter), destroyer_(destroyer) 161 153 { 162 // COUT(0) << "SharedPtr (5): " << this->pointer_ << std::endl;163 154 if (this->pointer_) 164 155 ++(*this->counter_); … … 176 167 inline SharedChildPtr() : Parent() {} 177 168 inline SharedChildPtr(T* pointer) : Parent(pointer) {} 178 // inline SharedChildPtr(const SharedChildPtr& other) : Parent(other) {}179 // template <class O>180 // inline SharedChildPtr(const SharedChildPtr<O, T>& other) : Parent(other) {}181 169 inline SharedChildPtr(const SharedPtr<T>& other) : Parent(other) {} 182 183 // inline const SharedChildPtr& operator=(const SharedChildPtr& other) { Parent::operator=(other); return *this; }184 170 185 171 inline T* operator->() const { return static_cast<T*>(Parent::operator->()); }
Note: See TracChangeset
for help on using the changeset viewer.