Orxonox
0.0.5 Codename: Arcturus
|
Declaration of the orxonox::Executor class and the createExecutor() functions. More...
#include "core/CorePrereqs.h"
#include <string>
#include "util/MultiType.h"
#include "Functor.h"
#include "ExecutorPtr.h"
Go to the source code of this file.
Classes | |
class | orxonox::Executor |
This class is used to wrap a Functor and to store default values for any of its parameters. More... | |
class | orxonox::ExecutorMember< T > |
A child class of Executor, used for easier handling of non-static member-functions. More... | |
class | orxonox::ExecutorStatic |
A child class of Executor, used to distinguish executors that wrap static functions from executors that wrap member-functions. More... | |
Namespaces | |
orxonox | |
Die Wagnis Klasse hat die folgenden Aufgaben: | |
Functions | |
ExecutorPtr | orxonox::createExecutor (const FunctorPtr &functor, const std::string &name="") |
Creates a new Executor that wraps a given Functor. More... | |
template<class T > | |
ExecutorMemberPtr< T > | orxonox::createExecutor (const FunctorMemberPtr< T > &functor, const std::string &name="") |
Creates a new ExecutorMember that wraps a given FunctorMember. More... | |
ExecutorStaticPtr | orxonox::createExecutor (const FunctorStaticPtr &functor, const std::string &name="") |
Creates a new ExecutorStatic that wraps a given FunctorStatic. More... | |
Declaration of the orxonox::Executor class and the createExecutor() functions.
orxonox::Executor is used to wrap an orxonox::Functor and to store default values for its parameters. Usually one uses the function createExecutor() to create a new executor. This function returns an orxonox::ExecutorPtr which is a typedef of "std::shared_ptr<Executor>", used to manage the pointer to the executor.
Executors are mostly used to execute callbacks. Because some callback functions need arguments, Executor provides an easy interface to store these arguments as default values, so the executor can also be executed without arguments because it will use these default values.
The Executor doesn't contain the function-pointer directly. Instead it wraps an instance of orxonox::Functor. See Functor.h for more information and some examples.
Example:
Executors don't need to be deleted after usage normally because they are managed by an std::shared_ptr when they were created with createExecutor().