rice 4.7.1 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -1
  3. data/CMakeLists.txt +14 -22
  4. data/CMakePresets.json +203 -75
  5. data/FindRuby.cmake +358 -123
  6. data/bin/rice-doc.rb +56 -141
  7. data/include/rice/api.hpp +248 -0
  8. data/include/rice/rice.hpp +2237 -1657
  9. data/include/rice/stl.hpp +346 -443
  10. data/lib/rice/doc/config.rb +70 -0
  11. data/lib/rice/doc/cpp_reference.rb +1 -4
  12. data/lib/rice/doc/mkdocs.rb +58 -20
  13. data/lib/rice/doc/rice.rb +20 -0
  14. data/lib/rice/doc.rb +1 -0
  15. data/lib/rice/make_rice_headers.rb +7 -0
  16. data/lib/rice/native_registry.rb +2 -2
  17. data/lib/rice/rbs.rb +2 -2
  18. data/lib/rice/version.rb +1 -1
  19. data/lib/rubygems_plugin.rb +12 -9
  20. data/rice/Arg.hpp +12 -6
  21. data/rice/Arg.ipp +14 -7
  22. data/rice/Buffer.ipp +44 -40
  23. data/rice/Callback.hpp +1 -1
  24. data/rice/Callback.ipp +2 -7
  25. data/rice/Constructor.hpp +1 -1
  26. data/rice/Constructor.ipp +11 -11
  27. data/rice/Data_Object.ipp +15 -15
  28. data/rice/Data_Type.hpp +9 -10
  29. data/rice/Data_Type.ipp +22 -25
  30. data/rice/Director.hpp +1 -0
  31. data/rice/Enum.ipp +58 -39
  32. data/rice/Exception.hpp +4 -4
  33. data/rice/Exception.ipp +7 -7
  34. data/rice/NoGVL.hpp +13 -0
  35. data/rice/Reference.hpp +56 -0
  36. data/rice/Reference.ipp +96 -0
  37. data/rice/Return.hpp +4 -1
  38. data/rice/Return.ipp +0 -6
  39. data/rice/cpp_api/Array.hpp +41 -4
  40. data/rice/cpp_api/Array.ipp +105 -9
  41. data/rice/cpp_api/Class.hpp +2 -2
  42. data/rice/cpp_api/Class.ipp +4 -4
  43. data/rice/cpp_api/Hash.ipp +7 -4
  44. data/rice/cpp_api/Module.hpp +4 -4
  45. data/rice/cpp_api/Module.ipp +12 -10
  46. data/rice/cpp_api/Object.hpp +4 -4
  47. data/rice/cpp_api/Object.ipp +15 -12
  48. data/rice/cpp_api/String.hpp +2 -2
  49. data/rice/cpp_api/String.ipp +11 -8
  50. data/rice/cpp_api/Symbol.ipp +7 -7
  51. data/rice/cpp_api/shared_methods.hpp +5 -9
  52. data/rice/detail/InstanceRegistry.hpp +0 -2
  53. data/rice/detail/Native.hpp +31 -21
  54. data/rice/detail/Native.ipp +282 -130
  55. data/rice/detail/NativeAttributeGet.hpp +5 -7
  56. data/rice/detail/NativeAttributeGet.ipp +26 -26
  57. data/rice/detail/NativeAttributeSet.hpp +2 -4
  58. data/rice/detail/NativeAttributeSet.ipp +20 -16
  59. data/rice/detail/NativeCallback.hpp +77 -0
  60. data/rice/detail/NativeCallback.ipp +280 -0
  61. data/rice/detail/NativeFunction.hpp +11 -21
  62. data/rice/detail/NativeFunction.ipp +58 -119
  63. data/rice/detail/NativeInvoker.hpp +4 -4
  64. data/rice/detail/NativeInvoker.ipp +7 -7
  65. data/rice/detail/NativeIterator.hpp +2 -4
  66. data/rice/detail/NativeIterator.ipp +18 -14
  67. data/rice/detail/NativeMethod.hpp +10 -20
  68. data/rice/detail/NativeMethod.ipp +54 -114
  69. data/rice/detail/NativeProc.hpp +5 -7
  70. data/rice/detail/NativeProc.ipp +39 -28
  71. data/rice/detail/NativeRegistry.hpp +0 -1
  72. data/rice/detail/Parameter.hpp +15 -8
  73. data/rice/detail/Parameter.ipp +102 -43
  74. data/rice/detail/Proc.ipp +14 -28
  75. data/rice/detail/RubyType.ipp +2 -53
  76. data/rice/detail/Type.hpp +23 -7
  77. data/rice/detail/Type.ipp +73 -93
  78. data/rice/detail/TypeRegistry.ipp +5 -4
  79. data/rice/detail/Wrapper.hpp +1 -1
  80. data/rice/detail/Wrapper.ipp +18 -10
  81. data/rice/detail/from_ruby.hpp +8 -6
  82. data/rice/detail/from_ruby.ipp +306 -173
  83. data/rice/detail/ruby.hpp +23 -0
  84. data/rice/libc/file.hpp +4 -4
  85. data/rice/rice.hpp +6 -8
  86. data/rice/rice_api/Native.ipp +5 -1
  87. data/rice/rice_api/Parameter.ipp +1 -1
  88. data/rice/ruby_mark.hpp +2 -1
  89. data/rice/stl/complex.ipp +12 -8
  90. data/rice/stl/map.ipp +27 -22
  91. data/rice/stl/monostate.ipp +16 -12
  92. data/rice/stl/multimap.hpp +0 -2
  93. data/rice/stl/multimap.ipp +27 -22
  94. data/rice/stl/optional.ipp +27 -11
  95. data/rice/stl/pair.ipp +5 -5
  96. data/rice/stl/reference_wrapper.ipp +5 -4
  97. data/rice/stl/set.ipp +16 -16
  98. data/rice/stl/shared_ptr.hpp +0 -16
  99. data/rice/stl/shared_ptr.ipp +34 -190
  100. data/rice/stl/string.ipp +18 -18
  101. data/rice/stl/string_view.ipp +1 -1
  102. data/rice/stl/tuple.ipp +15 -36
  103. data/rice/stl/unique_ptr.ipp +18 -8
  104. data/rice/stl/unordered_map.ipp +20 -15
  105. data/rice/stl/variant.ipp +37 -21
  106. data/rice/stl/vector.ipp +41 -36
  107. data/rice/traits/function_traits.hpp +19 -19
  108. data/rice/traits/method_traits.hpp +4 -4
  109. data/rice/traits/rice_traits.hpp +162 -39
  110. data/rice.gemspec +1 -3
  111. data/test/test_Array.cpp +261 -3
  112. data/test/test_Attribute.cpp +6 -3
  113. data/test/test_Buffer.cpp +6 -42
  114. data/test/test_Callback.cpp +77 -23
  115. data/test/test_Data_Object.cpp +1 -1
  116. data/test/test_Data_Type.cpp +21 -22
  117. data/test/test_Director.cpp +2 -4
  118. data/test/test_Enum.cpp +34 -5
  119. data/test/test_File.cpp +9 -5
  120. data/test/test_From_Ruby.cpp +4 -3
  121. data/test/test_GVL.cpp +3 -3
  122. data/test/test_Hash.cpp +1 -1
  123. data/test/test_Iterator.cpp +54 -22
  124. data/test/test_Keep_Alive.cpp +1 -1
  125. data/test/test_Keep_Alive_No_Wrapper.cpp +1 -1
  126. data/test/test_Module.cpp +5 -5
  127. data/test/test_Overloads.cpp +345 -48
  128. data/test/test_Proc.cpp +54 -0
  129. data/test/test_Reference.cpp +181 -0
  130. data/test/test_Self.cpp +2 -2
  131. data/test/test_Stl_Set.cpp +6 -6
  132. data/test/test_Stl_SharedPtr.cpp +54 -30
  133. data/test/test_Stl_String_View.cpp +4 -2
  134. data/test/test_Stl_Tuple.cpp +1 -1
  135. data/test/test_Stl_Variant.cpp +6 -14
  136. data/test/test_Stl_Vector.cpp +61 -30
  137. data/test/test_String.cpp +4 -2
  138. data/test/test_Struct.cpp +1 -1
  139. data/test/test_Symbol.cpp +1 -1
  140. data/test/test_To_Ruby.cpp +1 -0
  141. data/test/test_Type.cpp +36 -35
  142. data/test/test_global_functions.cpp +1 -1
  143. data/test/unittest.cpp +1 -1
  144. data/test/unittest.hpp +5 -5
  145. metadata +10 -10
  146. data/rice/Function.hpp +0 -17
  147. data/rice/Function.ipp +0 -13
  148. data/rice/detail/MethodInfo.hpp +0 -48
  149. data/rice/detail/MethodInfo.ipp +0 -99
  150. data/rice/detail/NativeCallbackFFI.hpp +0 -55
  151. data/rice/detail/NativeCallbackFFI.ipp +0 -152
  152. data/rice/detail/NativeCallbackSimple.hpp +0 -30
  153. data/rice/detail/NativeCallbackSimple.ipp +0 -29
@@ -0,0 +1,70 @@
1
+ require 'yaml'
2
+
3
+ module Rice
4
+ module Doc
5
+ class Config
6
+ attr_reader :extension, :output, :resolvers
7
+
8
+ def initialize(config_path)
9
+ config = YAML.load_file(config_path)
10
+ base_dir = File.dirname(config_path)
11
+ @extension = File.expand_path(config['extension'], base_dir)
12
+ @output = File.expand_path(config['output'], base_dir)
13
+ @resolvers = build_resolvers(config['namespaces'] || {})
14
+ end
15
+
16
+ private
17
+
18
+ def build_resolvers(namespace_configs)
19
+ # Always include Ruby resolver for core types
20
+ result = { nil => Ruby.new }
21
+
22
+ namespace_configs.each do |namespace, config|
23
+ key = namespace == 'default' ? nil : namespace
24
+ result[key] = build_resolver(config)
25
+ end
26
+ result
27
+ end
28
+
29
+ def build_resolver(config)
30
+ resolver = config['resolver']
31
+ case resolver
32
+ when 'cppreference'
33
+ build_cppreference_resolver(config)
34
+ when 'doxygen'
35
+ build_doxygen_resolver(config)
36
+ when 'rice'
37
+ build_rice_resolver(config)
38
+ else
39
+ raise "Unknown resolver: #{resolver}"
40
+ end
41
+ end
42
+
43
+ def build_cppreference_resolver(config)
44
+ CppReference.new
45
+ end
46
+
47
+ def build_doxygen_resolver(config)
48
+ root = config['root']
49
+ tagfile = config['tagfile']
50
+ type_mappings = build_type_mappings(config['type_mappings'] || [])
51
+ method_mappings = config['method_mappings'] || {}
52
+ Doxygen.new(root, tagfile, type_mappings, method_mappings)
53
+ end
54
+
55
+ def build_rice_resolver(config)
56
+ Rice.new
57
+ end
58
+
59
+ def build_type_mappings(mappings)
60
+ result = {}
61
+ mappings.each do |mapping|
62
+ pattern = Regexp.new(mapping['pattern'], Regexp::IGNORECASE)
63
+ replacement = mapping['replacement'] || ''
64
+ result[pattern] = replacement
65
+ end
66
+ result
67
+ end
68
+ end
69
+ end
70
+ end
@@ -91,8 +91,6 @@ module Rice
91
91
  node = class_node(klass)
92
92
  if node
93
93
  path = node.attributes["link"]
94
- name = cpp_name(klass)
95
- parts = name.split("::")
96
94
  "#{ROOT}/#{path}"
97
95
  end
98
96
  end
@@ -105,7 +103,6 @@ module Rice
105
103
  end
106
104
 
107
105
  def module_url(klass)
108
- a = 1
109
106
  end
110
107
 
111
108
  def method_url(klass, native)
@@ -155,7 +152,7 @@ module Rice
155
152
  link = member_node.attributes["link"]
156
153
  if member_node && link && link != "."
157
154
  "#{class_base(klass)}/#{member_node.attributes['link']}.html"
158
- elsif member_node && link && link == "."
155
+ elsif member_node && link && link == "."
159
156
  "#{class_base(klass)}.html"
160
157
  elsif member_node
161
158
  "#{class_base(klass)}/#{member_node.attributes['name']}.html"
@@ -35,6 +35,46 @@ module Rice
35
35
  write_class(klass)
36
36
  end
37
37
  end
38
+
39
+ create_indexes
40
+ end
41
+
42
+ def create_indexes
43
+ # Find all directories (including output root)
44
+ directories = Dir.glob(File.join(@output, '**', '*')).select { |f| File.directory?(f) }
45
+ directories.unshift(@output)
46
+
47
+ directories.each do |dir|
48
+ entries = []
49
+ has_index = File.exist?(File.join(dir, 'index.md'))
50
+
51
+ # Get all .md files in this directory (excluding index.md)
52
+ Dir.glob(File.join(dir, '*.md')).each do |file|
53
+ basename = File.basename(file)
54
+ entries << basename unless basename == 'index.md'
55
+ end
56
+
57
+ # Get all subdirectories
58
+ Dir.glob(File.join(dir, '*')).each do |path|
59
+ if File.directory?(path)
60
+ entries << File.basename(path)
61
+ end
62
+ end
63
+
64
+ # Sort alphabetically
65
+ entries.sort!
66
+
67
+ # Prepend index.md if it exists
68
+ entries.unshift('index.md') if has_index
69
+
70
+ pages_path = File.join(dir, '.pages')
71
+ File.open(pages_path, 'w') do |file|
72
+ file << "nav:\n"
73
+ entries.each do |entry|
74
+ file << " - #{entry}\n"
75
+ end
76
+ end
77
+ end
38
78
  end
39
79
 
40
80
  def output_path(klass)
@@ -127,7 +167,6 @@ module Rice
127
167
 
128
168
  def parameters_sig(klass, native)
129
169
  native.parameters.map do |parameter|
130
- resolver = resolver(parameter.klass)
131
170
  url = type_url(parameter.klass)
132
171
  if url
133
172
  "#{parameter.arg.name}: [#{parameter.klass}](#{url})"
@@ -138,7 +177,6 @@ module Rice
138
177
  end
139
178
 
140
179
  def return_sig(klass, native)
141
- resolver = resolver(native.return_klass)
142
180
  url = type_url(native.return_klass)
143
181
  if url
144
182
  "[#{native.return_klass}](#{url})"
@@ -166,10 +204,16 @@ module Rice
166
204
 
167
205
  name = ESCAPE_METHODS[native.name] || native.name
168
206
 
169
- if url
170
- "[#{name}](#{url})(#{parameters_sig(klass, native)}) -> #{return_sig(klass, native)}"
207
+ parameters_string = if native.parameters.empty?
208
+ ""
209
+ else
210
+ "(#{parameters_sig(klass, native)})"
211
+ end
212
+
213
+ if url
214
+ "[#{name}](#{url})#{parameters_string} -> #{return_sig(klass, native)}"
171
215
  else
172
- "#{name}(#{parameters_sig(klass, native)}) -> #{return_sig(klass, native)}"
216
+ "#{name}#{parameters_string} -> #{return_sig(klass, native)}"
173
217
  end
174
218
  end
175
219
 
@@ -187,7 +231,6 @@ module Rice
187
231
  attribute_resolver = resolver(klass)
188
232
  attribute_url = attribute_resolver&.attribute_url(klass, native_attribute)
189
233
 
190
- type_resolver = resolver(native_attribute.return_klass)
191
234
  type_url = type_url(native_attribute.return_klass)
192
235
 
193
236
  if attribute_url
@@ -198,24 +241,23 @@ module Rice
198
241
  end
199
242
 
200
243
  def write_module(a_module)
201
- native_singleton_functions = Registries.instance.natives.native_singleton_functions(a_module).sort.group_by(&:name)
244
+ native_singleton_functions = Registries.instance.natives.native_functions(a_module.singleton_class).sort.group_by(&:name)
245
+ return if native_singleton_functions.empty?
202
246
 
203
247
  path = output_path(a_module)
204
248
  File.open(path, 'w') do |file|
205
249
  file << "#" << a_module.name << "\n"
206
- unless native_singleton_functions.empty?
207
- file << "## Singleton Methods" << "\n"
208
- native_singleton_functions.each do |name, natives|
209
- file << method_sigs(a_module, natives, false) << "\n\n"
210
- end
211
- file << "\n"
250
+ file << "## Singleton Methods" << "\n"
251
+ native_singleton_functions.each do |name, natives|
252
+ file << method_sigs(a_module, natives, false) << "\n\n"
212
253
  end
213
- end
254
+ file << "\n"
255
+ end
214
256
  end
215
257
 
216
258
  def write_class(klass)
217
259
  native_attributes = Registries.instance.natives.native_attributes(klass).sort.group_by(&:name)
218
- native_singleton_functions = Registries.instance.natives.native_singleton_functions(klass).sort.group_by(&:name)
260
+ native_singleton_functions = Registries.instance.natives.native_functions(klass.singleton_class).sort.group_by(&:name)
219
261
  native_methods = Registries.instance.natives.native_methods(klass).sort.group_by(&:name)
220
262
 
221
263
  path = output_path(klass)
@@ -232,7 +274,7 @@ module Rice
232
274
  end
233
275
 
234
276
  # Constructors
235
- constructors = native_methods["initialize"]
277
+ constructors = native_methods.delete("initialize")
236
278
  if constructors
237
279
  file << "## Constructors" << "\n"
238
280
  constructors.each do |constructor|
@@ -254,7 +296,6 @@ module Rice
254
296
  unless native_methods.empty?
255
297
  file << "## Methods" << "\n"
256
298
  native_methods.each do |name, natives|
257
- next if name == "initialize"
258
299
  file << method_sigs(klass, natives, false) << "\n\n"
259
300
  end
260
301
  file << "\n"
@@ -263,8 +304,6 @@ module Rice
263
304
  end
264
305
 
265
306
  def write_enum(klass)
266
- klass_name = klass.name.split('::').last
267
-
268
307
  path = output_path(klass)
269
308
  File.open(path, 'w') do |file|
270
309
  file << enum_sig(klass) << "\n"
@@ -276,7 +315,6 @@ module Rice
276
315
  end
277
316
 
278
317
  def write_union(klass)
279
- klass_name = klass.name.split('::').last
280
318
  native_attributes = Registries.instance.natives.native_attributes(klass).sort.group_by(&:name)
281
319
 
282
320
  path = output_path(klass)
data/lib/rice/doc/rice.rb CHANGED
@@ -1,28 +1,48 @@
1
1
  module Rice
2
2
  module Doc
3
3
  class Rice
4
+ ROOT = "https://ruby-rice.github.io/4.x"
5
+
6
+ CLASS_DOCS = {
7
+ /^Rice::Buffer/ => "ruby_api/buffer",
8
+ /^Rice::Pointer/ => "ruby_api/pointer"
9
+ }
10
+
4
11
  def class_url(klass)
12
+ CLASS_DOCS.each do |pattern, path|
13
+ if klass.name.match?(pattern)
14
+ return "#{ROOT}/#{path}"
15
+ end
16
+ end
17
+ nil
5
18
  end
6
19
 
7
20
  def module_url(klass)
21
+ nil
8
22
  end
9
23
 
10
24
  def union_url(klass)
25
+ nil
11
26
  end
12
27
 
13
28
  def enum_url(klass)
29
+ nil
14
30
  end
15
31
 
16
32
  def enum_value_url(klass, enum_value)
33
+ nil
17
34
  end
18
35
 
19
36
  def singleton_method_url(klass, native)
37
+ nil
20
38
  end
21
39
 
22
40
  def method_url(klass, native)
41
+ class_url(klass)
23
42
  end
24
43
 
25
44
  def attribute_url(klass, native)
45
+ nil
26
46
  end
27
47
  end
28
48
  end
data/lib/rice/doc.rb CHANGED
@@ -3,3 +3,4 @@ require_relative 'doc/doxygen'
3
3
  require_relative 'doc/rice'
4
4
  require_relative 'doc/ruby'
5
5
  require_relative 'doc/mkdocs'
6
+ require_relative 'doc/config'
@@ -56,6 +56,13 @@ end
56
56
  def combine_headers(filename)
57
57
  stream = StringIO.new
58
58
 
59
+ stream << "// This file is part of [rice](https://github.com/ruby-rice/rice).\n"
60
+ stream << "//\n"
61
+ load_file("COPYING").each_line do |line|
62
+ stream << (line.strip.size.zero? ? "//\n" : "// #{line}")
63
+ end
64
+ stream << "\n"
65
+
59
66
  load_file("rice/#{filename}").each_line do |line|
60
67
  if matches = line.match(RICE_INCLUDE_REGEX)
61
68
  path = File.join("rice", matches[1])
@@ -8,8 +8,8 @@ module Rice
8
8
  self.native_by_kind(klass, [Rice::NativeKind::Method])
9
9
  end
10
10
 
11
- def native_singleton_functions(klass)
12
- self.native_by_kind(klass.singleton_class, [Rice::NativeKind::Function])
11
+ def native_functions(klass)
12
+ self.native_by_kind(klass, [Rice::NativeKind::Function])
13
13
  end
14
14
 
15
15
  def native_by_kind(klass, kinds)
data/lib/rice/rbs.rb CHANGED
@@ -54,7 +54,7 @@ module Rice
54
54
  else
55
55
  "attr_writer"
56
56
  end
57
- "#{attr_type} #{native_attributes.first.name}: #{native_attributes.first.return_type}"
57
+ "#{attr_type} #{native_attributes.first.name}: #{native_attributes.first.return_klass}"
58
58
  end
59
59
 
60
60
  def method_sigs(native_methods, indent = 0)
@@ -69,7 +69,7 @@ module Rice
69
69
  params = native.parameters.map do |parameter|
70
70
  "#{parameter.arg.name}: #{parameter.klass}"
71
71
  end.join(", ")
72
- "(#{params}) -> #{native.return_type}"
72
+ "(#{params}) -> #{native.return_klass}"
73
73
  end
74
74
 
75
75
  def render_template(template, local_variables = {})
data/lib/rice/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rice
2
- VERSION = "4.7.1"
2
+ VERSION = "4.8.0"
3
3
  end
@@ -1,9 +1,12 @@
1
- # Create RubyGems hook so we can replace the default CMakeBuilder with our own version
2
- Gem.pre_install do |installer|
3
- extensions = installer.package&.spec&.extensions
4
- if extensions && extensions.grep(/CMakeLists/)
5
- require_relative 'rubygems/builder'
6
- require_relative 'rubygems/cmake_builder'
7
- end
8
- true
9
- end
1
+ # For older versions of RubyGems replace the default CMakeBuilder with a
2
+ # more modern one
3
+ if Gem.rubygems_version < Gem::Version.new('4.0')
4
+ Gem.pre_install do |installer|
5
+ extensions = installer.package&.spec&.extensions
6
+ if extensions && extensions.grep(/CMakeLists/)
7
+ require_relative 'rubygems/builder'
8
+ require_relative 'rubygems/cmake_builder'
9
+ end
10
+ true
11
+ end
12
+ end
data/rice/Arg.hpp CHANGED
@@ -70,6 +70,12 @@ namespace Rice
70
70
  //! Returns if the argument should be treated as a value
71
71
  bool isValue() const;
72
72
 
73
+ //! Specifies if the argument should capture a block
74
+ virtual Arg& setBlock();
75
+
76
+ //! Returns if the argument should capture a block
77
+ bool isBlock() const;
78
+
73
79
  //! Specifies if the argument is opaque and Rice should not convert it from Ruby to C++ or vice versa.
74
80
  //! This is useful for callbacks and user provided data paramameters.
75
81
  virtual Arg& setOpaque();
@@ -81,23 +87,23 @@ namespace Rice
81
87
  virtual Arg& takeOwnership();
82
88
  bool isOwner();
83
89
 
84
- //! Is the parameter a buffer
85
- virtual Arg& setBuffer();
86
- bool isBuffer();
87
-
88
90
  public:
89
91
  std::string name;
90
- int32_t position = -1;
91
92
 
92
93
  private:
93
94
  //! Our saved default value
94
95
  std::any defaultValue_;
95
96
  bool isValue_ = false;
97
+ bool isBlock_ = false;
96
98
  bool isKeepAlive_ = false;
97
99
  bool isOwner_ = false;
98
100
  bool isOpaque_ = false;
99
- bool isBuffer_ = false;
101
+ };
100
102
 
103
+ class ArgBuffer : public Arg
104
+ {
105
+ public:
106
+ ArgBuffer(std::string name);
101
107
  };
102
108
  } // Rice
103
109
 
data/rice/Arg.ipp CHANGED
@@ -48,6 +48,18 @@ namespace Rice
48
48
  return isValue_;
49
49
  }
50
50
 
51
+ inline Arg& Arg::setBlock()
52
+ {
53
+ isBlock_ = true;
54
+ isValue_ = true;
55
+ return *this;
56
+ }
57
+
58
+ inline bool Arg::isBlock() const
59
+ {
60
+ return isBlock_;
61
+ }
62
+
51
63
  inline Arg& Arg::setOpaque()
52
64
  {
53
65
  isOpaque_ = true;
@@ -70,14 +82,9 @@ namespace Rice
70
82
  return this->isOwner_;
71
83
  }
72
84
 
73
- inline Arg& Arg::setBuffer()
85
+ inline ArgBuffer::ArgBuffer(std::string name) : Arg(name)
74
86
  {
75
- this->isBuffer_ = true;
76
- return *this;
77
87
  }
78
88
 
79
- inline bool Arg::isBuffer()
80
- {
81
- return this->isBuffer_;
82
- }
89
+
83
90
  } // Rice