00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _MacroOps_incl_
00020 #define _MacroOps_incl_
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #define FUNCALL_1(FUN,A1,SEP) FUN ( A1##1 )
00033 #define FUNCALL_2(FUN,A1,SEP) FUNCALL_1(FUN,A1,SEP) SEP FUN ( A1##2 )
00034 #define FUNCALL_3(FUN,A1,SEP) FUNCALL_2(FUN,A1,SEP) SEP FUN ( A1##3 )
00035 #define FUNCALL_4(FUN,A1,SEP) FUNCALL_3(FUN,A1,SEP) SEP FUN ( A1##4 )
00036 #define FUNCALL_5(FUN,A1,SEP) FUNCALL_4(FUN,A1,SEP) SEP FUN ( A1##5 )
00037 #define FUNCALL_6(FUN,A1,SEP) FUNCALL_5(FUN,A1,SEP) SEP FUN ( A1##6 )
00038 #define FUNCALL_7(FUN,A1,SEP) FUNCALL_6(FUN,A1,SEP) SEP FUN ( A1##7 )
00039 #define FUNCALL_8(FUN,A1,SEP) FUNCALL_7(FUN,A1,SEP) SEP FUN ( A1##8 )
00040 #define FUNCALL_9(FUN,A1,SEP) FUNCALL_8(FUN,A1,SEP) SEP FUN ( A1##9 )
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #define CHAINBUILD2_1(A1,A2,POST) A1##1 A2##1 POST
00056 #define CHAINBUILD2_2(A1,A2,POST) CHAINBUILD2_1(A1,A2,POST) A1##2 A2##2 POST
00057 #define CHAINBUILD2_3(A1,A2,POST) CHAINBUILD2_2(A1,A2,POST) A1##3 A2##3 POST
00058 #define CHAINBUILD2_4(A1,A2,POST) CHAINBUILD2_3(A1,A2,POST) A1##4 A2##4 POST
00059 #define CHAINBUILD2_5(A1,A2,POST) CHAINBUILD2_4(A1,A2,POST) A1##5 A2##5 POST
00060 #define CHAINBUILD2_6(A1,A2,POST) CHAINBUILD2_5(A1,A2,POST) A1##6 A2##6 POST
00061 #define CHAINBUILD2_7(A1,A2,POST) CHAINBUILD2_6(A1,A2,POST) A1##7 A2##7 POST
00062 #define CHAINBUILD2_8(A1,A2,POST) CHAINBUILD2_7(A1,A2,POST) A1##8 A2##8 POST
00063 #define CHAINBUILD2_9(A1,A2,POST) CHAINBUILD2_8(A1,A2,POST) A1##9 A2##9 POST
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 #define LISTBUILD_1(PRE, ARG) PRE ARG##1
00086 #define LISTBUILD_2(PRE, ARG) LISTBUILD_1(PRE, ARG), PRE ARG##2
00087 #define LISTBUILD_3(PRE, ARG) LISTBUILD_2(PRE, ARG), PRE ARG##3
00088 #define LISTBUILD_4(PRE, ARG) LISTBUILD_3(PRE, ARG), PRE ARG##4
00089 #define LISTBUILD_5(PRE, ARG) LISTBUILD_4(PRE, ARG), PRE ARG##5
00090 #define LISTBUILD_6(PRE, ARG) LISTBUILD_5(PRE, ARG), PRE ARG##6
00091 #define LISTBUILD_7(PRE, ARG) LISTBUILD_6(PRE, ARG), PRE ARG##7
00092 #define LISTBUILD_8(PRE, ARG) LISTBUILD_7(PRE, ARG), PRE ARG##8
00093 #define LISTBUILD_9(PRE, ARG) LISTBUILD_8(PRE, ARG), PRE ARG##9
00094
00095
00096 #define FLISTBUILD_1(PR, AR, PO) PR AR##1 PO
00097 #define FLISTBUILD_2(PR, AR, PO) FLISTBUILD_1(PR, AR, PO), PR AR##2 PO
00098 #define FLISTBUILD_3(PR, AR, PO) FLISTBUILD_2(PR, AR, PO), PR AR##3 PO
00099 #define FLISTBUILD_4(PR, AR, PO) FLISTBUILD_3(PR, AR, PO), PR AR##4 PO
00100 #define FLISTBUILD_5(PR, AR, PO) FLISTBUILD_4(PR, AR, PO), PR AR##5 PO
00101 #define FLISTBUILD_6(PR, AR, PO) FLISTBUILD_5(PR, AR, PO), PR AR##6 PO
00102 #define FLISTBUILD_7(PR, AR, PO) FLISTBUILD_6(PR, AR, PO), PR AR##7 PO
00103 #define FLISTBUILD_8(PR, AR, PO) FLISTBUILD_7(PR, AR, PO), PR AR##8 PO
00104 #define FLISTBUILD_9(PR, AR, PO) FLISTBUILD_8(PR, AR, PO), PR AR##9 PO
00105
00106
00107
00108
00109
00110 #define LISTBUILD2_1(PRE,ARGA,ARGB) \
00111 PRE ARGA##1 ARGB##1
00112 #define LISTBUILD2_2(PRE,ARGA,ARGB) LISTBUILD2_1(PRE,ARGA,ARGB), \
00113 PRE ARGA##2 ARGB##2
00114 #define LISTBUILD2_3(PRE,ARGA,ARGB) LISTBUILD2_2(PRE,ARGA,ARGB), \
00115 PRE ARGA##3 ARGB##3
00116 #define LISTBUILD2_4(PRE,ARGA,ARGB) LISTBUILD2_3(PRE,ARGA,ARGB), \
00117 PRE ARGA##4 ARGB##4
00118 #define LISTBUILD2_5(PRE,ARGA,ARGB) LISTBUILD2_4(PRE,ARGA,ARGB), \
00119 PRE ARGA##5 ARGB##5
00120 #define LISTBUILD2_6(PRE,ARGA,ARGB) LISTBUILD2_5(PRE,ARGA,ARGB), \
00121 PRE ARGA##6 ARGB##6
00122 #define LISTBUILD2_7(PRE,ARGA,ARGB) LISTBUILD2_6(PRE,ARGA,ARGB), \
00123 PRE ARGA##7 ARGB##7
00124 #define LISTBUILD2_8(PRE,ARGA,ARGB) LISTBUILD2_7(PRE,ARGA,ARGB), \
00125 PRE ARGA##8 ARGB##8
00126 #define LISTBUILD2_9(PRE,ARGA,ARGB) LISTBUILD2_8(PRE,ARGA,ARGB), \
00127 PRE ARGA##9 ARGB##9
00128
00129
00130
00131
00132 #define OPBUILD_1(STREAM, ARG, OP) STREAM OP ARG##1
00133 #define OPBUILD_2(STREAM, ARG, OP) OPBUILD_1(STREAM,ARG, OP) OP ARG##2
00134 #define OPBUILD_3(STREAM, ARG, OP) OPBUILD_2(STREAM,ARG, OP) OP ARG##3
00135 #define OPBUILD_4(STREAM, ARG, OP) OPBUILD_3(STREAM,ARG, OP) OP ARG##4
00136 #define OPBUILD_5(STREAM, ARG, OP) OPBUILD_4(STREAM,ARG, OP) OP ARG##5
00137 #define OPBUILD_6(STREAM, ARG, OP) OPBUILD_5(STREAM,ARG, OP) OP ARG##6
00138 #define OPBUILD_7(STREAM, ARG, OP) OPBUILD_6(STREAM,ARG, OP) OP ARG##7
00139 #define OPBUILD_8(STREAM, ARG, OP) OPBUILD_7(STREAM,ARG, OP) OP ARG##8
00140 #define OPBUILD_9(STREAM, ARG, OP) OPBUILD_8(STREAM,ARG, OP) OP ARG##9
00141
00142
00143 #define TEMPLATEDEF_N(N) template< LISTBUILD_##N(class, Arg) >
00144
00145 #define TEMPLATEARGS_N(N) < LISTBUILD_##N(,Arg) >
00146
00147 #define ARGUSAGE_N(N) LISTBUILD_##N(,a)
00148
00149 #define ARGDEF_N(N) LISTBUILD2_##N(,Arg,a)
00150
00151 #define VARIABLEDEF_N(N,TYPE,NAME) CHAINBUILD2_##N(TYPE,NAME,;)
00152
00153
00154 #define OP_OUTPUT_N(N, STREAM, ARG) OPBUILD_##N(STREAM,ARG,<<)
00155
00156 #define OP_INPUT_N(N, STREAM, ARG) OPBUILD_##N(STREAM,ARG,>>)
00157
00158
00159 #endif
00160