[5133] | 1 | /* |
---|
| 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | */ |
---|
| 11 | |
---|
| 12 | /*! |
---|
| 13 | * @file functors_list.h |
---|
| 14 | * all the Different types of Functions one can include |
---|
| 15 | */ |
---|
| 16 | |
---|
[5135] | 17 | /** |
---|
| 18 | useable FunctionParameters are: |
---|
| 19 | l_INT: int |
---|
| 20 | l_LONG: long |
---|
| 21 | l_SHORT: short |
---|
| 22 | l_FLOAT: float |
---|
| 23 | l_STRING: const char* |
---|
| 24 | l_XML_ELEM: TiXmlElement* |
---|
| 25 | */ |
---|
[5133] | 26 | |
---|
[5135] | 27 | #ifndef __FUNCTOR_PARAMETERS__ |
---|
| 28 | #define __FUNCTOR_PARAMETERS__ |
---|
| 29 | |
---|
[5142] | 30 | //! defines the maximum count of arguments function pointers might have |
---|
| 31 | #define FUNCTOR_MAX_ARGUMENTS 5 |
---|
[5634] | 32 | #include "multi_type.h" |
---|
[5142] | 33 | |
---|
[5135] | 34 | #define l_BOOL_TYPE bool //!< The type of an BOOL |
---|
| 35 | #define l_BOOL_FUNC isBool //!< The function to call to parse BOOL |
---|
| 36 | #define l_BOOL_NAME "bool" //!< The name of an BOOL |
---|
[5634] | 37 | #define l_BOOL_PARAM MT_BOOL //!< the type of the parameter BOOL |
---|
[5135] | 38 | #define l_BOOL_DEFAULT false //!< a default Value for an BOOL |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | #define l_INT_TYPE int //!< The type of an INT |
---|
| 42 | #define l_INT_FUNC isInt //!< The function to call to parse INT |
---|
| 43 | #define l_INT_NAME "int" //!< The name of an INT |
---|
[5634] | 44 | #define l_INT_PARAM MT_INT //!< the type of the parameter INT |
---|
[5135] | 45 | #define l_INT_DEFAULT 0 //!< a default Value for an INT |
---|
| 46 | |
---|
| 47 | #define l_UINT_TYPE unsigned int //!< The type of an UINT |
---|
| 48 | #define l_UINT_FUNC isInt //!< The function to call to parse UINT |
---|
| 49 | #define l_UINT_NAME "unsigned int" //!< The name of an UINT |
---|
[5634] | 50 | #define l_UINT_PARAM MT_INT //!< the type of the parameter UINT |
---|
[5135] | 51 | #define l_UINT_DEFAULT 0 //!< a default Value for an UINT |
---|
| 52 | |
---|
| 53 | #define l_LONG_TYPE long //!< The type of a LONG |
---|
| 54 | #define l_LONG_FUNC isInt //!< The function to parse a LONG |
---|
| 55 | #define l_LONG_NAME "long" //!< The name of a LONG |
---|
[5634] | 56 | #define l_LONG_PARAM MT_INT //!< the type of the parameter LONG |
---|
[5135] | 57 | #define l_LONG_DEFAULT 0 //!< a default Value for a LONG |
---|
| 58 | |
---|
| 59 | // #define l_SHORT_TYPE short //!< The type of a SHORT |
---|
| 60 | // #define l_SHORT_FUNC atoi //!< The function to parse a SHORT |
---|
| 61 | // #define l_SHORT_NAME "short" //!< The name of a SHORT |
---|
| 62 | //#define l_SHORT_PARAM ParameterShort //!< the type of the parameter SHORT |
---|
| 63 | // #define l_SHORT_DEFAULT 0 //!< a default Value for a SHORT |
---|
| 64 | |
---|
| 65 | #define l_FLOAT_TYPE float //!< The type of a FLOAT |
---|
| 66 | #define l_FLOAT_FUNC isFloat //!< The function to parse a FLOAT |
---|
| 67 | #define l_FLOAT_NAME "float" //!< The name of a FLOAT |
---|
[5634] | 68 | #define l_FLOAT_PARAM MT_FLOAT //!< the type of the parameter FLOAT |
---|
[5135] | 69 | #define l_FLOAT_DEFAULT 0.0 //!< a default Value for a FLOAT |
---|
| 70 | |
---|
| 71 | //#define l_VECTOR_TYPE const Vector& //!< The type of a VECTOR |
---|
| 72 | //#define l_VECTOR_FUNC isVector //!< The function to parse a VECTOR |
---|
| 73 | //#define l_VECTOR_NAME "Vector[x/y/z]" //!< The name of a VECTOR |
---|
| 74 | //#define l_VECTOR_DEFAULT Vector(0,0,0) //!< Default value for a VECTOR |
---|
| 75 | |
---|
| 76 | #define l_STRING_TYPE const char* //!< The type of a STRING |
---|
| 77 | #define l_STRING_FUNC isString //!< The function to parse a STRING |
---|
| 78 | #define l_STRING_NAME "string" //!< The name of a STRING |
---|
[5634] | 79 | #define l_STRING_PARAM MT_STRING //!< the type of the parameter STRING |
---|
[5135] | 80 | #define l_STRING_DEFAULT "" //!< a default Value for an STRING |
---|
| 81 | |
---|
| 82 | #define l_XML_ELEM_TYPE const TiXmlElement* //!< The type of an XML_ELEM |
---|
| 83 | #define l_XML_ELEM_FUNC //!< The function to parse an XML_ELEM |
---|
| 84 | #define l_XML_ELEM_NAME "XML" //!< The name of an XML_ELEM |
---|
[5155] | 85 | //#define l_XML_ELEM_PARAM Parameter //!< the type of the parameter XML_ELEM |
---|
[5135] | 86 | #define l_XML_ELEM_DEFAULT NULL //!< The dafault Value for an XML_ELEM |
---|
| 87 | |
---|
| 88 | #endif /* __FUNCTOR_PARAMETERS__ */ |
---|
| 89 | |
---|
| 90 | |
---|
| 91 | #ifdef FUNCTOR_LIST |
---|
[5391] | 92 | |
---|
[5153] | 93 | FUNCTOR_LIST(0)(); |
---|
[5135] | 94 | //! makes functions with one string |
---|
[5133] | 95 | FUNCTOR_LIST(1)(l_STRING); |
---|
[5135] | 96 | //! makes functions with two strings |
---|
[5133] | 97 | FUNCTOR_LIST(2)(l_STRING, l_STRING); |
---|
[5135] | 98 | //! makes functions with three strings |
---|
[5133] | 99 | FUNCTOR_LIST(3)(l_STRING, l_STRING, l_STRING); |
---|
[5135] | 100 | //! makes functions with four strings |
---|
[5133] | 101 | FUNCTOR_LIST(4)(l_STRING, l_STRING, l_STRING, l_STRING); |
---|
| 102 | |
---|
[5135] | 103 | //! makes functions with one bool |
---|
[5133] | 104 | FUNCTOR_LIST(1)(l_BOOL); |
---|
| 105 | |
---|
[5135] | 106 | //! makes functions with one int |
---|
[5133] | 107 | FUNCTOR_LIST(1)(l_INT); |
---|
[5135] | 108 | //! makes functions with two ints |
---|
[5133] | 109 | FUNCTOR_LIST(2)(l_INT, l_INT); |
---|
[5135] | 110 | //! makes functions with three ints |
---|
[5133] | 111 | FUNCTOR_LIST(3)(l_INT, l_INT, l_INT); |
---|
[5135] | 112 | //! makes functions with four ints |
---|
[5133] | 113 | FUNCTOR_LIST(4)(l_INT, l_INT, l_INT, l_INT); |
---|
| 114 | |
---|
| 115 | |
---|
[5135] | 116 | //! makes functions with one unsigned int |
---|
[5133] | 117 | FUNCTOR_LIST(1)(l_UINT); |
---|
[5135] | 118 | //! makes functions with two unsigned ints |
---|
[5133] | 119 | FUNCTOR_LIST(2)(l_UINT, l_UINT); |
---|
[5135] | 120 | //! makes functions with three unsigned ints |
---|
[5133] | 121 | FUNCTOR_LIST(3)(l_UINT, l_UINT, l_UINT); |
---|
[5135] | 122 | //! makes functions with four unsigned ints |
---|
[5133] | 123 | FUNCTOR_LIST(4)(l_UINT, l_UINT, l_UINT, l_UINT); |
---|
| 124 | |
---|
[5135] | 125 | //! makes functions with one float |
---|
[5133] | 126 | FUNCTOR_LIST(1)(l_FLOAT); |
---|
[5135] | 127 | //! makes functions with two floats |
---|
[5133] | 128 | FUNCTOR_LIST(2)(l_FLOAT, l_FLOAT); |
---|
[5135] | 129 | //! makes functions with three floats |
---|
[5133] | 130 | FUNCTOR_LIST(3)(l_FLOAT, l_FLOAT, l_FLOAT); |
---|
[5135] | 131 | //! makes functions with four floats |
---|
[5133] | 132 | FUNCTOR_LIST(4)(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT); |
---|
[5135] | 133 | //! makes functions with four floats |
---|
[5133] | 134 | FUNCTOR_LIST(5)(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT); |
---|
| 135 | |
---|
| 136 | //! mixed values: |
---|
| 137 | FUNCTOR_LIST(2)(l_STRING, l_FLOAT); |
---|
[5329] | 138 | FUNCTOR_LIST(2)(l_UINT, l_LONG); |
---|
[5331] | 139 | FUNCTOR_LIST(2)(l_STRING, l_UINT); |
---|
[5391] | 140 | |
---|
[5995] | 141 | FUNCTOR_LIST(3)(l_STRING, l_FLOAT, l_UINT); |
---|
[5391] | 142 | |
---|
[5995] | 143 | |
---|
[5135] | 144 | #endif /* FUNCTOR_LIST */ |
---|