Changeset 11071 for code/trunk/src/libraries/core/command/ExecutorPtr.h
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/command/ExecutorPtr.h
r7401 r11071 32 32 @brief Typedefs and definitions of ExecutorPtr, ExecutorStaticPtr, and ExecutorMemberPtr 33 33 34 Instances of orxonox::Executor are usually managed by an orxonox::SharedPtr. This ensures34 Instances of orxonox::Executor are usually managed by an std::shared_ptr. This ensures 35 35 that Executors will be destroyed after usage. To make things easier, there's a typedef 36 that defines ExecutorPtr as SharedPtr<Executor>.36 that defines ExecutorPtr as std::shared_ptr<Executor>. 37 37 38 38 Because there's not only orxonox::Executor, but also orxonox::ExecutorStatic, and … … 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 /// ExecutorPtr is just a typedef of SharedPtr 56 typedef SharedPtr<Executor> ExecutorPtr; 57 58 /// ExecutorStaticPtr is just a typedef of SharedChildPtr 59 typedef SharedChildPtr<ExecutorStatic, ExecutorPtr> ExecutorStaticPtr; 60 61 /// It's not possible to use a typedef for ExecutorMemberPtr<T>, so we have to create a child-class instead. It inherits all functions from SharedChildPtr, but needs to (re-)implement some constructors. 55 using ExecutorPtr = std::shared_ptr<Executor>; 56 using ExecutorStaticPtr = std::shared_ptr<ExecutorStatic>; 62 57 template <class T> 63 class ExecutorMemberPtr : public SharedChildPtr<ExecutorMember<T>, ExecutorPtr> 64 { 65 public: 66 inline ExecutorMemberPtr() : SharedChildPtr<ExecutorMember<T>, ExecutorPtr>() {} 67 inline ExecutorMemberPtr(ExecutorMember<T>* pointer) : SharedChildPtr<ExecutorMember<T>, ExecutorPtr>(pointer) {} 68 inline ExecutorMemberPtr(const SharedPtr<ExecutorMember<T> >& other) : SharedChildPtr<ExecutorMember<T>, ExecutorPtr>(other) {} 69 }; 58 using ExecutorMemberPtr = std::shared_ptr<ExecutorMember<T>>; 70 59 } 71 60
Note: See TracChangeset
for help on using the changeset viewer.