Changeset 10828 for code/branches/cpp11_v2/src/libraries/core
- Timestamp:
- Nov 22, 2015, 5:26:10 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/command/Executor.h
r10825 r10828 42 42 orxonox::Executor is used to wrap an orxonox::Functor and to store default values for 43 43 its parameters. Usually one uses the function createExecutor() to create a new executor. 44 This function returns an orxonox::ExecutorPtr which is a typedef of @ref orxonox::SharedPtr45 "SharedPtr<Executor>",used to manage the pointer to the executor.44 This function returns an orxonox::ExecutorPtr which is a typedef of "std::shared_ptr<Executor>", 45 used to manage the pointer to the executor. 46 46 47 47 Executors are mostly used to execute callbacks. Because some callback functions need arguments, … … 74 74 @endcode 75 75 76 Because executors that were created with createExecutor() are managed by an orxonox::SharedPtr,77 they don't need to be deleted after usage.76 Executors don't need to be deleted after usage normally because they are managed by an 77 std::shared_ptr when they were created with createExecutor(). 78 78 */ 79 79 -
code/branches/cpp11_v2/src/libraries/core/command/ExecutorPtr.h
r10825 r10828 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 -
code/branches/cpp11_v2/src/libraries/core/command/Functor.h
r10825 r10828 40 40 41 41 To create a Functor, the helper function createFunctor() is used. It returns an instance 42 of orxonox::FunctorPtr which is simply a typedef of @ref orxonox::SharedPtr "SharedPtr<Functor>".43 Thismeans you don't have to delete the Functor after using it, because it is managed44 by the SharedPtr.42 of orxonox::FunctorPtr which is simply a typedef of "std::shared_ptr<Functor>". This 43 means you don't have to delete the Functor after using it, because it is managed 44 by the std::shared_ptr. 45 45 46 46 Example: -
code/branches/cpp11_v2/src/libraries/core/command/FunctorPtr.h
r10825 r10828 32 32 @brief Typedefs and definitions of FunctorPtr, FunctorMemberPtr, FunctorStaticPtr, and FunctorPointerPtr 33 33 34 Instances of orxonox::Functor are usually managed by an orxonox::SharedPtr. This ensures34 Instances of orxonox::Functor are usually managed by an std::shared_ptr. This ensures 35 35 that Functors will be destroyed after usage. To make things easier, there's a typedef 36 that defines FunctorPtr as SharedPtr<Functor>.36 that defines FunctorPtr as std::shared_ptr<Functor>. 37 37 38 38 Because there's not only orxonox::Functor, but also orxonox::FunctorStatic, and -
code/branches/cpp11_v2/src/libraries/core/object/StrongPtr.h
r10770 r10828 43 43 orxonox::StrongPtr is an implementation of a smart pointer - it wraps a pointer to an 44 44 object and keeps this object alive until no StrongPtr points to this object anymore. 45 In contrast to orxonox::SharedPtr, StrongPtr works only with classes that are derived45 In contrast to std::shared_ptr, StrongPtr works only with classes that are derived 46 46 from orxonox::Destroyable, because it's an intrusive implementation, meaning the 47 47 reference counter is stored in the object itself. … … 51 51 at any time and also convert it back to a normal pointer if you like. This is possible 52 52 because the reference counter is stored in the object itself and not in StrongPtr (in 53 contrast to SharedPtr).53 contrast to std::shared_ptr). 54 54 55 55 @b Important: If you want to delete an object, you must not use @c delete @c object but
Note: See TracChangeset
for help on using the changeset viewer.