Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2010, 12:27:53 AM (14 years ago)
Author:
landauf
Message:

createExecutor() now returns a SharedPtr instead of a pointer. Adapted code that uses createExecutor() accordingly.

Location:
code/branches/consolecommands3/src/libraries/core
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/BaseObject.cc

    r7163 r7200  
    477477                if (!container)
    478478                {
    479                     ExecutorMember<BaseObject>* setfunctor = createExecutor(createFunctor(&BaseObject::addEventSource), std::string( "BaseObject" ) + "::" + "addEventSource" + '(' + statename + ')');
    480                     ExecutorMember<BaseObject>* getfunctor = createExecutor(createFunctor(&BaseObject::getEventSource), std::string( "BaseObject" ) + "::" + "getEventSource" + '(' + statename + ')');
     479                    const ExecutorMemberPtr<BaseObject>& setfunctor = createExecutor(createFunctor(&BaseObject::addEventSource), std::string( "BaseObject" ) + "::" + "addEventSource" + '(' + statename + ')');
     480                    const ExecutorMemberPtr<BaseObject>& getfunctor = createExecutor(createFunctor(&BaseObject::getEventSource), std::string( "BaseObject" ) + "::" + "getEventSource" + '(' + statename + ')');
    481481                    setfunctor->setDefaultValue(1, statename);
    482482                    getfunctor->setDefaultValue(1, statename);
  • code/branches/consolecommands3/src/libraries/core/EventIncludes.h

    r7163 r7200  
    7676
    7777#define XMLPortEventStateIntern(name, classname, statename, xmlelement, mode) \
    78     static orxonox::ExecutorMember<classname>* xmlsetfunctor##name = (orxonox::ExecutorMember<classname>*)&orxonox::createExecutor(orxonox::createFunctor(&classname::addEventSource), std::string( #classname ) + "::" + "addEventSource" + '(' + statename + ')')->setDefaultValue(1, statename); \
    79     static orxonox::ExecutorMember<classname>* xmlgetfunctor##name = (orxonox::ExecutorMember<classname>*)&orxonox::createExecutor(orxonox::createFunctor(&classname::getEventSource), std::string( #classname ) + "::" + "getEventSource" + '(' + statename + ')')->setDefaultValue(1, statename); \
     78    static orxonox::ExecutorMemberPtr<classname> xmlsetfunctor##name = orxonox::createExecutor(orxonox::createFunctor(&classname::addEventSource), std::string( #classname ) + "::" + "addEventSource" + '(' + statename + ')').cast<orxonox::ExecutorMember<classname> >(); \
     79    static orxonox::ExecutorMemberPtr<classname> xmlgetfunctor##name = orxonox::createExecutor(orxonox::createFunctor(&classname::getEventSource), std::string( #classname ) + "::" + "getEventSource" + '(' + statename + ')').cast<orxonox::ExecutorMember<classname> >(); \
     80    xmlsetfunctor##name->setDefaultValue(1, statename); \
     81    xmlgetfunctor##name->setDefaultValue(1, statename); \
    8082    XMLPortObjectGeneric(xmlport##name, classname, orxonox::BaseObject, statename, xmlsetfunctor##name, xmlgetfunctor##name, xmlelement, mode, false, true)
    8183
  • code/branches/consolecommands3/src/libraries/core/Executor.cc

    r7198 r7200  
    191191    }
    192192
    193     Executor& Executor::setDefaultValues(const MultiType& param1)
    194     {
    195         this->defaultValue_[0] = param1;
    196 
    197         return (*this);
    198     }
    199 
    200     Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2)
    201     {
    202         this->defaultValue_[0] = param1;
    203         this->defaultValue_[1] = param2;
    204 
    205         return (*this);
    206     }
    207 
    208     Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3)
     193    void Executor::setDefaultValues(const MultiType& param1)
     194    {
     195        this->defaultValue_[0] = param1;
     196    }
     197
     198    void Executor::setDefaultValues(const MultiType& param1, const MultiType& param2)
     199    {
     200        this->defaultValue_[0] = param1;
     201        this->defaultValue_[1] = param2;
     202    }
     203
     204    void Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3)
    209205    {
    210206        this->defaultValue_[0] = param1;
    211207        this->defaultValue_[1] = param2;
    212208        this->defaultValue_[2] = param3;
    213 
    214         return (*this);
    215     }
    216 
    217     Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4)
     209    }
     210
     211    void Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4)
    218212    {
    219213        this->defaultValue_[0] = param1;
     
    221215        this->defaultValue_[2] = param3;
    222216        this->defaultValue_[3] = param4;
    223 
    224         return (*this);
    225     }
    226 
    227     Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5)
     217    }
     218
     219    void Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5)
    228220    {
    229221        this->defaultValue_[0] = param1;
     
    232224        this->defaultValue_[3] = param4;
    233225        this->defaultValue_[4] = param5;
    234 
    235         return (*this);
    236     }
    237 
    238     Executor& Executor::setDefaultValue(unsigned int index, const MultiType& param)
     226    }
     227
     228    void Executor::setDefaultValue(unsigned int index, const MultiType& param)
    239229    {
    240230        if (index < MAX_FUNCTOR_ARGUMENTS)
    241231            this->defaultValue_[index] = param;
    242 
    243         return (*this);
    244232    }
    245233
  • code/branches/consolecommands3/src/libraries/core/Executor.h

    r7198 r7200  
    8181                { return this->name_; }
    8282
    83             Executor& setDefaultValues(const MultiType& param1);
    84             Executor& setDefaultValues(const MultiType& param1, const MultiType& param2);
    85             Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3);
    86             Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4);
    87             Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5);
    88             Executor& setDefaultValue(unsigned int index, const MultiType& param);
     83            void setDefaultValues(const MultiType& param1);
     84            void setDefaultValues(const MultiType& param1, const MultiType& param2);
     85            void setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3);
     86            void setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4);
     87            void setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5);
     88            void setDefaultValue(unsigned int index, const MultiType& param);
    8989
    9090            inline MultiType getDefaultValue(unsigned int index) const
     
    169169
    170170                this->functorMember_->setObject(object);
    171                 const MultiType& result = Executor::parse(params, success, delimiter);
     171                const MultiType& result = this->Executor::parse(params, success, delimiter);
    172172                this->functorMember_->setObjects(objects);
    173173
     
    180180
    181181                this->functorMember_->setObject(object);
    182                 const MultiType& result = Executor::parse(params, success, delimiter);
     182                const MultiType& result = this->Executor::parse(params, success, delimiter);
    183183                this->functorMember_->setObjects(objects);
    184184
     
    190190    };
    191191
    192     inline Executor* createExecutor(const FunctorPtr& functor, const std::string& name = "")
     192    inline ExecutorPtr createExecutor(const FunctorPtr& functor, const std::string& name = "")
    193193    {
    194194        return new Executor(functor, name);
     
    196196
    197197    template <class T>
    198     inline ExecutorMember<T>* createExecutor(const FunctorMemberPtr<T>& functor, const std::string& name = "")
     198    inline ExecutorMemberPtr<T> createExecutor(const FunctorMemberPtr<T>& functor, const std::string& name = "")
    199199    {
    200200        return new ExecutorMember<T>(functor, name);
    201201    }
    202202
    203     inline ExecutorStatic* createExecutor(const FunctorStaticPtr& functor, const std::string& name = "")
     203    inline ExecutorStaticPtr createExecutor(const FunctorStaticPtr& functor, const std::string& name = "")
    204204    {
    205205        return new ExecutorStatic(functor, name);
  • code/branches/consolecommands3/src/libraries/core/Thread.cc

    r6417 r7200  
    7575    }
    7676
    77     bool Thread::evaluateExecutor( Executor* executor )
     77    bool Thread::evaluateExecutor( const ExecutorPtr& executor )
    7878    {
    7979        this->isWorkingMutex_->lock();
     
    9292        {
    9393            //this->executorMutex_->lock();
    94             Executor* executor = this->executor_;
     94            ExecutorPtr executor = this->executor_;
    9595            //this->executorMutex_->unlock();
    9696            if( executor )
     
    9898                (*executor)();
    9999                this->executorMutex_->lock();
    100                 delete this->executor_;
    101100                this->executor_ = 0;
    102101                this->executorMutex_->unlock();
  • code/branches/consolecommands3/src/libraries/core/Thread.h

    r6417 r7200  
    4646        bool isWorking();
    4747        void waitUntilFinished();
    48         bool evaluateExecutor( Executor* executor );
     48        bool evaluateExecutor( const ExecutorPtr& executor );
    4949
    5050    private:
    5151        void            threadLoop();
    5252
    53         Executor     executor_;
     53        ExecutorPtr     executor_;
    5454        bool            isWorking_;
    5555        bool            stopThread_;
    5656        boost::thread*  workerThread_;
    5757        boost::mutex*   executorMutex_;
    58         boost::mutex*     isWorkingMutex_;
     58        boost::mutex*   isWorkingMutex_;
    5959        boost::mutex*   stopThreadMutex_;
    6060    };
  • code/branches/consolecommands3/src/libraries/core/ThreadPool.cc

    r6417 r7200  
    8181    }
    8282
    83     bool ThreadPool::passFunction( Executor* executor, bool addThread )
     83    bool ThreadPool::passFunction( const ExecutorPtr& executor, bool addThread )
    8484    {
    8585        std::vector<Thread*>::iterator it;
  • code/branches/consolecommands3/src/libraries/core/ThreadPool.h

    r6417 r7200  
    4646        unsigned int setNrOfThreads( unsigned int nr );
    4747
    48         bool passFunction( Executor* executor, bool addThread=false );
     48        bool passFunction( const ExecutorPtr& executor, bool addThread=false );
    4949        void synchronise();
    5050
  • code/branches/consolecommands3/src/libraries/core/XMLPort.h

    r7189 r7200  
    7575*/
    7676#define XMLPortParam(classname, paramname, loadfunction, savefunction, xmlelement, mode) \
    77     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    78     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     77    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     78    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    7979    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, classname, this, paramname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode)
    8080
     
    9494#define XMLPortParamVariable(classname, paramname, variable, xmlelement, mode) \
    9595    XMLPortVariableHelperClass xmlcontainer##variable##dummy(static_cast<void*>(&variable)); \
    96     static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##loadexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getLoader(variable)), std::string( #classname ) + "::" + #variable + "loader")); \
    97     static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##saveexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getSaver (variable)), std::string( #classname ) + "::" + #variable + "saver" )); \
     96    static ExecutorMemberPtr<orxonox::XMLPortVariableHelperClass> xmlcontainer##variable##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getLoader(variable)), std::string( #classname ) + "::" + #variable + "loader"); \
     97    static ExecutorMemberPtr<orxonox::XMLPortVariableHelperClass> xmlcontainer##variable##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getSaver (variable)), std::string( #classname ) + "::" + #variable + "saver" ); \
    9898    XMLPortParamGeneric(xmlcontainer##variable, classname, orxonox::XMLPortVariableHelperClass, &xmlcontainer##variable##dummy, paramname, xmlcontainer##variable##loadexecutor, xmlcontainer##variable##saveexecutor, xmlelement, mode)
    9999
     
    110110*/
    111111#define XMLPortParamTemplate(classname, paramname, loadfunction, savefunction, xmlelement, mode, ...) \
    112     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    113     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     112    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     113    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    114114    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, classname, this, paramname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode)
    115115
     
    129129*/
    130130#define XMLPortParamLoadOnly(classname, paramname, loadfunction, xmlelement, mode) \
    131     static ExecutorMember<classname>* xmlcontainer##loadfunction##0##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     131    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##0##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    132132    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, classname, this, paramname, xmlcontainer##loadfunction##0##loadexecutor, 0, xmlelement, mode)
    133133/**
     
    135135*/
    136136#define XMLPortParamLoadOnlyTemplate(classname, paramname, loadfunction, xmlelement, mode, ...) \
    137     static ExecutorMember<classname>* xmlcontainer##loadfunction##0##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     137    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##0##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    138138    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, classname, this, paramname, xmlcontainer##loadfunction##0##loadexecutor, 0, xmlelement, mode)
    139139
     
    161161*/
    162162#define XMLPortParamExtern(classname, externclass, object, paramname, loadfunction, savefunction, xmlelement, mode) \
    163     static ExecutorMember<externclass>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction); \
    164     static ExecutorMember<externclass>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction); \
     163    static ExecutorMemberPtr<externclass> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction); \
     164    static ExecutorMemberPtr<externclass> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction); \
    165165    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, externclass, object, paramname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode);
    166166/**
     
    168168*/
    169169#define XMLPortParamExternTemplate(classname, externclass, object, paramname, loadfunction, savefunction, xmlelement, mode, ...) \
    170     static ExecutorMember<externclass>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<externclass, __VA_ARGS__ >(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction); \
    171     static ExecutorMember<externclass>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction); \
     170    static ExecutorMemberPtr<externclass> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<externclass, __VA_ARGS__ >(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction); \
     171    static ExecutorMemberPtr<externclass> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction); \
    172172    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, externclass, object, paramname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode);
    173173
     
    249249*/
    250250#define XMLPortObjectExtended(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
    251     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    252     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     251    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     252    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    253253    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore)
    254254/**
     
    256256*/
    257257#define XMLPortObjectExtendedTemplate(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore, ...) \
    258     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    259     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     258    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     259    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    260260    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore)
    261261
     
    267267*/
    268268#define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode) \
    269     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    270     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     269    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     270    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    271271    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode, false, true)
    272272/**
     
    274274*/
    275275#define XMLPortObjectTemplate(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, ...) \
    276     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
    277     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
     276    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##loadexecutor = orxonox::createExecutor(orxonox::createFunctor<classname, __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction); \
     277    static ExecutorMemberPtr<classname> xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    278278    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, xmlcontainer##loadfunction##savefunction##loadexecutor, xmlcontainer##loadfunction##savefunction##saveexecutor, xmlelement, mode, false, true)
    279279
     
    348348
    349349        public:
    350             XMLPortClassParamContainer(const std::string& paramname, Identifier* identifier, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor)
     350            XMLPortClassParamContainer(const std::string& paramname, Identifier* identifier, const ExecutorMemberPtr<T>& loadexecutor, const ExecutorMemberPtr<T>& saveexecutor)
    351351            {
    352352                this->paramname_ = paramname;
     
    358358            ~XMLPortClassParamContainer()
    359359            {
    360                 assert(this->loadexecutor_);
    361                 delete this->loadexecutor_;
    362                 if (this->saveexecutor_)
    363                     delete this->saveexecutor_;
    364360            }
    365361
     
    479475
    480476        private:
    481             ExecutorMember<T>* loadexecutor_;
    482             ExecutorMember<T>* saveexecutor_;
     477            ExecutorMemberPtr<T> loadexecutor_;
     478            ExecutorMemberPtr<T> saveexecutor_;
    483479            ParseParams parseParams_;
    484480    };
     
    522518    {
    523519        public:
    524             XMLPortClassObjectContainer(const std::string& sectionname, Identifier* identifier, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor, bool bApplyLoaderMask, bool bLoadBefore)
     520            XMLPortClassObjectContainer(const std::string& sectionname, Identifier* identifier, const ExecutorMemberPtr<T>& loadexecutor, const ExecutorMemberPtr<T>& saveexecutor, bool bApplyLoaderMask, bool bLoadBefore)
    525521            {
    526522                this->sectionname_ = sectionname;
     
    536532            ~XMLPortClassObjectContainer()
    537533            {
    538                 assert(this->loadexecutor_);
    539                 delete this->loadexecutor_;
    540                 if (this->saveexecutor_)
    541                     delete this->saveexecutor_;
    542534            }
    543535
     
    553545
    554546        private:
    555             ExecutorMember<T>* loadexecutor_;
    556             ExecutorMember<T>* saveexecutor_;
     547            ExecutorMemberPtr<T> loadexecutor_;
     548            ExecutorMemberPtr<T> saveexecutor_;
    557549    };
    558550
Note: See TracChangeset for help on using the changeset viewer.