annotate dstep/internal/Traits.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents 033d260cfc9b
children c2fba45df857
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
1 /**
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
3 * Authors: Jacob Carlborg
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
4 * Version: Initial created: Apr 28, 2009
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
6 */
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
7 module dstep.internal.Traits;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
8
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
9 import dstep.objc.bridge.Bridge;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
10 import dstep.internal.String;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
11
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
12 /**
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
13 * Returns the name of the given function
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
14 *
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
15 * Params:
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
16 * func = the function alias to get the name of
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
17 *
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
18 * Returns: the name of the function
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
19 */
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
20 template functionNameOf (alias func)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
21 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
22 version(LDC)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
23 const functionNameOf = (&func).stringof[1 .. $];
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
24
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
25 else
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
26 const functionNameOf = (&func).stringof[2 .. $];
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
27 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
28
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
29 /**
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
30 * Returns the parameter names of the given function
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
31 *
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
32 * Params:
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
33 * func = the function alias to get the parameter names of
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
34 *
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
35 * Returns: an array of strings containing the parameter names
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
36 */
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
37 template parameterNamesOf (alias func)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
38 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
39 const parameterNamesOf = parameterNamesOfImpl!(func);
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
40 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
41
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
42 private string[] parameterNamesOfImpl (alias func) ()
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
43 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
44 string funcStr = typeof(&func).stringof;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
45
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
46 auto start = funcStr.indexOf('(');
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
47 auto end = funcStr.indexOf(')');
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
48
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
49 const firstPattern = ' ';
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
50 const secondPattern = ',';
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
51
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
52 funcStr = funcStr[start + 1 .. end];
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
53
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
54 if (funcStr == "")
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
55 return null;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
56
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
57 funcStr ~= secondPattern;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
58
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
59 string token;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
60 string[] arr;
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
61
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
62 foreach (c ; funcStr)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
63 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
64 if (c != firstPattern && c != secondPattern)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
65 token ~= c;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
66
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
67 else
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
68 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
69 if (token)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
70 arr ~= token;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
71
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
72 token = null;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
73 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
74 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
75
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
76 if (arr.length == 1)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
77 return arr;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
78
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
79 string[] result;
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
80 bool skip = false;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
81
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
82 foreach (str ; arr)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
83 {
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
84 skip = !skip;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
85
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
86 if (skip)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
87 continue;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
88
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
89 result ~= str;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
90 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
91
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
92 return result;
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
93 }
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
94
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
95 /**
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
96 * Compile-time function to get the index of the give element.
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
97 *
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
98 * Performs a linear scan, returning the index of the first occurrence
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
99 * of the specified element in the array, or U.max if the array does
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
100 * not contain the element.
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
101 *
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
102 * Params:
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
103 * arr = the array to get the index of the element from
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
104 * element = the element to find
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
105 *
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
106 * Returns: the index of the element or size_t.max if the element was not found.
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
107 */
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
108 private size_t indexOf (T) (T[] arr, T element)
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
109 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
110 static if (is(T == char) || is(T == wchar) || is(T == dchar))
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
111 foreach (i, dchar e ; arr)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
112 if (e == element)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
113 return i;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
114
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
115 else
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
116 foreach (i, e ; arr)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
117 if (e == element)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
118 return i;
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
119
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
120 return size_t.max;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
121 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
122
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
123 /**
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
124 * Evaluates to true if $(D_PARAM T) has a instance method with the given name
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
125 *
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
126 * Params:
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
127 * T = the type of the class/struct
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
128 * method = the name of the method
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
129 */
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
130 template hasInstanceMethod (T, string method)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
131 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
132 const hasInstanceMethod = is(typeof({
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
133 T t;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
134 mixin("auto f = &t." ~ method ~ ";");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
135 }));
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
136 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
137
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
138 /**
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
139 * Evaluates to true if $(D_PARAM T) has a class method with the given name
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
140 *
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
141 * Params:
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
142 * T = the type of the class/struct
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
143 * method = the name of the method
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
144 */
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
145 template hasClassMethod (T, string method)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
146 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
147 const hasClassMethod = is(typeof({
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
148 mixin("auto f = &T." ~ method ~ ";");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
149 }));
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
150 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
151
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
152 /**
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
153 * Evaluates to true if $(D_PARAM T) has a either a class method or a instance method
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
154 * with the given name.
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
155 *
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
156 * Params:
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
157 * T = the type of the class/struct
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
158 * method = the name of the method
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
159 */
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
160 template hasMethod (T, string method)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
161 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
162 const hasMethod = hasClassMethod!(T, method) || hasInstanceMethod!(T, method);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
163 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
164
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
165 /**
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
166 * Evaluates to true if $(D_PARAM T) has a field with the given name
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
167 *
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
168 * Params:
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
169 * T = the type of the class/struct
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
170 * field = the name of the field
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
171 */
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
172 template hasField (T, string field)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
173 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
174 const hasField = is(typeof({
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
175 T t;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
176 mixin("auto f = t." ~ field ~ ";");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
177 }));
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
178 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
179
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
180 /// Evaluates to true if $(D_PARAM T) has binded methods
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
181 template hasBindedMethods (T)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
182 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 1
diff changeset
183 const bool hasBindedMethods = hasField!(T, Bridge.objcClassMethodDeclarationVar) || hasField!(T, Bridge.objcMethodDeclarationVar);
1
033d260cfc9b First upload of the bridge
Jacob Carlborg <doob@me.com>
parents:
diff changeset
184 }