Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Attributes | List of all members
orxonox::ExecutorMember< T > Class Template Reference

A child class of Executor, used for easier handling of non-static member-functions. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/command/Executor.h>

Inheritance diagram for orxonox::ExecutorMember< T >:
orxonox::Executor

Public Member Functions

 ExecutorMember (const FunctorMemberPtr< T > &functor, const std::string &name="")
 Constructor: Initializes the parent class and the pointer to the member-functor. More...
 
virtual ~ExecutorMember ()
 Destructor. More...
 
T * getObject () const
 Returns the object-pointer of the underlying FunctorMember. More...
 
MultiType operator() (T *object) const
 Calls the wrapped function with 0 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (T *object, const MultiType &arg1) const
 Calls the wrapped function with 1 argument and an object-pointer. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (T *object, const MultiType &arg1, const MultiType &arg2) const
 Calls the wrapped function with 2 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (T *object, const MultiType &arg1, const MultiType &arg2, const MultiType &arg3) const
 Calls the wrapped function with 3 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (T *object, const MultiType &arg1, const MultiType &arg2, const MultiType &arg3, const MultiType &arg4) const
 Calls the wrapped function with 4 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (T *object, const MultiType &arg1, const MultiType &arg2, const MultiType &arg3, const MultiType &arg4, const MultiType &arg5) const
 Calls the wrapped function with 5 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used. More...
 
MultiType parse (T *object, const std::string &arguments, int *error=nullptr, const std::string &delimiter=" ", bool bPrintError=false) const
 Overloads Executor::parse() with an additional object-pointer. More...
 
void setObject (T *object) const
 Changes the object-pointer of the underlying FunctorMember. More...
 
- Public Member Functions inherited from orxonox::Executor
 Executor (const FunctorPtr &functor, const std::string &name="")
 Constructor: Creates an executor. More...
 
 Executor (const Executor &other)
 Copy-constructor: Creates a new executor with the same values and a clone of the wrapped Functor. More...
 
virtual ~Executor ()=default
 
bool allDefaultValuesSet () const
 Returns true if the executor has a default value for each parameter of the wrapped function, so it can be called without passing additional arguments. More...
 
bool defaultValueSet (unsigned int index) const
 Returns true if the executor contains a default value for the parameter with given index (the first parameter has index 0). More...
 
int evaluateArguments (const SubString &arguments, MultiType arg[MAX_FUNCTOR_ARGUMENTS], int *error=nullptr, const std::string &delimiter=" ") const
 Converts the arguments in a SubString to the right type, so they can be used to execute the function without further conversions. More...
 
MultiType getDefaultValue (unsigned int index) const
 Returns the default value for a parameter with given index (the first parameter has index 0). More...
 
const FunctorPtrgetFunctor () const
 Returns the functor. More...
 
const std::string & getName () const
 Returns the name of the executor. More...
 
unsigned int getParamCount () const
 Returns the number of parameters of the wrapped function. More...
 
Functor::Type getType () const
 Returns the type of the wrapped function (static or member). More...
 
std::string getTypenameParam (unsigned int param) const
 Returns the name of the type of a parameter with given index (the first parameter has index 0). More...
 
std::string getTypenameReturnvalue () const
 Returns the name of the type of the return value. More...
 
bool hasReturnvalue () const
 Returns true if the wrapped function returns a value. More...
 
MultiType operator() () const
 Calls the wrapped function with 0 arguments. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (const MultiType &arg1) const
 Calls the wrapped function with 1 argument. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (const MultiType &arg1, const MultiType &arg2) const
 Calls the wrapped function with 2 arguments. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3) const
 Calls the wrapped function with 3 arguments. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3, const MultiType &arg4) const
 Calls the wrapped function with 4 arguments. If the function needs more arguments, the executor's default values are used. More...
 
MultiType operator() (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3, const MultiType &arg4, const MultiType &arg5) const
 Calls the wrapped function with 5 arguments. If the function needs more arguments, the executor's default values are used. More...
 
MultiType parse (const std::string &arguments, int *error=nullptr, const std::string &delimiter=" ", bool bPrintError=false) const
 Calls the wrapped function with arguments that are passed in a string. More...
 
MultiType parse (const SubString &arguments, int *error=nullptr, const std::string &delimiter=" ", bool bPrintError=false) const
 Calls the wrapped function with arguments that are passed as tokens in a SubString. More...
 
void setDefaultValue (unsigned int index, const MultiType &arg)
 Defines the default value for a parameter with given index (the first parameter has index 0). More...
 
void setDefaultValues (const MultiType &arg1)
 Defines the default value for the first parameter. More...
 
void setDefaultValues (const MultiType &arg1, const MultiType &arg2)
 Defines the default value for the first two parameters. More...
 
void setDefaultValues (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3)
 Defines the default value for the first three parameters. More...
 
void setDefaultValues (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3, const MultiType &arg4)
 Defines the default value for the first four parameters. More...
 
void setDefaultValues (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3, const MultiType &arg4, const MultiType &arg5)
 Defines the default value for the first five parameters. More...
 
void setFunctor (const FunctorPtr &functor)
 Changes the functor. More...
 
void setName (const std::string &name)
 Changes the name of the executor. More...
 

Protected Attributes

FunctorMemberPtr< T > functorMember_
 A pointer to the FunctorMember is stored separately to avoid casting when executing the function. More...
 
- Protected Attributes inherited from orxonox::Executor
MultiType defaultValue_ [MAX_FUNCTOR_ARGUMENTS]
 The default values, one for each parameter. More...
 
FunctorPtr functor_
 The underlying Functor that wraps a function. More...
 
std::string name_
 The name of the executor. More...
 

Detailed Description

template<class T>
class orxonox::ExecutorMember< T >

A child class of Executor, used for easier handling of non-static member-functions.

Overloads some functions that call the underlying FunctorMember and additionally pass an object-pointer that is needed for non-static member-functions.

Constructor & Destructor Documentation

template<class T >
orxonox::ExecutorMember< T >::ExecutorMember ( const FunctorMemberPtr< T > &  functor,
const std::string &  name = "" 
)
inline

Constructor: Initializes the parent class and the pointer to the member-functor.

template<class T >
virtual orxonox::ExecutorMember< T >::~ExecutorMember ( )
inlinevirtual

Destructor.

Member Function Documentation

template<class T >
T* orxonox::ExecutorMember< T >::getObject ( ) const
inline

Returns the object-pointer of the underlying FunctorMember.

template<class T >
MultiType orxonox::ExecutorMember< T >::operator() ( T *  object) const
inline

Calls the wrapped function with 0 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used.

template<class T >
MultiType orxonox::ExecutorMember< T >::operator() ( T *  object,
const MultiType arg1 
) const
inline

Calls the wrapped function with 1 argument and an object-pointer. If the function needs more arguments, the executor's default values are used.

template<class T >
MultiType orxonox::ExecutorMember< T >::operator() ( T *  object,
const MultiType arg1,
const MultiType arg2 
) const
inline

Calls the wrapped function with 2 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used.

template<class T >
MultiType orxonox::ExecutorMember< T >::operator() ( T *  object,
const MultiType arg1,
const MultiType arg2,
const MultiType arg3 
) const
inline

Calls the wrapped function with 3 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used.

template<class T >
MultiType orxonox::ExecutorMember< T >::operator() ( T *  object,
const MultiType arg1,
const MultiType arg2,
const MultiType arg3,
const MultiType arg4 
) const
inline

Calls the wrapped function with 4 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used.

template<class T >
MultiType orxonox::ExecutorMember< T >::operator() ( T *  object,
const MultiType arg1,
const MultiType arg2,
const MultiType arg3,
const MultiType arg4,
const MultiType arg5 
) const
inline

Calls the wrapped function with 5 arguments and an object-pointer. If the function needs more arguments, the executor's default values are used.

template<class T >
MultiType orxonox::ExecutorMember< T >::parse ( T *  object,
const std::string &  arguments,
int *  error = nullptr,
const std::string &  delimiter = " ",
bool  bPrintError = false 
) const
inline

Overloads Executor::parse() with an additional object-pointer.

template<class T >
void orxonox::ExecutorMember< T >::setObject ( T *  object) const
inline

Changes the object-pointer of the underlying FunctorMember.

Member Data Documentation

template<class T >
FunctorMemberPtr<T> orxonox::ExecutorMember< T >::functorMember_
protected

A pointer to the FunctorMember is stored separately to avoid casting when executing the function.


The documentation for this class was generated from the following file: