- Timestamp:
- Aug 21, 2010, 9:03:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/SharedPtr.h
r7196 r7197 32 32 #include "CorePrereqs.h" 33 33 #include <algorithm> 34 #include <cassert> 34 35 35 36 namespace orxonox … … 168 169 SharedPtrDestroyer* destroyer_; 169 170 }; 170 /* 171 171 172 template <class T, class Parent> 172 class SharedChildPtr : public SharedPtr<Parent>173 class SharedChildPtr : public Parent 173 174 { 174 175 public: 175 inline SharedChildPtr() : SharedPtr<Parent>() {} 176 inline SharedChildPtr(T* pointer) : SharedPtr<Parent>(pointer) {} 177 inline SharedChildPtr(const SharedChildPtr& other) : SharedPtr<Parent>(other) {} 178 inline const SharedChildPtr& operator=(const SharedChildPtr& other) { SharedPtr<Parent>::operator=(other); return *this; } 179 inline T* operator->() const { return static_cast<T*>(SharedPtr<Parent>::operator->()); } 180 inline T& operator*() const { return *static_cast<T*>(SharedPtr<Parent>::operator->()); } 176 inline SharedChildPtr() : Parent() {} 177 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 inline SharedChildPtr(const SharedPtr<T>& other) : Parent(other) {} 182 183 // inline const SharedChildPtr& operator=(const SharedChildPtr& other) { Parent::operator=(other); return *this; } 184 185 inline T* operator->() const { return static_cast<T*>(Parent::operator->()); } 186 inline T& operator*() const { return *static_cast<T*>(Parent::operator->()); } 181 187 }; 182 */ 188 183 189 } 184 190
Note: See TracChangeset
for help on using the changeset viewer.