Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/util/executor/functor_member.h @ 9739

Last change on this file since 9739 was 9739, checked in by bensch, 18 years ago

functor_definitors

File size: 4.4 KB
Line 
1/*!
2 * @file executor_functional.h
3 * Definition of an Executor
4 */
5
6/*
7   orxonox - the future of 3D-vertical-scrollers
8
9   Copyright (C) 2004 orx
10
11   This program is free software; you can redistribute it and/or modify
12   it under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2, or (at your option)
14   any later version.
15
16### File Specific:
17   main-programmer: Benjamin Grauer
18   co-programmer: ...
19*/
20
21
22#ifndef __FUNCTOR_MEMBER_H_
23#define __FUNCTOR_MEMBER_H_
24
25#include "executor_member.h"
26#include "substring.h"
27
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() \
35template<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}
39
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) \
45template<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}
49
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) \
56template<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) \
68template<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) \
81template<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) \
95template<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
106
107
108#undef __EXECUTOR_FUNCTIONAL_NOT_INCLUDE_THIS
Note: See TracBrowser for help on using the repository browser.