dub 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/dub.gemspec +4 -4
- data/lib/dub/klass.rb +15 -3
- data/lib/dub/lua/class.cpp.erb +3 -3
- data/lib/dub/lua/function_gen.rb +8 -1
- data/lib/dub/version.rb +1 -1
- data/test/fixtures/app/include/matrix.h +4 -0
- data/test/fixtures/app/xml/classdub_1_1_matrix.xml +33 -7
- data/test/fixtures/app/xml/classdub_1_1_t_mat.xml +15 -15
- data/test/fixtures/app/xml/index.xml +1 -0
- data/test/fixtures/app/xml/matrix_8h.xml +74 -70
- data/test/fixtures/app/xml/namespacedub.xml +2 -2
- data/test/klass_test.rb +24 -3
- data/test/lua_function_gen_test.rb +20 -0
- metadata +11 -4
data/History.txt
CHANGED
data/dub.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dub}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Gaspard Bucher"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-12-15}
|
13
13
|
s.description = %q{This is a tool to ease the creation of scripting language bindings for a C++ library.
|
14
14
|
It is currently developed to crete the OpenCV bindings for Lua in Rubyk (http://rubyk.org). The generator uses the xml output from Doxygen to avoid parsing C++ code by itself.}
|
15
15
|
s.email = %q{gaspard@teti.ch}
|
@@ -166,7 +166,7 @@ Gem::Specification.new do |s|
|
|
166
166
|
s.homepage = %q{http://rubyk.org/en/project311.html}
|
167
167
|
s.rdoc_options = ["--charset=UTF-8"]
|
168
168
|
s.require_paths = ["lib"]
|
169
|
-
s.rubygems_version = %q{1.3.
|
169
|
+
s.rubygems_version = %q{1.3.7}
|
170
170
|
s.summary = %q{A tool to ease the creation of scripting language bindings for a C++ library.}
|
171
171
|
s.test_files = [
|
172
172
|
"test/argument_test.rb",
|
@@ -185,7 +185,7 @@ Gem::Specification.new do |s|
|
|
185
185
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
186
186
|
s.specification_version = 3
|
187
187
|
|
188
|
-
if Gem::Version.new(Gem::
|
188
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
189
189
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
190
190
|
else
|
191
191
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
data/lib/dub/klass.rb
CHANGED
@@ -8,7 +8,7 @@ module Dub
|
|
8
8
|
class Klass
|
9
9
|
include MemberExtraction
|
10
10
|
attr_reader :name, :xml, :prefix, :constructor, :alias_names, :enums, :parent, :instanciations
|
11
|
-
attr_accessor :
|
11
|
+
attr_accessor :opts
|
12
12
|
|
13
13
|
def initialize(parent, name, xml, prefix = '')
|
14
14
|
@parent, @name, @xml, @prefix = parent, name, xml, prefix
|
@@ -17,6 +17,7 @@ module Dub
|
|
17
17
|
@enums = []
|
18
18
|
@ignores = []
|
19
19
|
@instanciations = {}
|
20
|
+
@opts = {}
|
20
21
|
parse_xml
|
21
22
|
end
|
22
23
|
|
@@ -104,7 +105,7 @@ module Dub
|
|
104
105
|
end
|
105
106
|
|
106
107
|
def header
|
107
|
-
@header ||= (@xml/'location').first.attributes['file'].split('/').last
|
108
|
+
@opts[:header] ||= (@xml/'location').first.attributes['file'].split('/').last
|
108
109
|
end
|
109
110
|
|
110
111
|
def full_type
|
@@ -112,7 +113,7 @@ module Dub
|
|
112
113
|
end
|
113
114
|
|
114
115
|
def lib_name
|
115
|
-
|
116
|
+
@opts[:lib_name] || name
|
116
117
|
end
|
117
118
|
|
118
119
|
def id_name(name = self.name)
|
@@ -228,5 +229,16 @@ module Dub
|
|
228
229
|
@constructor.name = new_name
|
229
230
|
end
|
230
231
|
end
|
232
|
+
|
233
|
+
def method_missing(met, *args)
|
234
|
+
if args.empty? && @opts.has_key?(met.to_sym)
|
235
|
+
@opts[met.to_sym]
|
236
|
+
elsif args.size == 1 && met.to_s =~ /^(.+)=$/
|
237
|
+
@opts[$1.to_sym] = args.first
|
238
|
+
else
|
239
|
+
super
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
231
243
|
end
|
232
244
|
end
|
data/lib/dub/lua/class.cpp.erb
CHANGED
@@ -23,7 +23,7 @@ static int <%= @class.destructor_name %>(lua_State *L) {
|
|
23
23
|
|
24
24
|
static int <%= @class.tostring_name %>(lua_State *L) {
|
25
25
|
<%= @class.name %> **userdata = (<%= @class.name %>**)luaL_checkudata(L, 1, <%= @class.id_name.inspect %>);
|
26
|
-
<% if @class.string_format %>
|
26
|
+
<% if @class.opts[:string_format] %>
|
27
27
|
lua_pushfstring(L, "<<%= @class.id_name %>: %p <%= @class.string_format %>>", *userdata, <%= @class.string_args %>);
|
28
28
|
<% else %>
|
29
29
|
lua_pushfstring(L, "<<%= @class.id_name %>: %p>", *userdata);
|
@@ -59,9 +59,9 @@ static const struct lua_constants_Reg <%= @class.name %>_namespace_constants[] =
|
|
59
59
|
<% end %>
|
60
60
|
|
61
61
|
#ifdef DUB_LUA_NO_OPEN
|
62
|
-
int luaload_<%= @class.lib_name %>(lua_State *L) {
|
62
|
+
int luaload_<%= @class.prefix %>_<%= @class.lib_name %>(lua_State *L) {
|
63
63
|
#else
|
64
|
-
extern "C" int luaopen_<%= @class.lib_name %>(lua_State *L) {
|
64
|
+
extern "C" int luaopen_<%= @class.prefix %>_<%= @class.lib_name %>(lua_State *L) {
|
65
65
|
#endif
|
66
66
|
// Create the metatable which will contain all the member methods
|
67
67
|
luaL_newmetatable(L, <%= @class.id_name.inspect %>);
|
data/lib/dub/lua/function_gen.rb
CHANGED
@@ -27,6 +27,7 @@ module Dub
|
|
27
27
|
|
28
28
|
def initialize
|
29
29
|
load_erb
|
30
|
+
@custom_types = []
|
30
31
|
end
|
31
32
|
|
32
33
|
def template_path=(template_path)
|
@@ -34,6 +35,10 @@ module Dub
|
|
34
35
|
load_erb
|
35
36
|
end
|
36
37
|
|
38
|
+
def custom_type(regexp, &block)
|
39
|
+
@custom_types << [regexp, block]
|
40
|
+
end
|
41
|
+
|
37
42
|
# Produce bindings for a group of overloaded functions
|
38
43
|
def group(group)
|
39
44
|
@group = group
|
@@ -210,7 +215,9 @@ module Dub
|
|
210
215
|
# // luaL_argcheck could be better to report errors like "expected Mat"
|
211
216
|
def get_arg(arg, stack_pos)
|
212
217
|
type_def = "#{arg.create_type}#{arg.name}#{arg.array_suffix}"
|
213
|
-
if
|
218
|
+
if custom_type = @custom_types.detect {|reg,proc| type_def =~ reg}
|
219
|
+
custom_type[1].call(type_def, arg, stack_pos)
|
220
|
+
elsif arg.is_native?
|
214
221
|
if arg.is_pointer?
|
215
222
|
if arg.type == 'char'
|
216
223
|
type_def = "const #{type_def}" unless arg.is_const?
|
data/lib/dub/version.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
</detaileddescription>
|
15
15
|
<inbodydescription>
|
16
16
|
</inbodydescription>
|
17
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
17
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="88" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="88" bodyend="-1"/>
|
18
18
|
</memberdef>
|
19
19
|
<memberdef kind="variable" id="classdub_1_1_matrix_1afbb3dac9aac8db0e6feffb8c61954065" prot="protected" static="no" mutable="no">
|
20
20
|
<type>size_t</type>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
</detaileddescription>
|
28
28
|
<inbodydescription>
|
29
29
|
</inbodydescription>
|
30
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
30
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="89" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="89" bodyend="-1"/>
|
31
31
|
</memberdef>
|
32
32
|
<memberdef kind="variable" id="classdub_1_1_matrix_1a9820706da6cb36cf14dfefbb4eabc92d" prot="protected" static="no" mutable="no">
|
33
33
|
<type>size_t</type>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
</detaileddescription>
|
41
41
|
<inbodydescription>
|
42
42
|
</inbodydescription>
|
43
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
43
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="90" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="90" bodyend="-1"/>
|
44
44
|
</memberdef>
|
45
45
|
</sectiondef>
|
46
46
|
<sectiondef kind="public-func">
|
@@ -230,6 +230,31 @@
|
|
230
230
|
</inbodydescription>
|
231
231
|
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="60" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="60" bodyend="62"/>
|
232
232
|
</memberdef>
|
233
|
+
<memberdef kind="function" id="classdub_1_1_matrix_1af64ee96907ba127c876b9ebb9a65cc72" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
234
|
+
<type>int *</type>
|
235
|
+
<definition>int* dub::Matrix::lua_thing</definition>
|
236
|
+
<argsstring>(int a, lua_State *L, int b)</argsstring>
|
237
|
+
<name>lua_thing</name>
|
238
|
+
<param>
|
239
|
+
<type>int</type>
|
240
|
+
<declname>a</declname>
|
241
|
+
</param>
|
242
|
+
<param>
|
243
|
+
<type>lua_State *</type>
|
244
|
+
<declname>L</declname>
|
245
|
+
</param>
|
246
|
+
<param>
|
247
|
+
<type>int</type>
|
248
|
+
<declname>b</declname>
|
249
|
+
</param>
|
250
|
+
<briefdescription>
|
251
|
+
</briefdescription>
|
252
|
+
<detaileddescription>
|
253
|
+
</detaileddescription>
|
254
|
+
<inbodydescription>
|
255
|
+
</inbodydescription>
|
256
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="64" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="64" bodyend="66"/>
|
257
|
+
</memberdef>
|
233
258
|
</sectiondef>
|
234
259
|
<sectiondef kind="public-static-func">
|
235
260
|
<memberdef kind="function" id="classdub_1_1_matrix_1ad21255c4a1457c9969b6092ee40e0870" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
|
@@ -251,7 +276,7 @@
|
|
251
276
|
<para>Named constructor. </para> </detaileddescription>
|
252
277
|
<inbodydescription>
|
253
278
|
</inbodydescription>
|
254
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
279
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="70" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="70" bodyend="72"/>
|
255
280
|
</memberdef>
|
256
281
|
</sectiondef>
|
257
282
|
<sectiondef kind="private-func">
|
@@ -266,7 +291,7 @@
|
|
266
291
|
</detaileddescription>
|
267
292
|
<inbodydescription>
|
268
293
|
</inbodydescription>
|
269
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
294
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="76" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="76" bodyend="79"/>
|
270
295
|
</memberdef>
|
271
296
|
</sectiondef>
|
272
297
|
<sectiondef kind="protected-func">
|
@@ -281,20 +306,21 @@
|
|
281
306
|
</detaileddescription>
|
282
307
|
<inbodydescription>
|
283
308
|
</inbodydescription>
|
284
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
309
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="83" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="83" bodyend="86"/>
|
285
310
|
</memberdef>
|
286
311
|
</sectiondef>
|
287
312
|
<briefdescription>
|
288
313
|
</briefdescription>
|
289
314
|
<detaileddescription>
|
290
315
|
</detaileddescription>
|
291
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="12" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="12" bodyend="
|
316
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="12" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="12" bodyend="91"/>
|
292
317
|
<listofallmembers>
|
293
318
|
<member refid="classdub_1_1_matrix_1ac13eec5120f1be537122fc2b9a35d12e" prot="public" virt="non-virtual"><scope>dub::Matrix</scope><name>cols</name></member>
|
294
319
|
<member refid="classdub_1_1_matrix_1a9820706da6cb36cf14dfefbb4eabc92d" prot="protected" virt="non-virtual"><scope>dub::Matrix</scope><name>cols_</name></member>
|
295
320
|
<member refid="classdub_1_1_matrix_1a134af4a94d273c34cc99e7645fb97917" prot="protected" virt="non-virtual"><scope>dub::Matrix</scope><name>data_</name></member>
|
296
321
|
<member refid="classdub_1_1_matrix_1a5bf5b5aee77c4e4a4cf906ce785fe37b" prot="public" virt="non-virtual"><scope>dub::Matrix</scope><name>do_something</name></member>
|
297
322
|
<member refid="classdub_1_1_matrix_1a7a47bc085de140093ba358d345d58df7" prot="public" virt="non-virtual"><scope>dub::Matrix</scope><name>give_me_tea</name></member>
|
323
|
+
<member refid="classdub_1_1_matrix_1af64ee96907ba127c876b9ebb9a65cc72" prot="public" virt="non-virtual"><scope>dub::Matrix</scope><name>lua_thing</name></member>
|
298
324
|
<member refid="classdub_1_1_matrix_1ad21255c4a1457c9969b6092ee40e0870" prot="public" virt="non-virtual"><scope>dub::Matrix</scope><name>MakeMatrix</name></member>
|
299
325
|
<member refid="classdub_1_1_matrix_1a2d7bfdf38d81c5ec81dff23030d2b569" prot="public" virt="non-virtual"><scope>dub::Matrix</scope><name>Matrix</name></member>
|
300
326
|
<member refid="classdub_1_1_matrix_1a87d276a9bfb52dbe228a19c2eae63b4b" prot="public" virt="non-virtual"><scope>dub::Matrix</scope><name>Matrix</name></member>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
</detaileddescription>
|
20
20
|
<inbodydescription>
|
21
21
|
</inbodydescription>
|
22
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
22
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="145" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="145" bodyend="-1"/>
|
23
23
|
</memberdef>
|
24
24
|
<memberdef kind="variable" id="classdub_1_1_t_mat_1af4189290104841dd5a9a6f02bf83a7d8" prot="private" static="no" mutable="no">
|
25
25
|
<type>size_t</type>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
</detaileddescription>
|
33
33
|
<inbodydescription>
|
34
34
|
</inbodydescription>
|
35
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
35
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="146" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="146" bodyend="-1"/>
|
36
36
|
</memberdef>
|
37
37
|
<memberdef kind="variable" id="classdub_1_1_t_mat_1ae61dde1ed3a5f0a50cedef0fdbc79a06" prot="private" static="no" mutable="no">
|
38
38
|
<type>size_t</type>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
</detaileddescription>
|
46
46
|
<inbodydescription>
|
47
47
|
</inbodydescription>
|
48
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
48
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="147" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="147" bodyend="-1"/>
|
49
49
|
</memberdef>
|
50
50
|
</sectiondef>
|
51
51
|
<sectiondef kind="public-func">
|
@@ -60,7 +60,7 @@
|
|
60
60
|
</detaileddescription>
|
61
61
|
<inbodydescription>
|
62
62
|
</inbodydescription>
|
63
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
63
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="97" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="97" bodyend="97"/>
|
64
64
|
</memberdef>
|
65
65
|
<memberdef kind="function" id="classdub_1_1_t_mat_1afdc6150359c9b1914cd5af9e273757be" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
66
66
|
<type></type>
|
@@ -81,7 +81,7 @@
|
|
81
81
|
</detaileddescription>
|
82
82
|
<inbodydescription>
|
83
83
|
</inbodydescription>
|
84
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
84
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="99" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="99" bodyend="101"/>
|
85
85
|
</memberdef>
|
86
86
|
<memberdef kind="function" id="classdub_1_1_t_mat_1ad6fe3f080e15ae4f7cf0b55abc64469e" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
87
87
|
<type></type>
|
@@ -98,7 +98,7 @@
|
|
98
98
|
</detaileddescription>
|
99
99
|
<inbodydescription>
|
100
100
|
</inbodydescription>
|
101
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
101
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="104" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="104" bodyend="106"/>
|
102
102
|
</memberdef>
|
103
103
|
<memberdef kind="function" id="classdub_1_1_t_mat_1aa2f979b486bd17cf3a840976983d7ebb" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
104
104
|
<type></type>
|
@@ -111,7 +111,7 @@
|
|
111
111
|
</detaileddescription>
|
112
112
|
<inbodydescription>
|
113
113
|
</inbodydescription>
|
114
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
114
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="108" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="108" bodyend="110"/>
|
115
115
|
</memberdef>
|
116
116
|
<memberdef kind="function" id="classdub_1_1_t_mat_1a2be2ba15b604f9529a9fce4eff4379e9" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
117
117
|
<templateparamlist>
|
@@ -129,7 +129,7 @@
|
|
129
129
|
<para>Dummy template based class method. </para> </detaileddescription>
|
130
130
|
<inbodydescription>
|
131
131
|
</inbodydescription>
|
132
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
132
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="115" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="115" bodyend="117"/>
|
133
133
|
</memberdef>
|
134
134
|
<memberdef kind="function" id="classdub_1_1_t_mat_1affa049645f25277333d2d000051c762f" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
135
135
|
<type>size_t</type>
|
@@ -142,7 +142,7 @@
|
|
142
142
|
<para>Return size of matrix (rows * cols). </para> </detaileddescription>
|
143
143
|
<inbodydescription>
|
144
144
|
</inbodydescription>
|
145
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
145
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="120" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="120" bodyend="122"/>
|
146
146
|
</memberdef>
|
147
147
|
<memberdef kind="function" id="classdub_1_1_t_mat_1a1fac3175ad4602f3212c08e41f4383bb" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
148
148
|
<type>size_t</type>
|
@@ -155,7 +155,7 @@
|
|
155
155
|
</detaileddescription>
|
156
156
|
<inbodydescription>
|
157
157
|
</inbodydescription>
|
158
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
158
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="124" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="124" bodyend="126"/>
|
159
159
|
</memberdef>
|
160
160
|
<memberdef kind="function" id="classdub_1_1_t_mat_1ac66d2c59eba113fd4416c24460b04582" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
161
161
|
<type>size_t</type>
|
@@ -168,7 +168,7 @@
|
|
168
168
|
</detaileddescription>
|
169
169
|
<inbodydescription>
|
170
170
|
</inbodydescription>
|
171
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
171
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="128" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="128" bodyend="130"/>
|
172
172
|
</memberdef>
|
173
173
|
<memberdef kind="function" id="classdub_1_1_t_mat_1a2a28668935a895001309f6ab05922a9c" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
174
174
|
<type>void</type>
|
@@ -185,7 +185,7 @@
|
|
185
185
|
</detaileddescription>
|
186
186
|
<inbodydescription>
|
187
187
|
</inbodydescription>
|
188
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
188
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="132" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="132" bodyend="134"/>
|
189
189
|
</memberdef>
|
190
190
|
<memberdef kind="function" id="classdub_1_1_t_mat_1a6543ef3e46f91cfa4785be0070624b67" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
191
191
|
<type>void</type>
|
@@ -203,7 +203,7 @@
|
|
203
203
|
</detaileddescription>
|
204
204
|
<inbodydescription>
|
205
205
|
</inbodydescription>
|
206
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
206
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="136" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="136" bodyend="138"/>
|
207
207
|
</memberdef>
|
208
208
|
<memberdef kind="function" id="classdub_1_1_t_mat_1ad5daa1d61af70c79402f4cb3acd770b3" prot="public" static="no" const="no" explicit="no" inline="yes" virt="non-virtual">
|
209
209
|
<type>T</type>
|
@@ -224,14 +224,14 @@
|
|
224
224
|
</detaileddescription>
|
225
225
|
<inbodydescription>
|
226
226
|
</inbodydescription>
|
227
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
227
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="140" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="140" bodyend="142"/>
|
228
228
|
</memberdef>
|
229
229
|
</sectiondef>
|
230
230
|
<briefdescription>
|
231
231
|
</briefdescription>
|
232
232
|
<detaileddescription>
|
233
233
|
</detaileddescription>
|
234
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
234
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="95" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="95" bodyend="148"/>
|
235
235
|
<listofallmembers>
|
236
236
|
<member refid="classdub_1_1_t_mat_1a1fac3175ad4602f3212c08e41f4383bb" prot="public" virt="non-virtual"><scope>dub::TMat</scope><name>cols</name></member>
|
237
237
|
<member refid="classdub_1_1_t_mat_1ae61dde1ed3a5f0a50cedef0fdbc79a06" prot="private" virt="non-virtual"><scope>dub::TMat</scope><name>cols_</name></member>
|
@@ -16,6 +16,7 @@
|
|
16
16
|
<member refid="classdub_1_1_matrix_1a5bf5b5aee77c4e4a4cf906ce785fe37b" kind="function"><name>do_something</name></member>
|
17
17
|
<member refid="classdub_1_1_matrix_1a5d8ae4699d499cb9e4292c2ff765d3a1" kind="function"><name>use_other_lib</name></member>
|
18
18
|
<member refid="classdub_1_1_matrix_1a90798c27b8b4017a939f804481eb50ad" kind="function"><name>ptr</name></member>
|
19
|
+
<member refid="classdub_1_1_matrix_1af64ee96907ba127c876b9ebb9a65cc72" kind="function"><name>lua_thing</name></member>
|
19
20
|
<member refid="classdub_1_1_matrix_1ad21255c4a1457c9969b6092ee40e0870" kind="function"><name>MakeMatrix</name></member>
|
20
21
|
<member refid="classdub_1_1_matrix_1a068b8c574a47b79df894bf1f4b3e1946" kind="function"><name>private_method</name></member>
|
21
22
|
<member refid="classdub_1_1_matrix_1aea9c51add856fe990e6474410849f8e3" kind="function"><name>protected_method</name></member>
|
@@ -86,89 +86,93 @@
|
|
86
86
|
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>dummy</highlight><highlight class="normal"></highlight></codeline>
|
87
87
|
<codeline lineno="62"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
88
88
|
<codeline lineno="63"><highlight class="normal"></highlight></codeline>
|
89
|
-
<codeline lineno="
|
90
|
-
<codeline lineno="
|
91
|
-
<codeline lineno="
|
92
|
-
<codeline lineno="
|
93
|
-
<codeline lineno="70"><highlight class="normal"
|
94
|
-
<codeline lineno="71"><highlight class="normal"
|
95
|
-
<codeline lineno="72"><highlight class="normal"><sp/><sp
|
96
|
-
<codeline lineno="73"><highlight class="normal"
|
97
|
-
<codeline lineno="74"><highlight class="normal"
|
98
|
-
<codeline lineno="75"><highlight class="normal"
|
99
|
-
<codeline lineno="76"><highlight class="normal"
|
100
|
-
<codeline lineno="77"><highlight class="normal"
|
101
|
-
<codeline lineno="78"><highlight class="normal"
|
102
|
-
<codeline lineno="79"><highlight class="normal"><sp/><sp
|
103
|
-
<codeline lineno="80"><highlight class="normal"
|
104
|
-
<codeline lineno="81"><highlight class="normal"
|
105
|
-
<codeline lineno="82"><highlight class="normal"
|
106
|
-
<codeline lineno="83"><highlight class="normal"
|
107
|
-
<codeline lineno="84"><highlight class="normal"><sp/><sp/></highlight><highlight class="
|
108
|
-
<codeline lineno="85"><highlight class="normal"><sp/><sp/></highlight><highlight class="
|
109
|
-
<codeline lineno="86"><highlight class="normal"><sp/><sp
|
110
|
-
<codeline lineno="87"><highlight class="normal"
|
111
|
-
<codeline lineno="88"><highlight class="normal"
|
112
|
-
<codeline lineno="89"><highlight class="normal"
|
113
|
-
<codeline lineno="90"><highlight class="normal"
|
114
|
-
<codeline lineno="91"
|
115
|
-
<codeline lineno="92"><highlight class="normal"></highlight
|
116
|
-
<codeline lineno="93"><highlight class="normal"
|
117
|
-
<codeline lineno="94"><highlight class="normal"></highlight></codeline>
|
118
|
-
<codeline lineno="95"
|
119
|
-
<codeline lineno="96"><highlight class="normal"
|
120
|
-
<codeline lineno="97"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
89
|
+
<codeline lineno="64"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*lua_thing(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>a,<sp/>lua_State<sp/>*L,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>b)<sp/>{</highlight></codeline>
|
90
|
+
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>dummy</highlight><highlight class="normal"></highlight></codeline>
|
91
|
+
<codeline lineno="66"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
92
|
+
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
|
93
|
+
<codeline lineno="70" refid="classdub_1_1_matrix_1ad21255c4a1457c9969b6092ee40e0870" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="classdub_1_1_matrix" kindref="compound">Matrix</ref><sp/>*<ref refid="classdub_1_1_matrix_1ad21255c4a1457c9969b6092ee40e0870" kindref="member">MakeMatrix</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>cols)<sp/>{</highlight></codeline>
|
94
|
+
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="classdub_1_1_matrix" kindref="compound">Matrix</ref>(rows,<sp/>cols);</highlight></codeline>
|
95
|
+
<codeline lineno="72"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
96
|
+
<codeline lineno="73"><highlight class="normal"></highlight></codeline>
|
97
|
+
<codeline lineno="74"><highlight class="normal"></highlight><highlight class="keyword">private</highlight><highlight class="normal">:</highlight></codeline>
|
98
|
+
<codeline lineno="75"><highlight class="normal"></highlight></codeline>
|
99
|
+
<codeline lineno="76"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>private_method()<sp/>{</highlight></codeline>
|
100
|
+
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>should<sp/>not<sp/>be<sp/>implemented</highlight><highlight class="normal"></highlight></codeline>
|
101
|
+
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
|
102
|
+
<codeline lineno="79"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
103
|
+
<codeline lineno="80"><highlight class="normal"></highlight></codeline>
|
104
|
+
<codeline lineno="81"><highlight class="normal"></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
|
105
|
+
<codeline lineno="82"><highlight class="normal"></highlight></codeline>
|
106
|
+
<codeline lineno="83"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>protected_method()<sp/>{</highlight></codeline>
|
107
|
+
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>should<sp/>not<sp/>be<sp/>implemented</highlight><highlight class="normal"></highlight></codeline>
|
108
|
+
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
|
109
|
+
<codeline lineno="86"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
110
|
+
<codeline lineno="87"><highlight class="normal"></highlight></codeline>
|
111
|
+
<codeline lineno="88"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>*data_;</highlight></codeline>
|
112
|
+
<codeline lineno="89"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>rows_;</highlight></codeline>
|
113
|
+
<codeline lineno="90"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>cols_;</highlight></codeline>
|
114
|
+
<codeline lineno="91"><highlight class="normal">};</highlight></codeline>
|
115
|
+
<codeline lineno="92"><highlight class="normal"></highlight></codeline>
|
116
|
+
<codeline lineno="93"><highlight class="normal"></highlight></codeline>
|
117
|
+
<codeline lineno="94"><highlight class="normal"></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
118
|
+
<codeline lineno="95" refid="classdub_1_1_t_mat" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classdub_1_1_t_mat" kindref="compound">TMat</ref><sp/>{</highlight></codeline>
|
119
|
+
<codeline lineno="96"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
|
120
|
+
<codeline lineno="97"><highlight class="normal"><sp/><sp/><ref refid="classdub_1_1_t_mat" kindref="compound">TMat</ref>()<sp/>:<sp/>data_(NULL),<sp/>rows_(0),<sp/>cols_(0)<sp/>{}</highlight></codeline>
|
121
121
|
<codeline lineno="98"><highlight class="normal"></highlight></codeline>
|
122
|
-
<codeline lineno="99"><highlight class="normal"><sp/><sp
|
123
|
-
<codeline lineno="100"><highlight class="normal"><sp/><sp/><ref refid="
|
124
|
-
<codeline lineno="101"><highlight class="normal"
|
125
|
-
<codeline lineno="102"><highlight class="normal"
|
126
|
-
<codeline lineno="103"><highlight class="normal"></highlight></codeline>
|
127
|
-
<codeline lineno="104"><highlight class="normal"><sp/><sp
|
128
|
-
<codeline lineno="105"><highlight class="normal"
|
122
|
+
<codeline lineno="99"><highlight class="normal"><sp/><sp/><ref refid="classdub_1_1_t_mat" kindref="compound">TMat</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rows,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>cols)<sp/>:<sp/>rows_(rows),<sp/>cols_(cols)<sp/>{</highlight></codeline>
|
123
|
+
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/>data_<sp/>=<sp/>(T*)malloc(<ref refid="classdub_1_1_t_mat_1affa049645f25277333d2d000051c762f" kindref="member">size</ref>()<sp/>*<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(T));</highlight></codeline>
|
124
|
+
<codeline lineno="101"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
125
|
+
<codeline lineno="102"><highlight class="normal"></highlight></codeline>
|
126
|
+
<codeline lineno="103"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//<sp/>test<sp/>constructor<sp/>with<sp/>T<sp/>parameter</highlight><highlight class="normal"></highlight></codeline>
|
127
|
+
<codeline lineno="104"><highlight class="normal"><sp/><sp/><ref refid="classdub_1_1_t_mat" kindref="compound">TMat</ref>(T<sp/>dummy)<sp/>{</highlight></codeline>
|
128
|
+
<codeline lineno="105"><highlight class="normal"></highlight></codeline>
|
129
129
|
<codeline lineno="106"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
130
130
|
<codeline lineno="107"><highlight class="normal"></highlight></codeline>
|
131
|
-
<codeline lineno="
|
132
|
-
<codeline lineno="
|
133
|
-
<codeline lineno="
|
134
|
-
<codeline lineno="
|
135
|
-
<codeline lineno="114"><highlight class="normal"
|
136
|
-
<codeline lineno="
|
137
|
-
<codeline lineno="
|
138
|
-
<codeline lineno="
|
139
|
-
<codeline lineno="
|
140
|
-
<codeline lineno="120"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp
|
141
|
-
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>cols_;</highlight></codeline>
|
131
|
+
<codeline lineno="108"><highlight class="normal"><sp/><sp/>~<ref refid="classdub_1_1_t_mat" kindref="compound">TMat</ref>()<sp/>{</highlight></codeline>
|
132
|
+
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(data_)<sp/>free(data_);</highlight></codeline>
|
133
|
+
<codeline lineno="110"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
134
|
+
<codeline lineno="111"><highlight class="normal"></highlight></codeline>
|
135
|
+
<codeline lineno="114"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T2></highlight></codeline>
|
136
|
+
<codeline lineno="115" refid="classdub_1_1_t_mat_1a2be2ba15b604f9529a9fce4eff4379e9" refkind="member"><highlight class="normal"><sp/><sp/>T2<sp/>*<ref refid="classdub_1_1_t_mat_1a2be2ba15b604f9529a9fce4eff4379e9" kindref="member">give_me_tea</ref>()<sp/>{</highlight></codeline>
|
137
|
+
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>T2();</highlight></codeline>
|
138
|
+
<codeline lineno="117"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
139
|
+
<codeline lineno="118"><highlight class="normal"></highlight></codeline>
|
140
|
+
<codeline lineno="120" refid="classdub_1_1_t_mat_1affa049645f25277333d2d000051c762f" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/><ref refid="classdub_1_1_t_mat_1affa049645f25277333d2d000051c762f" kindref="member">size</ref>()<sp/>{</highlight></codeline>
|
141
|
+
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>rows_<sp/>*<sp/>cols_;</highlight></codeline>
|
142
142
|
<codeline lineno="122"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
143
143
|
<codeline lineno="123"><highlight class="normal"></highlight></codeline>
|
144
|
-
<codeline lineno="124"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>
|
145
|
-
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>
|
144
|
+
<codeline lineno="124"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>cols()<sp/>{</highlight></codeline>
|
145
|
+
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>cols_;</highlight></codeline>
|
146
146
|
<codeline lineno="126"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
147
147
|
<codeline lineno="127"><highlight class="normal"></highlight></codeline>
|
148
|
-
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">
|
149
|
-
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="
|
148
|
+
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>rows()<sp/>{</highlight></codeline>
|
149
|
+
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>rows_;</highlight></codeline>
|
150
150
|
<codeline lineno="130"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
151
151
|
<codeline lineno="131"><highlight class="normal"></highlight></codeline>
|
152
|
-
<codeline lineno="132"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>
|
153
|
-
<codeline lineno="133"><highlight class="normal"></highlight></codeline>
|
152
|
+
<codeline lineno="132"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>fill(T<sp/>value)<sp/>{</highlight></codeline>
|
153
|
+
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>dummy</highlight><highlight class="normal"></highlight></codeline>
|
154
154
|
<codeline lineno="134"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
155
155
|
<codeline lineno="135"><highlight class="normal"></highlight></codeline>
|
156
|
-
<codeline lineno="136"><highlight class="normal"><sp/><sp
|
157
|
-
<codeline lineno="137"><highlight class="normal"
|
156
|
+
<codeline lineno="136"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>FunkyThing(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>v[7])<sp/>{</highlight></codeline>
|
157
|
+
<codeline lineno="137"><highlight class="normal"></highlight></codeline>
|
158
158
|
<codeline lineno="138"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
159
159
|
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
|
160
|
-
<codeline lineno="140"><highlight class="normal"
|
161
|
-
<codeline lineno="141"><highlight class="normal"><sp/><sp/>
|
162
|
-
<codeline lineno="142"><highlight class="normal"><sp/><sp
|
163
|
-
<codeline lineno="143"><highlight class="normal"
|
164
|
-
<codeline lineno="144"><highlight class="normal">
|
165
|
-
<codeline lineno="145"><highlight class="normal"
|
166
|
-
<codeline lineno="
|
167
|
-
<codeline lineno="
|
168
|
-
<codeline lineno="
|
169
|
-
<codeline lineno="
|
170
|
-
<codeline lineno="152"><highlight class="normal"
|
171
|
-
<codeline lineno="153"><highlight class="normal"></highlight><highlight class="
|
160
|
+
<codeline lineno="140"><highlight class="normal"><sp/><sp/>T<sp/></highlight><highlight class="keyword">get</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>row,<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>col)<sp/>{</highlight></codeline>
|
161
|
+
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>data_[row<sp/>*<sp/>cols_<sp/>+<sp/>col];</highlight></codeline>
|
162
|
+
<codeline lineno="142"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
163
|
+
<codeline lineno="143"><highlight class="normal"></highlight></codeline>
|
164
|
+
<codeline lineno="144"><highlight class="normal"></highlight><highlight class="keyword">private</highlight><highlight class="normal">:</highlight></codeline>
|
165
|
+
<codeline lineno="145"><highlight class="normal"><sp/><sp/>T<sp/>*data_;</highlight></codeline>
|
166
|
+
<codeline lineno="146"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>rows_;</highlight></codeline>
|
167
|
+
<codeline lineno="147"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/>cols_;</highlight></codeline>
|
168
|
+
<codeline lineno="148"><highlight class="normal">};</highlight></codeline>
|
169
|
+
<codeline lineno="149"><highlight class="normal"></highlight></codeline>
|
170
|
+
<codeline lineno="152"><highlight class="keyword">typedef</highlight><highlight class="normal"><sp/>TMat<float><sp/>FloatMat;</highlight></codeline>
|
171
|
+
<codeline lineno="153"><highlight class="normal"></highlight><highlight class="keyword">typedef</highlight><highlight class="normal"><sp/>FloatMat<sp/>FMatrix;</highlight></codeline>
|
172
|
+
<codeline lineno="154"><highlight class="normal"></highlight></codeline>
|
173
|
+
<codeline lineno="155"><highlight class="normal">}<sp/></highlight><highlight class="comment">//<sp/>dub</highlight><highlight class="normal"></highlight></codeline>
|
174
|
+
<codeline lineno="156"><highlight class="normal"></highlight></codeline>
|
175
|
+
<codeline lineno="157"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/>//<sp/>DOXY_GENERATOR_TEST_FIXTURES_APP_MATRIX_H_</highlight></codeline>
|
172
176
|
</programlisting>
|
173
177
|
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h"/>
|
174
178
|
</compounddef>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</detaileddescription>
|
17
17
|
<inbodydescription>
|
18
18
|
</inbodydescription>
|
19
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
19
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="152" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="152" bodyend="-1"/>
|
20
20
|
</memberdef>
|
21
21
|
<memberdef kind="typedef" id="namespacedub_1a1f14f9a863b395dbbc9cdbf168855673" prot="public" static="no">
|
22
22
|
<type><ref refid="classdub_1_1_t_mat" kindref="compound">FloatMat</ref></type>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
</detaileddescription>
|
30
30
|
<inbodydescription>
|
31
31
|
</inbodydescription>
|
32
|
-
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="
|
32
|
+
<location file="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" line="153" bodyfile="/Users/gaspard/git/dub/test/fixtures/app/include/matrix.h" bodystart="153" bodyend="-1"/>
|
33
33
|
</memberdef>
|
34
34
|
</sectiondef>
|
35
35
|
<briefdescription>
|
data/test/klass_test.rb
CHANGED
@@ -21,9 +21,30 @@ class KlassTest < Test::Unit::TestCase
|
|
21
21
|
should 'have namespace prefix' do
|
22
22
|
assert_equal 'dub', @class.prefix
|
23
23
|
end
|
24
|
-
|
25
|
-
should '
|
26
|
-
|
24
|
+
|
25
|
+
should 'accept any attribute' do
|
26
|
+
assert_nothing_raised do
|
27
|
+
@class.foo = 'bar'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
should 'store special attributes in opts' do
|
32
|
+
@class.foo = 'bar'
|
33
|
+
assert_equal 'bar', @class.opts[:foo]
|
34
|
+
end
|
35
|
+
|
36
|
+
should 'return value from opts on method missing' do
|
37
|
+
@class.foo = 'bar'
|
38
|
+
assert_equal 'bar', @class.foo
|
39
|
+
end
|
40
|
+
|
41
|
+
should 'use name as default in lib_name' do
|
42
|
+
assert_equal 'Matrix', @class.lib_name
|
43
|
+
end
|
44
|
+
|
45
|
+
should 'use lib_name if set in lib_name' do
|
46
|
+
@class.opts[:lib_name] = "dooMat"
|
47
|
+
assert_equal 'dooMat', @class.lib_name
|
27
48
|
end
|
28
49
|
|
29
50
|
should 'combine prefix and name in id_name' do
|
@@ -74,6 +74,26 @@ class LuaFunctionGenTest < Test::Unit::TestCase
|
|
74
74
|
assert_equal 'DUMMY: resize', @generator.function(@function)
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
context 'using a custom type' do
|
79
|
+
setup do
|
80
|
+
@generator.custom_type(/lua_State /) do |type_def, arg, stack_pos|
|
81
|
+
if type_def =~ /lua_State\s*\*\s*L/
|
82
|
+
""
|
83
|
+
else
|
84
|
+
"#{type_def} = L;"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
should 'use custom block to get arg type' do
|
90
|
+
method = @generator.function(namespacedub_xml[:dub][:Matrix][:lua_thing])
|
91
|
+
assert_match %r{int a = luaL_checkint\(L, 1\)}, method
|
92
|
+
assert_no_match %r{L\s*=}, method
|
93
|
+
assert_match %r{int b = luaL_checkint\(L, 3\)}, method
|
94
|
+
assert_match %r{lua_thing\(a, L, b\)}, method
|
95
|
+
end
|
96
|
+
end
|
77
97
|
end
|
78
98
|
end
|
79
99
|
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 13
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
9
|
+
- 5
|
10
|
+
version: 0.6.5
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Gaspard Bucher
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-12-15 00:00:00 +01:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: shoulda
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
version: "0"
|
@@ -195,23 +198,27 @@ rdoc_options:
|
|
195
198
|
require_paths:
|
196
199
|
- lib
|
197
200
|
required_ruby_version: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
198
202
|
requirements:
|
199
203
|
- - ">="
|
200
204
|
- !ruby/object:Gem::Version
|
205
|
+
hash: 3
|
201
206
|
segments:
|
202
207
|
- 0
|
203
208
|
version: "0"
|
204
209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
210
|
+
none: false
|
205
211
|
requirements:
|
206
212
|
- - ">="
|
207
213
|
- !ruby/object:Gem::Version
|
214
|
+
hash: 3
|
208
215
|
segments:
|
209
216
|
- 0
|
210
217
|
version: "0"
|
211
218
|
requirements: []
|
212
219
|
|
213
220
|
rubyforge_project:
|
214
|
-
rubygems_version: 1.3.
|
221
|
+
rubygems_version: 1.3.7
|
215
222
|
signing_key:
|
216
223
|
specification_version: 3
|
217
224
|
summary: A tool to ease the creation of scripting language bindings for a C++ library.
|