Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9740 in orxonox.OLD for branches/new_class_id/src


Ignore:
Timestamp:
Sep 16, 2006, 1:38:36 PM (18 years ago)
Author:
bensch
Message:

multiple generic inclusion of Executors, better and nicer interface for include

Location:
branches/new_class_id/src/lib
Files:
9 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/shell/shell_command.h

    r9728 r9740  
    99#include "base_object.h"
    1010
    11 #include "executor/executor.h"
    12 
    1311/// THIS IS USED TO LOAD CONSTANT AND STATIC FUNCTIONS EASILY.
    14 #include "executor/executor_functional.h"
    15 #define EXECUTOR_FUNCTIONAL_USE_CONST
    16 #include "executor/executor_functional.h"
    17 #define EXECUTOR_FUNCTIONAL_USE_STATIC
    18 #include "executor/executor_functional.h"
    19 
     12#include "executor/functor_member.h"
     13#include "executor/functor_const_member.h"
     14#include "executor/functor_static.h"
    2015
    2116#include "shell_completion_plugin.h"
  • branches/new_class_id/src/lib/util/Makefile.am

    r9727 r9740  
    88libORXexecutor_a_SOURCES = \
    99                executor/executor.cc \
    10                 executor/executor_functional.cc \
    1110                executor/executor_lua.cc
     11
     12#               executor/executor_functional.cc
    1213
    1314libORXlibutil_a_SOURCES = \
  • branches/new_class_id/src/lib/util/executor/executor_const_member.h

    r9739 r9740  
    3838
    3939/// We want to include __EXECUTOR_GENERIC_H again, with current settings.
    40 #ifdef __EXECUTOR_GENERIC_H
    41 #undef __EXECUTOR_GENERIC_H
     40
    4241#include "executor_generic.h"
    4342
  • branches/new_class_id/src/lib/util/executor/executor_generic.h

    r9737 r9740  
    2020
    2121
     22
    2223#ifndef __EXECUTOR_GENERIC_H_
    2324#define __EXECUTOR_GENERIC_H_
     25
    2426
    2527#include "executor.h"
     
    105107};
    106108
     109#endif /* __EXECUTOR_GENERIC_H_ */
     110
    107111
    108112///////////
     
    394398};
    395399
    396 #ifndef __EXECUTOR_GENERIC_H_
     400//#endif /* __EXECUTOR_GENERIC_H_ */
  • branches/new_class_id/src/lib/util/executor/executor_member.h

    r9737 r9740  
    2323
    2424/// Define all Constructs, that define an Executor.
    25 
    2625//! The Name to be attached to the functional (for normal, static, and const modes)
    2726#define __EXECUTOR_FUNCTIONAL_NAME(ParamCount)   Executor##ParamCount##Params
    28 
    2927//! if Functional is constant calling
    3028#define __EXECUTOR_FUNCTIONAL_CONST
     
    3432#define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER   T::*functionPointer
    3533//! The Type of Function
    36 #define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE       Executor<CallType, BaseClass>::FunctionDefault
     34#define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE       Executor<CallType, BaseClass>::FunctionMember
    3735
    3836
    3937/// We want to include __EXECUTOR_GENERIC_H again, with current settings.
    40 #ifdef __EXECUTOR_GENERIC_H
    41 #undef __EXECUTOR_GENERIC_H
    4238#include "executor_generic.h"
    4339
     40
    4441#undef __EXECUTOR_FUNCTIONAL_NAME
    45 
    4642#undef __EXECUTOR_FUNCTIONAL_CONST
    4743#undef __EXECUTOR_FUNCTIONAL_FUNCTION_EXEC
  • branches/new_class_id/src/lib/util/executor/executor_static.h

    r9739 r9740  
    3838
    3939/// We want to include __EXECUTOR_GENERIC_H again, with current settings.
    40 #ifdef __EXECUTOR_GENERIC_H
    41 #undef __EXECUTOR_GENERIC_H
    4240#include "executor_generic.h"
    4341
  • branches/new_class_id/src/lib/util/executor/functor_const_member.h

    r9739 r9740  
    11/*!
    2  * @file executor_functional.h
    3  * Definition of an Executor
     2 * @file functor_member.h
     3 * Definition of an Functor
    44 */
    55
     
    2020
    2121
    22 #ifndef __FUNCTOR_MEMBER_H_
    23 #define __FUNCTOR_MEMBER_H_
     22#ifndef __FUNCTOR_CONST_MEMBER_H_
     23#define __FUNCTOR_CONST_MEMBER_H_
    2424
    25 #include "executor_member.h"
     25#include "executor_const_member.h"
    2626#include "substring.h"
    2727
    28 // // // // // // // // // // // // //
    29 //// EXTENSION TO HIDE CONSTRUCT /////
    30 // // // // // // // // // // // // //
    31 /**
    32  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    33  */
    34 #define EXECUTOR_FUNCTIONAL_CREATOR0() \
    35 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    36 { \
    37   return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, const SubString>(functionPointer); \
    38 }
     28#define FUNCTOR_CALL_TYPE const SubString
    3929
    40 /**
    41  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    42  * @param type0 for internal usage: the first Argument
    43  */
    44 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \
    45 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \
    46 { \
    47   return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, const SubString, type0>(functionPointer); \
    48 }
     30/// Define all Constructs, that define an Executor.
    4931
    50 /**
    51  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    52  * @param type0 for internal usage: the first Argument
    53  * @param type1 for internal usage: the second Argument
    54  */
    55 #define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \
    56 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \
    57 { \
    58   return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, const SubString, type0, type1>(functionPointer); \
    59 }
     32//! The Name to be attached to the functional (for normal, static, and const modes)
     33#define __EXECUTOR_FUNCTIONAL_NAME(ParamCount)   Executor##ParamCount##Params_const
     34//! if Functional is constant calling
     35#define __EXECUTOR_FUNCTIONAL_CONST              const
     36//! The Function-Pointer, and how to save it internally.
     37#define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER   T::*functionPointer
     38//! The Type of Function
     39#define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE       Executor<CallType, BaseClass>::FunctionMember
    6040
    61 /**
    62  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    63  * @param type0 for internal usage: the first Argument
    64  * @param type1 for internal usage: the second Argument
    65  * @param type2 for internal usage: the third Argument
    66  */
    67 #define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \
    68 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \
    69 { \
    70   return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, const SubString, type0, type1, type2>(functionPointer); \
    71 }
     41/// Now we include The generic Functor, that generate the functions.
     42#include "functor_generic.h"
    7243
    73 /**
    74  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    75  * @param type0 for internal usage: the first Argument
    76  * @param type1 for internal usage: the second Argument
    77  * @param type2 for internal usage: the third Argument
    78  * @param type3 for internal usage: the fourth Argument
    79  */
    80 #define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \
    81 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \
    82 { \
    83   return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, const SubString, type0, type1, type2, type3>(functionPointer); \
    84 }
    85 
    86 /**
    87  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    88  * @param type0 for internal usage: the first Argument
    89  * @param type1 for internal usage: the second Argument
    90  * @param type2 for internal usage: the third Argument
    91  * @param type3 for internal usage: the fourth Argument
    92  * @param type4 for internal usage: the fifth Argument
    93  */
    94 #define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \
    95 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \
    96 { \
    97     return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, const SubString, type0, type1, type2, type3, type4>(functionPointer); \
    98 }
    99 
    100 /**
    101  * Creates the FunctionCallers imediately
    102  */
    103 #define FUNCTOR_LIST(x) EXECUTOR_FUNCTIONAL_CREATOR ## x
    104 #include "functor_list.h"
    105 #undef FUNCTOR_LIST
     44#undef __EXECUTOR_FUNCTIONAL_NAME
     45#undef __EXECUTOR_FUNCTIONAL_CONST
     46#undef __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER
     47#undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE
    10648
    10749
    108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
     50
     51#endif /* __FUNCTOR_CONST_MEMBER_H_ */
  • branches/new_class_id/src/lib/util/executor/functor_generic.h

    r9739 r9740  
    11/*!
    2  * @file executor_functional.h
     2 * @file functor_generic.h
    33 * Definition of an Executor
    44 */
     
    1919*/
    2020
    21 
    22 #ifndef __FUNCTOR_MEMBER_H_
    23 #define __FUNCTOR_MEMBER_H_
    24 
    25 #include "executor_member.h"
    26 #include "substring.h"
    27 
    2821// // // // // // // // // // // // //
    2922//// EXTENSION TO HIDE CONSTRUCT /////
     
    3124/**
    3225 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     26 * @param CallType the Type of Executor to generate
    3327 */
    34 #define EXECUTOR_FUNCTIONAL_CREATOR0() \
    35 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
     28#define EXECUTOR_FUNCTIONAL_CREATOR0(CallType) \
     29template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    3630{ \
    37   return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, const SubString>(functionPointer); \
     31  return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, CallType>(functionPointer); \
    3832}
    3933
    4034/**
    4135 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     36 * @param CallType the Type of Executor to generate
    4237 * @param type0 for internal usage: the first Argument
    4338 */
    44 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \
    45 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \
     39#define EXECUTOR_FUNCTIONAL_CREATOR1(CallType, type0) \
     40template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \
    4641{ \
    47   return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, const SubString, type0>(functionPointer); \
     42  return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, CallType, type0>(functionPointer); \
    4843}
    4944
    5045/**
    5146 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     47 * @param CallType the Type of Executor to generate
    5248 * @param type0 for internal usage: the first Argument
    5349 * @param type1 for internal usage: the second Argument
    5450 */
    55 #define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \
    56 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \
     51#define EXECUTOR_FUNCTIONAL_CREATOR2(CallType, type0, type1) \
     52template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \
    5753{ \
    58   return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, const SubString, type0, type1>(functionPointer); \
     54  return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, CallType, type0, type1>(functionPointer); \
    5955}
    6056
    6157/**
    6258 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     59 * @param CallType the Type of Executor to generate
    6360 * @param type0 for internal usage: the first Argument
    6461 * @param type1 for internal usage: the second Argument
    6562 * @param type2 for internal usage: the third Argument
    6663 */
    67 #define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \
    68 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \
     64#define EXECUTOR_FUNCTIONAL_CREATOR3(CallType, type0, type1, type2) \
     65template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \
    6966{ \
    70   return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, const SubString, type0, type1, type2>(functionPointer); \
     67  return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, CallType, type0, type1, type2>(functionPointer); \
    7168}
    7269
    7370/**
    7471 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     72 * @param CallType the Type of Executor to generate
    7573 * @param type0 for internal usage: the first Argument
    7674 * @param type1 for internal usage: the second Argument
     
    7876 * @param type3 for internal usage: the fourth Argument
    7977 */
    80 #define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \
    81 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \
     78#define EXECUTOR_FUNCTIONAL_CREATOR4(CallType, type0, type1, type2, type3) \
     79template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \
    8280{ \
    83   return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, const SubString, type0, type1, type2, type3>(functionPointer); \
     81  return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, CallType, type0, type1, type2, type3>(functionPointer); \
    8482}
    8583
    8684/**
    8785 * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
     86 * @param CallType the Type of Executor to generate
    8887 * @param type0 for internal usage: the first Argument
    8988 * @param type1 for internal usage: the second Argument
     
    9291 * @param type4 for internal usage: the fifth Argument
    9392 */
    94 #define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \
    95 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \
     93#define EXECUTOR_FUNCTIONAL_CREATOR5(CallType, type0, type1, type2, type3, type4) \
     94template<class T> Executor<CallType>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \
    9695{ \
    97     return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, const SubString, type0, type1, type2, type3, type4>(functionPointer); \
     96    return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, CallType, type0, type1, type2, type3, type4>(functionPointer); \
    9897}
    9998
     
    105104#undef FUNCTOR_LIST
    106105
    107 
    108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
  • branches/new_class_id/src/lib/util/executor/functor_list.h

    r9732 r9740  
    1717
    1818#ifdef FUNCTOR_LIST
    19   FUNCTOR_LIST(0)();
     19  FUNCTOR_LIST(0)(FUNCTOR_CALL_TYPE);
    2020  //! makes functions with one string
    21   FUNCTOR_LIST(1)(const std::string&);
     21  FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, const std::string&);
    2222  //! makes functions with two strings
    23   FUNCTOR_LIST(2)(const std::string&, const std::string&);
     23  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, const std::string&);
    2424  //! makes functions with three strings
    25   FUNCTOR_LIST(3)(const std::string&, const std::string&, const std::string&);
     25  FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, const std::string&, const std::string&, const std::string&);
    2626  //! makes functions with four strings
    27   FUNCTOR_LIST(4)(const std::string&, const std::string&, const std::string&, const std::string&);
     27  FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, const std::string&, const std::string&, const std::string&, const std::string&);
    2828
    2929
    3030  //! makes functions with one bool
    31   FUNCTOR_LIST(1)(bool);
     31  FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, bool);
    3232
    3333  //! makes functions with one int
    34   FUNCTOR_LIST(1)(int);
     34  FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, int);
    3535  //! makes functions with two ints
    36   FUNCTOR_LIST(2)(int, int);
     36  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, int, int);
    3737  //! makes functions with three ints
    38   FUNCTOR_LIST(3)(int, int, int);
     38  FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, int, int, int);
    3939  //! makes functions with four ints
    40   FUNCTOR_LIST(4)(int, int, int, int);
     40  FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, int, int, int, int);
    4141
    4242
    4343  //! makes functions with one unsigned int
    44   FUNCTOR_LIST(1)(unsigned int);
     44  FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, unsigned int);
    4545  //! makes functions with two unsigned ints
    46   FUNCTOR_LIST(2)(unsigned int, unsigned int);
     46  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, unsigned int, unsigned int);
    4747  //! makes functions with three unsigned ints
    48   FUNCTOR_LIST(3)(unsigned int, unsigned int, unsigned int);
     48  FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, unsigned int, unsigned int, unsigned int);
    4949  //! makes functions with four unsigned ints
    50   FUNCTOR_LIST(4)(unsigned int, unsigned int, unsigned int, unsigned int);
     50  FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, unsigned int, unsigned int, unsigned int, unsigned int);
    5151
    5252  //! makes functions with one float
    53   FUNCTOR_LIST(1)(float);
     53  FUNCTOR_LIST(1)(FUNCTOR_CALL_TYPE, float);
    5454  //! makes functions with two floats
    55   FUNCTOR_LIST(2)(float, float);
     55  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, float, float);
    5656  //! makes functions with three floats
    57   FUNCTOR_LIST(3)(float, float, float);
     57  FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, float, float, float);
    5858  //! makes functions with four floats
    59   FUNCTOR_LIST(4)(float, float, float, float);
     59  FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, float, float, float, float);
    6060  //! makes functions with four floats
    61   FUNCTOR_LIST(5)(float, float, float, float, float);
     61  FUNCTOR_LIST(5)(FUNCTOR_CALL_TYPE, float, float, float, float, float);
    6262
    6363  //! mixed values:
    64   FUNCTOR_LIST(2)(const std::string&, int);
    65   FUNCTOR_LIST(2)(const std::string&, float);
    66   FUNCTOR_LIST(2)(unsigned int, long);
    67   FUNCTOR_LIST(2)(const std::string&, unsigned int);
     64  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, int);
     65  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, float);
     66  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, unsigned int, long);
     67  FUNCTOR_LIST(2)(FUNCTOR_CALL_TYPE, const std::string&, unsigned int);
    6868
    69   FUNCTOR_LIST(3)(const std::string&, float, unsigned int);
    70   FUNCTOR_LIST(4)(const std::string&, float, unsigned int, unsigned int);
    71   FUNCTOR_LIST(3)(const std::string&, int, unsigned int);
    72   FUNCTOR_LIST(3)(const std::string&, unsigned int, unsigned int);
     69  FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, const std::string&, float, unsigned int);
     70  FUNCTOR_LIST(4)(FUNCTOR_CALL_TYPE, const std::string&, float, unsigned int, unsigned int);
     71  FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, const std::string&, int, unsigned int);
     72  FUNCTOR_LIST(3)(FUNCTOR_CALL_TYPE, const std::string&, unsigned int, unsigned int);
    7373
    74   FUNCTOR_LIST(5)(float, float, float, float, const std::string&);
     74  FUNCTOR_LIST(5)(FUNCTOR_CALL_TYPE, float, float, float, float, const std::string&);
    7575
    7676#endif /* FUNCTOR_LIST */
  • branches/new_class_id/src/lib/util/executor/functor_member.h

    r9739 r9740  
    11/*!
    2  * @file executor_functional.h
    3  * Definition of an Executor
     2 * @file functor_member.h
     3 * Definition of an Functor
    44 */
    55
     
    2626#include "substring.h"
    2727
    28 // // // // // // // // // // // // //
    29 //// EXTENSION TO HIDE CONSTRUCT /////
    30 // // // // // // // // // // // // //
    31 /**
    32  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    33  */
    34 #define EXECUTOR_FUNCTIONAL_CREATOR0() \
    35 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    36 { \
    37   return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, const SubString>(functionPointer); \
    38 }
     28#define FUNCTOR_CALL_TYPE const SubString
    3929
    40 /**
    41  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    42  * @param type0 for internal usage: the first Argument
    43  */
    44 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \
    45 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \
    46 { \
    47   return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, const SubString, type0>(functionPointer); \
    48 }
     30/// Define all Constructs, that define an Executor.
    4931
    50 /**
    51  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    52  * @param type0 for internal usage: the first Argument
    53  * @param type1 for internal usage: the second Argument
    54  */
    55 #define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \
    56 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \
    57 { \
    58   return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, const SubString, type0, type1>(functionPointer); \
    59 }
    60 
    61 /**
    62  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    63  * @param type0 for internal usage: the first Argument
    64  * @param type1 for internal usage: the second Argument
    65  * @param type2 for internal usage: the third Argument
    66  */
    67 #define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \
    68 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \
    69 { \
    70   return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, const SubString, type0, type1, type2>(functionPointer); \
    71 }
    72 
    73 /**
    74  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    75  * @param type0 for internal usage: the first Argument
    76  * @param type1 for internal usage: the second Argument
    77  * @param type2 for internal usage: the third Argument
    78  * @param type3 for internal usage: the fourth Argument
    79  */
    80 #define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \
    81 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \
    82 { \
    83   return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, const SubString, type0, type1, type2, type3>(functionPointer); \
    84 }
    85 
    86 /**
    87  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    88  * @param type0 for internal usage: the first Argument
    89  * @param type1 for internal usage: the second Argument
    90  * @param type2 for internal usage: the third Argument
    91  * @param type3 for internal usage: the fourth Argument
    92  * @param type4 for internal usage: the fifth Argument
    93  */
    94 #define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \
    95 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \
    96 { \
    97     return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, const SubString, type0, type1, type2, type3, type4>(functionPointer); \
    98 }
    99 
    100 /**
    101  * Creates the FunctionCallers imediately
    102  */
    103 #define FUNCTOR_LIST(x) EXECUTOR_FUNCTIONAL_CREATOR ## x
    104 #include "functor_list.h"
    105 #undef FUNCTOR_LIST
     32//! The Name to be attached to the functional (for normal, static, and const modes)
     33#define __EXECUTOR_FUNCTIONAL_NAME(ParamCount)   Executor##ParamCount##Params
     34//! if Functional is constant calling
     35#define __EXECUTOR_FUNCTIONAL_CONST
     36//! The Function-Pointer, and how to save it internally.
     37#define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER   T::*functionPointer
     38//! The Type of Function
     39#define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE       Executor<CallType, BaseClass>::FunctionMember
    10640
    10741
    108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
     42/// Now we include The generic Functor, that generate the functions.
     43#include "functor_generic.h"
     44
     45
     46#undef __EXECUTOR_FUNCTIONAL_NAME
     47#undef __EXECUTOR_FUNCTIONAL_CONST
     48#undef __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER
     49#undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE
     50
     51
     52
     53#endif /* __FUNCTOR_MEMBER_H_ */
  • branches/new_class_id/src/lib/util/executor/functor_static.h

    r9739 r9740  
    11/*!
    2  * @file executor_functional.h
    3  * Definition of an Executor
     2 * @file functor_member.h
     3 * Definition of an Functor
    44 */
    55
     
    2020
    2121
    22 #ifndef __FUNCTOR_MEMBER_H_
    23 #define __FUNCTOR_MEMBER_H_
     22#ifndef __FUNCTOR_STATIC_H_
     23#define __FUNCTOR_STATIC_H_
    2424
    25 #include "executor_member.h"
     25#include "executor_static.h"
    2626#include "substring.h"
    2727
    28 // // // // // // // // // // // // //
    29 //// EXTENSION TO HIDE CONSTRUCT /////
    30 // // // // // // // // // // // // //
    31 /**
    32  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    33  */
    34 #define EXECUTOR_FUNCTIONAL_CREATOR0() \
    35 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    36 { \
    37   return new __EXECUTOR_FUNCTIONAL_NAME(0)<T, const SubString>(functionPointer); \
    38 }
     28#define FUNCTOR_CALL_TYPE const SubString
    3929
    40 /**
    41  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    42  * @param type0 for internal usage: the first Argument
    43  */
    44 #define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \
    45 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST) \
    46 { \
    47   return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, const SubString, type0>(functionPointer); \
    48 }
     30/// Define all Constructs, that define an Executor.
    4931
    50 /**
    51  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    52  * @param type0 for internal usage: the first Argument
    53  * @param type1 for internal usage: the second Argument
    54  */
    55 #define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \
    56 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST) \
    57 { \
    58   return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, const SubString, type0, type1>(functionPointer); \
    59 }
     32//! The Name to be attached to the functional (for normal, static, and const modes)
     33#define __EXECUTOR_FUNCTIONAL_NAME(ParamCount)   Executor##ParamCount##Params_static
     34//! if Functional is constant calling
     35#define __EXECUTOR_FUNCTIONAL_CONST
     36//! The Function-Pointer, and how to save it internally.
     37#define __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER   *functionPointer
     38//! The Type of Function
     39#define __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE       Executor<CallType, BaseClass>::FunctionStatic
    6040
    61 /**
    62  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    63  * @param type0 for internal usage: the first Argument
    64  * @param type1 for internal usage: the second Argument
    65  * @param type2 for internal usage: the third Argument
    66  */
    67 #define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \
    68 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST) \
    69 { \
    70   return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, const SubString, type0, type1, type2>(functionPointer); \
    71 }
    72 
    73 /**
    74  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    75  * @param type0 for internal usage: the first Argument
    76  * @param type1 for internal usage: the second Argument
    77  * @param type2 for internal usage: the third Argument
    78  * @param type3 for internal usage: the fourth Argument
    79  */
    80 #define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \
    81 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST) \
    82 { \
    83   return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, const SubString, type0, type1, type2, type3>(functionPointer); \
    84 }
    85 
    86 /**
    87  * @brief enables us to easily retrieve an Executor of Class T with modular Argument-count, (without thinking about args at all)
    88  * @param type0 for internal usage: the first Argument
    89  * @param type1 for internal usage: the second Argument
    90  * @param type2 for internal usage: the third Argument
    91  * @param type3 for internal usage: the fourth Argument
    92  * @param type4 for internal usage: the fifth Argument
    93  */
    94 #define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \
    95 template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST) \
    96 { \
    97     return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, const SubString, type0, type1, type2, type3, type4>(functionPointer); \
    98 }
    99 
    100 /**
    101  * Creates the FunctionCallers imediately
    102  */
    103 #define FUNCTOR_LIST(x) EXECUTOR_FUNCTIONAL_CREATOR ## x
    104 #include "functor_list.h"
    105 #undef FUNCTOR_LIST
     41/// Now we include The generic Functor, that generate the functions.
     42#include "functor_generic.h"
    10643
    10744
    108 #undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
     45#undef __EXECUTOR_FUNCTIONAL_NAME
     46#undef __EXECUTOR_FUNCTIONAL_CONST
     47#undef __EXECUTOR_FUNCTIONAL_FUNCTION_POINTER
     48#undef __EXECUTOR_FUNCTIONAL_FUNCTIONTYPE
     49
     50
     51
     52#endif /* __FUNCTOR_STATIC_H_ */
  • branches/new_class_id/src/lib/util/loading/load_param.h

    r9728 r9740  
    2424#include "base_object.h"
    2525
    26 #include "executor/executor.h"
    27 #include "executor/executor_functional.h"
     26#include "executor/executor_member.h"
     27#include "executor/functor_member.h"
    2828
    2929#include "parser/tinyxml/tinyxml.h"
Note: See TracChangeset for help on using the changeset viewer.