Changeset 7197 for code/branches/consolecommands3/src/libraries
- Timestamp:
- Aug 21, 2010, 9:03:23 PM (14 years ago)
- Location:
- code/branches/consolecommands3/src/libraries/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/CorePrereqs.h
r7169 r7197 235 235 } 236 236 237 #include "FunctorPtr.h" 238 #include "ExecutorPtr.h" 239 237 240 // CppTcl 238 241 namespace Tcl -
code/branches/consolecommands3/src/libraries/core/ExecutorPtr.h
r7196 r7197 37 37 typedef SharedPtr<Executor> ExecutorPtr; 38 38 39 typedef Shared Ptr<ExecutorStatic> ExecutorStaticPtr;39 typedef SharedChildPtr<ExecutorStatic, ExecutorPtr> ExecutorStaticPtr; 40 40 41 41 template <class T> 42 class ExecutorMemberPtr : public Shared Ptr<ExecutorMember<T>>42 class ExecutorMemberPtr : public SharedChildPtr<ExecutorMember<T>, ExecutorPtr> 43 43 { 44 44 public: 45 inline ExecutorMemberPtr() : SharedPtr<ExecutorMember<T> >() {} 46 inline ExecutorMemberPtr(ExecutorMember<T>* pointer) : SharedPtr<ExecutorMember<T> >(pointer) {} 47 // inline ExecutorMemberPtr(const ExecutorMemberPtr& other) : SharedPtr<ExecutorMember<T> >(other) {} 48 template <class O> 49 inline ExecutorMemberPtr(const SharedPtr<O>& other) : SharedPtr<ExecutorMember<T> >(other) {} 50 /* 51 inline const ExecutorMemberPtr& operator=(const ExecutorMemberPtr& other) { this->SharedPtr<ExecutorMember<T> >::operator=(other); return *this; } 52 template <class O> 53 inline const ExecutorMemberPtr& operator=(const SharedPtr<O>& other) { this->SharedPtr<ExecutorMember<T> >::operator=(other); return *this; } 54 */ 55 private: 56 // inline ExecutorMemberPtr(ExecutorMember<T>* pointer, int* counter) : SharedPtr<ExecutorMember<T> >(pointer, counter) {} 45 inline ExecutorMemberPtr() : SharedChildPtr<ExecutorMember<T>, ExecutorPtr>() {} 46 inline ExecutorMemberPtr(ExecutorMember<T>* pointer) : SharedChildPtr<ExecutorMember<T>, ExecutorPtr>(pointer) {} 47 inline ExecutorMemberPtr(const SharedPtr<ExecutorMember<T> >& other) : SharedChildPtr<ExecutorMember<T>, ExecutorPtr>(other) {} 57 48 }; 58 /*59 typedef SharedChildPtr<ExecutorStatic, Executor> ExecutorStaticPtr;60 61 template <class T>62 class ExecutorMemberPtr : public SharedChildPtr<ExecutorMember<T>, Executor>63 {64 public:65 inline ExecutorMemberPtr() : SharedChildPtr<ExecutorMember<T>, Executor>() {}66 inline ExecutorMemberPtr(ExecutorMember<T>* pointer) : SharedChildPtr<ExecutorMember<T>, Executor>(pointer) {}67 };68 */69 49 } 70 50 -
code/branches/consolecommands3/src/libraries/core/FunctorPtr.h
r7196 r7197 37 37 typedef SharedPtr<Functor> FunctorPtr; 38 38 39 typedef Shared Ptr<FunctorStatic> FunctorStaticPtr;39 typedef SharedChildPtr<FunctorStatic, FunctorPtr> FunctorStaticPtr; 40 40 41 41 template <class T> 42 class FunctorMemberPtr : public Shared Ptr<FunctorMember<T>>42 class FunctorMemberPtr : public SharedChildPtr<FunctorMember<T>, FunctorPtr> 43 43 { 44 44 public: 45 inline FunctorMemberPtr() : SharedPtr<FunctorMember<T> >() {} 46 inline FunctorMemberPtr(FunctorMember<T>* pointer) : SharedPtr<FunctorMember<T> >(pointer) {} 47 // inline FunctorMemberPtr(const FunctorMemberPtr& other) : SharedPtr<FunctorMember<T> >(other) {} 45 inline FunctorMemberPtr() : SharedChildPtr<FunctorMember<T>, FunctorPtr>() {} 46 inline FunctorMemberPtr(FunctorMember<T>* pointer) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(pointer) {} 47 // inline FunctorMemberPtr(const FunctorMemberPtr& other) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(other) {} 48 // template <class O> 49 // inline FunctorMemberPtr(const SharedPtr<O>& other) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(other) {} 50 // template <class O> 51 // inline FunctorMemberPtr(const SharedChildPtr<O, FunctorMember<T> >& other) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(other) {} 52 inline FunctorMemberPtr(const SharedPtr<FunctorMember<T> >& other) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(other) {} 53 54 /* 55 inline const FunctorMemberPtr& operator=(const FunctorMemberPtr& other) { this->SharedChildPtr<FunctorMember<T>, FunctorPtr>::operator=(other); return *this; } 48 56 template <class O> 49 inline FunctorMemberPtr(const SharedPtr<O>& other) : SharedPtr<FunctorMember<T> >(other) {} 50 /* 51 inline const FunctorMemberPtr& operator=(const FunctorMemberPtr& other) { this->SharedPtr<FunctorMember<T> >::operator=(other); return *this; } 52 template <class O> 53 inline const FunctorMemberPtr& operator=(const SharedPtr<O>& other) { this->SharedPtr<FunctorMember<T> >::operator=(other); return *this; } 57 inline const FunctorMemberPtr& operator=(const SharedPtr<O>& other) { this->SharedChildPtr<FunctorMember<T>, FunctorPtr>::operator=(other); return *this; } 54 58 */ 55 59 private: 56 // inline FunctorMemberPtr(FunctorMember<T>* pointer, int* counter) : Shared Ptr<FunctorMember<T>>(pointer, counter) {}60 // inline FunctorMemberPtr(FunctorMember<T>* pointer, int* counter) : SharedChildPtr<FunctorMember<T>, FunctorPtr>(pointer, counter) {} 57 61 }; 58 62 /* -
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.