1 /*
2 * Inkscape::Traits::Function - traits class for C++ "functors"
3 *
4 * Authors:
5 * MenTaLguY <mental@rydia.net>
6 *
7 * Copyright (C) 2004 MenTaLguY
8 *
9 * Released under GNU GPL, read the file 'COPYING' for more information
10 */
12 #ifndef SEEN_INKSCAPE_TRAITS_FUNCTION_H
13 #define SEEN_INKSCAPE_TRAITS_FUNCTION_H
15 namespace Inkscape {
17 namespace Traits {
19 template <typename F> struct Function;
21 template <typename R>
22 struct Function<R (*)()> {
23 typedef R Result;
25 typedef void Arg0;
26 typedef void Arg1;
27 typedef void Arg2;
28 typedef void Arg3;
29 typedef void Arg4;
30 typedef void Arg5;
31 };
33 template <typename R, typename A0>
34 struct Function<R (*)(A0)> {
35 typedef R Result;
37 typedef A0 Arg0;
38 typedef void Arg1;
39 typedef void Arg2;
40 typedef void Arg3;
41 typedef void Arg4;
42 typedef void Arg5;
43 };
45 template <typename R, typename A0, typename A1>
46 struct Function<R (*)(A0, A1)> {
47 typedef R Result;
49 typedef A0 Arg0;
50 typedef A1 Arg1;
51 typedef void Arg2;
52 typedef void Arg3;
53 typedef void Arg4;
54 typedef void Arg5;
55 };
57 template <typename R, typename A0, typename A1, typename A2>
58 struct Function<R (*)(A0, A1, A2)> {
59 typedef R Result;
61 typedef A0 Arg0;
62 typedef A1 Arg1;
63 typedef A2 Arg2;
64 typedef void Arg3;
65 typedef void Arg4;
66 typedef void Arg5;
67 };
69 template <typename R, typename A0, typename A1, typename A2,
70 typename A3>
71 struct Function<R (*)(A0, A1, A2, A3)> {
72 typedef R Result;
74 typedef A0 Arg0;
75 typedef A1 Arg1;
76 typedef A2 Arg2;
77 typedef A3 Arg3;
78 typedef void Arg4;
79 typedef void Arg5;
80 };
82 template <typename R, typename A0, typename A1, typename A2,
83 typename A3, typename A4>
84 struct Function<R (*)(A0, A1, A2, A3, A4)> {
85 typedef R Result;
87 typedef A0 Arg0;
88 typedef A1 Arg1;
89 typedef A2 Arg2;
90 typedef A3 Arg3;
91 typedef A4 Arg4;
92 typedef void Arg5;
93 };
95 template <typename R, typename A0, typename A1, typename A2,
96 typename A3, typename A4, typename A5>
97 struct Function<R (*)(A0, A1, A2, A3, A4, A5)> {
98 typedef R Result;
100 typedef A0 Arg0;
101 typedef A1 Arg1;
102 typedef A2 Arg2;
103 typedef A3 Arg3;
104 typedef A4 Arg4;
105 typedef A5 Arg5;
106 };
108 }
110 }
112 #endif
113 /*
114 Local Variables:
115 mode:c++
116 c-file-style:"stroustrup"
117 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
118 indent-tabs-mode:nil
119 fill-column:99
120 End:
121 */
122 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :