Changeset 10825 for code/branches/cpp11_v2
- Timestamp:
- Nov 22, 2015, 4:55:02 PM (9 years ago)
- Location:
- code/branches/cpp11_v2
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/EventIncludes.h
r10769 r10825 86 86 87 87 #define XMLPortEventStateIntern(name, classname, statename, xmlelement, mode) \ 88 static orxonox::ExecutorMemberPtr<classname> xmlsetfunctor##name = orxonox::createExecutor(orxonox::createFunctor(&classname::addEventSource), std::string( #classname ) + "::" + "addEventSource" + '(' + statename + ')').cast<orxonox::ExecutorMember<classname>>(); \ 89 static orxonox::ExecutorMemberPtr<classname> xmlgetfunctor##name = orxonox::createExecutor(orxonox::createFunctor(&classname::getEventSource), std::string( #classname ) + "::" + "getEventSource" + '(' + statename + ')').cast<orxonox::ExecutorMember<classname>>(); \ 88 static orxonox::ExecutorPtr xmlsetfunctorbase##name = orxonox::createExecutor(orxonox::createFunctor(&classname::addEventSource), std::string( #classname ) + "::" + "addEventSource" + '(' + statename + ')'); \ 89 static orxonox::ExecutorPtr xmlgetfunctorbase##name = orxonox::createExecutor(orxonox::createFunctor(&classname::getEventSource), std::string( #classname ) + "::" + "getEventSource" + '(' + statename + ')'); \ 90 static orxonox::ExecutorMemberPtr<classname> xmlsetfunctor##name = std::static_pointer_cast<orxonox::ExecutorMember<classname>>(xmlsetfunctorbase##name); \ 91 static orxonox::ExecutorMemberPtr<classname> xmlgetfunctor##name = std::static_pointer_cast<orxonox::ExecutorMember<classname>>(xmlgetfunctorbase##name); \ 90 92 xmlsetfunctor##name->setDefaultValue(1, statename); \ 91 93 xmlgetfunctor##name->setDefaultValue(1, statename); \ -
code/branches/cpp11_v2/src/libraries/core/command/CommandExecutor.cc
r10765 r10825 275 275 { 276 276 // it is valid - copy the executor of this command 277 ExecutorPtr executor = new Executor(*evaluation.getConsoleCommand()->getExecutor().get());277 ExecutorPtr executor = std::make_shared<Executor>(*evaluation.getConsoleCommand()->getExecutor().get()); 278 278 279 279 // evaluate the arguments and if this returns no error, store them as default values -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc
r10821 r10825 320 320 { 321 321 if (this->executor_) 322 this->pushFunction( new Executor(*this->executor_.get()));322 this->pushFunction(std::make_shared<Executor>(*this->executor_.get())); 323 323 else 324 324 orxout(internal_error, context::commands) << "Couldn't push copy of executor in console command \"" << this->baseName_ << "\", no executor set." << endl; -
code/branches/cpp11_v2/src/libraries/core/command/Executor.h
r10768 r10825 267 267 inline ExecutorPtr createExecutor(const FunctorPtr& functor, const std::string& name = "") 268 268 { 269 return new Executor(functor, name);269 return std::make_shared<Executor>(functor, name); 270 270 } 271 271 … … 274 274 inline ExecutorMemberPtr<T> createExecutor(const FunctorMemberPtr<T>& functor, const std::string& name = "") 275 275 { 276 return new ExecutorMember<T>(functor, name);276 return std::make_shared<ExecutorMember<T>>(functor, name); 277 277 } 278 278 … … 280 280 inline ExecutorStaticPtr createExecutor(const FunctorStaticPtr& functor, const std::string& name = "") 281 281 { 282 return new ExecutorStatic(functor, name);282 return std::make_shared<ExecutorStatic>(functor, name); 283 283 } 284 284 } -
code/branches/cpp11_v2/src/libraries/core/command/ExecutorPtr.h
r10781 r10825 49 49 50 50 #include "core/CorePrereqs.h" 51 #include "util/SharedPtr.h"51 #include <memory> 52 52 53 53 namespace orxonox 54 54 { 55 using ExecutorPtr = SharedPtr<Executor>;56 using ExecutorStaticPtr = SharedChildPtr<ExecutorStatic, ExecutorPtr>;55 using ExecutorPtr = std::shared_ptr<Executor>; 56 using ExecutorStaticPtr = std::shared_ptr<ExecutorStatic>; 57 57 template <class T> 58 using ExecutorMemberPtr = SharedChildPtr<ExecutorMember<T>, ExecutorPtr>;58 using ExecutorMemberPtr = std::shared_ptr<ExecutorMember<T>>; 59 59 } 60 60 -
code/branches/cpp11_v2/src/libraries/core/command/Functor.h
r10817 r10825 505 505 FunctorPtr clone() 506 506 { 507 return new FunctorTemplate(*this);507 return std::make_shared<FunctorTemplate>(*this); 508 508 } 509 509 … … 574 574 }; 575 575 576 template <class R, class O, class OO, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5), OO* object) { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object577 template <class R, class O, class OO, class P1, class P2, class P3, class P4> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4), OO* object) { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object578 template <class R, class O, class OO, class P1, class P2, class P3> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3), OO* object) { return new FunctorTemplate<R, O, false, P1, P2, P3, void, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object579 template <class R, class O, class OO, class P1, class P2> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2), OO* object) { return new FunctorTemplate<R, O, false, P1, P2, void, void, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object580 template <class R, class O, class OO, class P1> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1), OO* object) { return new FunctorTemplate<R, O, false, P1, void, void, void, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object581 template <class R, class O, class OO> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(), OO* object) { return new FunctorTemplate<R, O, false, void, void, void, void, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object582 template <class R, class O, class OO, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5) const, OO* object) { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object583 template <class R, class O, class OO, class P1, class P2, class P3, class P4> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4) const, OO* object) { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object584 template <class R, class O, class OO, class P1, class P2, class P3> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3) const, OO* object) { return new FunctorTemplate<R, O, true, P1, P2, P3, void, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object585 template <class R, class O, class OO, class P1, class P2> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2) const, OO* object) { return new FunctorTemplate<R, O, true, P1, P2, void, void, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object586 template <class R, class O, class OO, class P1> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1) const, OO* object) { return new FunctorTemplate<R, O, true, P1, void, void, void, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object587 template <class R, class O, class OO> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)() const, OO* object) { return new FunctorTemplate<R, O, true, void, void, void, void, void>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object588 589 template <class R, class O, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5)) { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer590 template <class R, class O, class P1, class P2, class P3, class P4> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4)) { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer591 template <class R, class O, class P1, class P2, class P3> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3)) { return new FunctorTemplate<R, O, false, P1, P2, P3, void, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer592 template <class R, class O, class P1, class P2> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2)) { return new FunctorTemplate<R, O, false, P1, P2, void, void, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer593 template <class R, class O, class P1> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1)) { return new FunctorTemplate<R, O, false, P1, void, void, void, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer594 template <class R, class O> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)()) { return new FunctorTemplate<R, O, false, void, void, void, void, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer595 template <class R, class O, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5) const) { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer596 template <class R, class O, class P1, class P2, class P3, class P4> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4) const) { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer597 template <class R, class O, class P1, class P2, class P3> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3) const) { return new FunctorTemplate<R, O, true, P1, P2, P3, void, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer598 template <class R, class O, class P1, class P2> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2) const) { return new FunctorTemplate<R, O, true, P1, P2, void, void, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer599 template <class R, class O, class P1> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1) const) { return new FunctorTemplate<R, O, true, P1, void, void, void, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer600 template <class R, class O> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)() const) { return new FunctorTemplate<R, O, true, void, void, void, void, void>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer601 602 template <class R, class P1, class P2, class P3, class P4, class P5> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3, P4, P5)) { return new FunctorTemplate<R, void, false, P1, P2, P3, P4, P5>(functionPointer); } ///< Creates a new Functor with the given function-pointer603 template <class R, class P1, class P2, class P3, class P4> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3, P4)) { return new FunctorTemplate<R, void, false, P1, P2, P3, P4, void>(functionPointer); } ///< Creates a new Functor with the given function-pointer604 template <class R, class P1, class P2, class P3> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3)) { return new FunctorTemplate<R, void, false, P1, P2, P3, void, void>(functionPointer); } ///< Creates a new Functor with the given function-pointer605 template <class R, class P1, class P2> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2)) { return new FunctorTemplate<R, void, false, P1, P2, void, void, void>(functionPointer); } ///< Creates a new Functor with the given function-pointer606 template <class R, class P1> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1)) { return new FunctorTemplate<R, void, false, P1, void, void, void, void>(functionPointer); } ///< Creates a new Functor with the given function-pointer607 template <class R> inline FunctorStaticPtr createFunctor(R (*functionPointer)()) { return new FunctorTemplate<R, void, false, void, void, void, void, void>(functionPointer); } ///< Creates a new Functor with the given function-pointer576 template <class R, class O, class OO, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5), OO* object) { return std::make_shared<FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 577 template <class R, class O, class OO, class P1, class P2, class P3, class P4> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4), OO* object) { return std::make_shared<FunctorTemplate<R, O, false, P1, P2, P3, P4, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 578 template <class R, class O, class OO, class P1, class P2, class P3> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3), OO* object) { return std::make_shared<FunctorTemplate<R, O, false, P1, P2, P3, void, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 579 template <class R, class O, class OO, class P1, class P2> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2), OO* object) { return std::make_shared<FunctorTemplate<R, O, false, P1, P2, void, void, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 580 template <class R, class O, class OO, class P1> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1), OO* object) { return std::make_shared<FunctorTemplate<R, O, false, P1, void, void, void, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 581 template <class R, class O, class OO> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(), OO* object) { return std::make_shared<FunctorTemplate<R, O, false, void, void, void, void, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 582 template <class R, class O, class OO, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5) const, OO* object) { return std::make_shared<FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 583 template <class R, class O, class OO, class P1, class P2, class P3, class P4> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4) const, OO* object) { return std::make_shared<FunctorTemplate<R, O, true, P1, P2, P3, P4, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 584 template <class R, class O, class OO, class P1, class P2, class P3> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3) const, OO* object) { return std::make_shared<FunctorTemplate<R, O, true, P1, P2, P3, void, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 585 template <class R, class O, class OO, class P1, class P2> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2) const, OO* object) { return std::make_shared<FunctorTemplate<R, O, true, P1, P2, void, void, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 586 template <class R, class O, class OO, class P1> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1) const, OO* object) { return std::make_shared<FunctorTemplate<R, O, true, P1, void, void, void, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 587 template <class R, class O, class OO> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)() const, OO* object) { return std::make_shared<FunctorTemplate<R, O, true, void, void, void, void, void>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object 588 589 template <class R, class O, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5)) { return std::make_shared<FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 590 template <class R, class O, class P1, class P2, class P3, class P4> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4)) { return std::make_shared<FunctorTemplate<R, O, false, P1, P2, P3, P4, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 591 template <class R, class O, class P1, class P2, class P3> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3)) { return std::make_shared<FunctorTemplate<R, O, false, P1, P2, P3, void, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 592 template <class R, class O, class P1, class P2> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2)) { return std::make_shared<FunctorTemplate<R, O, false, P1, P2, void, void, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 593 template <class R, class O, class P1> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1)) { return std::make_shared<FunctorTemplate<R, O, false, P1, void, void, void, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 594 template <class R, class O> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)()) { return std::make_shared<FunctorTemplate<R, O, false, void, void, void, void, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 595 template <class R, class O, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5) const) { return std::make_shared<FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 596 template <class R, class O, class P1, class P2, class P3, class P4> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4) const) { return std::make_shared<FunctorTemplate<R, O, true, P1, P2, P3, P4, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 597 template <class R, class O, class P1, class P2, class P3> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3) const) { return std::make_shared<FunctorTemplate<R, O, true, P1, P2, P3, void, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 598 template <class R, class O, class P1, class P2> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2) const) { return std::make_shared<FunctorTemplate<R, O, true, P1, P2, void, void, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 599 template <class R, class O, class P1> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1) const) { return std::make_shared<FunctorTemplate<R, O, true, P1, void, void, void, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 600 template <class R, class O> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)() const) { return std::make_shared<FunctorTemplate<R, O, true, void, void, void, void, void>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer 601 602 template <class R, class P1, class P2, class P3, class P4, class P5> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3, P4, P5)) { return std::make_shared<FunctorTemplate<R, void, false, P1, P2, P3, P4, P5>>(functionPointer); } ///< Creates a new Functor with the given function-pointer 603 template <class R, class P1, class P2, class P3, class P4> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3, P4)) { return std::make_shared<FunctorTemplate<R, void, false, P1, P2, P3, P4, void>>(functionPointer); } ///< Creates a new Functor with the given function-pointer 604 template <class R, class P1, class P2, class P3> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3)) { return std::make_shared<FunctorTemplate<R, void, false, P1, P2, P3, void, void>>(functionPointer); } ///< Creates a new Functor with the given function-pointer 605 template <class R, class P1, class P2> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2)) { return std::make_shared<FunctorTemplate<R, void, false, P1, P2, void, void, void>>(functionPointer); } ///< Creates a new Functor with the given function-pointer 606 template <class R, class P1> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1)) { return std::make_shared<FunctorTemplate<R, void, false, P1, void, void, void, void>>(functionPointer); } ///< Creates a new Functor with the given function-pointer 607 template <class R> inline FunctorStaticPtr createFunctor(R (*functionPointer)()) { return std::make_shared<FunctorTemplate<R, void, false, void, void, void, void, void>>(functionPointer); } ///< Creates a new Functor with the given function-pointer 608 608 } 609 609 -
code/branches/cpp11_v2/src/libraries/core/command/FunctorPtr.h
r10781 r10825 51 51 52 52 #include "core/CorePrereqs.h" 53 #include "util/SharedPtr.h"53 #include <memory> 54 54 55 55 namespace orxonox 56 56 { 57 using FunctorPtr = SharedPtr<Functor>;57 using FunctorPtr = std::shared_ptr<Functor>; 58 58 template <class T> 59 using FunctorMemberPtr = SharedChildPtr<FunctorMember<T>, FunctorPtr>;60 using FunctorStaticPtr = FunctorMemberPtr<void>;59 using FunctorMemberPtr = std::shared_ptr<FunctorMember<T>>; 60 using FunctorStaticPtr = std::shared_ptr<FunctorMember<void>>; 61 61 template <class F, class T> 62 using FunctorPointerPtr = SharedChildPtr<FunctorPointer<F, T>, FunctorMemberPtr<T>>;62 using FunctorPointerPtr = std::shared_ptr<FunctorPointer<F, T>>; 63 63 } 64 64 -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.h
r10765 r10825 36 36 37 37 #include "util/Singleton.h" 38 #include "util/SharedPtr.h" 38 39 #include "core/config/Configurable.h" 39 40 -
code/branches/cpp11_v2/src/libraries/core/object/Listable.h
r9667 r10825 40 40 #include <vector> 41 41 42 #include "util/SmallObjectAllocator.h" 42 43 #include "core/class/Identifiable.h" 43 44 -
code/branches/cpp11_v2/test/core/command/ExecutorPtrTest.cc
r10822 r10825 11 11 void testMember() {} 12 12 static void testStatic() {} 13 }; 14 15 class Subclass : public Testclass 16 { 13 17 }; 14 18 … … 71 75 ASSERT_TRUE(static_cast<bool>(ptr2)); 72 76 } 77 78 TEST_F(ExecutorPtrTest, canCastToExecutorMemberOfSubclass) 79 { 80 ExecutorPtr ptr1 = createExecutor(createFunctor(&Subclass::testMember)); 81 ExecutorMemberPtr<Subclass> ptr2 = std::static_pointer_cast<ExecutorMember<Subclass>>(ptr1); 82 ASSERT_TRUE(static_cast<bool>(ptr2)); 83 } 73 84 } -
code/branches/cpp11_v2/test/core/command/FunctorPtrTest.cc
r10822 r10825 11 11 void testMember() {} 12 12 static void testStatic() {} 13 }; 14 15 class Subclass : public Testclass 16 { 13 17 }; 14 18 … … 71 75 ASSERT_TRUE(static_cast<bool>(ptr2)); 72 76 } 77 78 TEST_F(FunctorPtrTest, canCastToFunctorMemberOfSubclass) 79 { 80 FunctorPtr ptr1 = createFunctor(&Subclass::testMember); 81 FunctorMemberPtr<Subclass> ptr2 = std::static_pointer_cast<FunctorMember<Subclass>>(ptr1); 82 ASSERT_TRUE(static_cast<bool>(ptr2)); 83 } 73 84 }
Note: See TracChangeset
for help on using the changeset viewer.