Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 21, 2010, 9:03:23 PM (14 years ago)
Author:
landauf
Message:

Changed the implementation of SharedPtr again. I decided to represent the inheritance of the underlying object pointers by using inheritance in the SharedPtr itself (with SharedChildPtr : public SharedPtr). The previous solution led to ambiguity in functions that are overloaded for different types of SharedPtr (for example createExecutor).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/ExecutorPtr.h

    r7196 r7197  
    3737    typedef SharedPtr<Executor> ExecutorPtr;
    3838
    39     typedef SharedPtr<ExecutorStatic> ExecutorStaticPtr;
     39    typedef SharedChildPtr<ExecutorStatic, ExecutorPtr> ExecutorStaticPtr;
    4040
    4141    template <class T>
    42     class ExecutorMemberPtr : public SharedPtr<ExecutorMember<T> >
     42    class ExecutorMemberPtr : public SharedChildPtr<ExecutorMember<T>, ExecutorPtr>
    4343    {
    4444        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) {}
    5748    };
    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 */
    6949}
    7050
Note: See TracChangeset for help on using the changeset viewer.