Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/command/ExecutorPtr.h

    r7401 r11071  
    3232    @brief Typedefs and definitions of ExecutorPtr, ExecutorStaticPtr, and ExecutorMemberPtr
    3333
    34     Instances of orxonox::Executor are usually managed by an orxonox::SharedPtr. This ensures
     34    Instances of orxonox::Executor are usually managed by an std::shared_ptr. This ensures
    3535    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>.
    3737
    3838    Because there's not only orxonox::Executor, but also orxonox::ExecutorStatic, and
     
    4949
    5050#include "core/CorePrereqs.h"
    51 #include "util/SharedPtr.h"
     51#include <memory>
    5252
    5353namespace orxonox
    5454{
    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>;
    6257    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>>;
    7059}
    7160
Note: See TracChangeset for help on using the changeset viewer.