rice 2.1.0 → 3.0.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 (83) hide show
  1. checksums.yaml +5 -5
  2. data/COPYING +2 -2
  3. data/Doxyfile +4 -16
  4. data/Makefile.am +2 -2
  5. data/Makefile.in +28 -17
  6. data/{README → README.md} +323 -328
  7. data/aclocal.m4 +104 -107
  8. data/ax_cxx_compile_stdcxx.m4 +951 -0
  9. data/configure +549 -238
  10. data/configure.ac +3 -3
  11. data/extconf.rb +11 -10
  12. data/rice/Array.hpp +16 -16
  13. data/rice/Array.ipp +11 -11
  14. data/rice/Class_defn.hpp +1 -0
  15. data/rice/Constructor.hpp +27 -371
  16. data/rice/Data_Object_defn.hpp +3 -3
  17. data/rice/Director.hpp +3 -3
  18. data/rice/Enum.ipp +1 -1
  19. data/rice/Exception.cpp +2 -7
  20. data/rice/Hash.hpp +8 -5
  21. data/rice/Hash.ipp +2 -2
  22. data/rice/Makefile.am +1 -4
  23. data/rice/Makefile.in +80 -35
  24. data/rice/Module_impl.ipp +1 -1
  25. data/rice/Object.cpp +1 -1
  26. data/rice/Object.ipp +15 -1
  27. data/rice/Object_defn.hpp +24 -1
  28. data/rice/String.cpp +2 -7
  29. data/rice/Struct.cpp +2 -2
  30. data/rice/Struct.hpp +1 -1
  31. data/rice/Struct.ipp +1 -1
  32. data/rice/config.hpp +2 -2
  33. data/rice/config.hpp.in +2 -2
  34. data/rice/detail/Arguments.hpp +1 -1
  35. data/rice/detail/Auto_Function_Wrapper.ipp +512 -1025
  36. data/rice/detail/Auto_Member_Function_Wrapper.ipp +272 -545
  37. data/rice/detail/Iterator.hpp +2 -2
  38. data/rice/detail/method_data.cpp +8 -2
  39. data/rice/detail/ruby.hpp +1 -4
  40. data/rice/detail/ruby_version_code.hpp +1 -1
  41. data/rice/detail/wrap_function.hpp +32 -307
  42. data/rice/protect.hpp +3 -57
  43. data/rice/to_from_ruby.ipp +128 -4
  44. data/ruby/Makefile.in +11 -8
  45. data/ruby/lib/Makefile.in +10 -7
  46. data/ruby/lib/version.rb +1 -1
  47. data/sample/Makefile.am +10 -4
  48. data/sample/Makefile.in +20 -11
  49. data/sample/callbacks/extconf.rb +3 -0
  50. data/sample/callbacks/sample_callbacks.cpp +38 -0
  51. data/sample/callbacks/test.rb +28 -0
  52. data/test/Makefile.am +1 -0
  53. data/test/Makefile.in +118 -49
  54. data/test/embed_ruby.cpp +21 -0
  55. data/test/embed_ruby.hpp +4 -0
  56. data/test/ext/Makefile.in +10 -7
  57. data/test/test_Address_Registration_Guard.cpp +2 -1
  58. data/test/test_Array.cpp +2 -1
  59. data/test/test_Builtin_Object.cpp +2 -1
  60. data/test/test_Class.cpp +7 -4
  61. data/test/test_Data_Object.cpp +2 -1
  62. data/test/test_Data_Type.cpp +2 -1
  63. data/test/test_Director.cpp +2 -1
  64. data/test/test_Enum.cpp +24 -3
  65. data/test/test_Exception.cpp +2 -1
  66. data/test/test_Hash.cpp +2 -1
  67. data/test/test_Identifier.cpp +2 -1
  68. data/test/test_Memory_Management.cpp +2 -1
  69. data/test/test_Module.cpp +2 -1
  70. data/test/test_Object.cpp +13 -1
  71. data/test/test_String.cpp +2 -1
  72. data/test/test_Struct.cpp +2 -1
  73. data/test/test_Symbol.cpp +2 -1
  74. data/test/test_To_From_Ruby.cpp +102 -1
  75. data/test/test_global_functions.cpp +2 -1
  76. data/test/test_rice.rb +4 -0
  77. data/test/unittest.cpp +35 -9
  78. metadata +72 -16
  79. data/check_stdcxx_11.ac +0 -142
  80. data/rice/detail/object_call.hpp +0 -69
  81. data/rice/detail/object_call.ipp +0 -131
  82. data/rice/detail/traits.hpp +0 -43
  83. data/rice/detail/wrap_function.ipp +0 -514
@@ -62,7 +62,7 @@ public:
62
62
  typedef void (*Ruby_Data_Func)(T * obj);
63
63
 
64
64
  //! Wrap a C++ object.
65
- /*! This constructor is analgous to calling Data_Wrap_Struct. Be
65
+ /*! This constructor is analogous to calling Data_Wrap_Struct. Be
66
66
  * careful not to call this function more than once for the same
67
67
  * pointer (in general, it should only be called for newly
68
68
  * constructed objects that need to be managed by Ruby's garbage
@@ -82,7 +82,7 @@ public:
82
82
  Ruby_Data_Func free_func = Default_Free_Function<T>::free);
83
83
 
84
84
  //! Unwrap a Ruby object.
85
- /*! This constructor is analgous to calling Data_Get_Struct. Uses
85
+ /*! This constructor is analogous to calling Data_Get_Struct. Uses
86
86
  * Data_Type<T>::klass as the class of the object.
87
87
  * \param value the Ruby object to unwrap.
88
88
  */
@@ -90,7 +90,7 @@ public:
90
90
  Object value);
91
91
 
92
92
  //! Unwrap a Ruby object.
93
- /*! This constructor is analgous to calling Data_Get_Struct. Will
93
+ /*! This constructor is analogous to calling Data_Get_Struct. Will
94
94
  * throw an exception if the class of the object differs from the
95
95
  * specified class.
96
96
  * \param value the Ruby object to unwrap.
@@ -10,10 +10,10 @@ namespace Rice {
10
10
  * You use this class to help build proxy classes so that polymorphism
11
11
  * works from C++ into Ruby. See the main README for how this class works.
12
12
  */
13
- class Director
13
+ class Director
14
14
  {
15
15
  public:
16
- //! Construct new Director. Needs the Ruby object so that the
16
+ //! Construct new Director. Needs the Ruby object so that the
17
17
  // proxy class can call methods on that object.
18
18
  Director(Object self);
19
19
 
@@ -21,7 +21,7 @@ namespace Rice {
21
21
 
22
22
  //! Raise a ruby exception when a call comes through for a pure virtual method
23
23
  /*! If a Ruby script calls 'super' on a method that's otherwise a pure virtual
24
- * method, use this method to throw an exception in this case.
24
+ * method, use this method to throw an exception in this case.
25
25
  */
26
26
  void raisePureVirtual() const;
27
27
 
@@ -75,7 +75,7 @@ initialize(
75
75
  .define_method("to_i", to_i)
76
76
  .define_method("inspect", inspect)
77
77
  .define_method("<=>", compare)
78
- //.define_method("hash", hash)
78
+ .define_method("hash", hash)
79
79
  .define_method("eql?", eql)
80
80
  .define_method("==", eql)
81
81
  .define_method("===", eql)
@@ -3,13 +3,8 @@
3
3
  #include "to_from_ruby.hpp"
4
4
  #include "detail/ruby.hpp"
5
5
 
6
- #ifdef HAVE_STDARG_PROTOTYPES
7
6
  #include <stdarg.h>
8
7
  #define va_init_list(a,b) va_start(a,b)
9
- #else
10
- #include <varargs.h>
11
- #define va_init_list(a,b) va_start(a)
12
- #endif
13
8
 
14
9
  Rice::Exception::
15
10
  Exception(VALUE e)
@@ -35,7 +30,7 @@ Exception(Object exc, char const * fmt, ...)
35
30
  {
36
31
  va_list args;
37
32
  char buf[BUFSIZ];
38
-
33
+
39
34
  va_init_list(args, fmt);
40
35
  vsnprintf(buf, BUFSIZ, fmt, args);
41
36
  buf[BUFSIZ - 1] = '\0';
@@ -54,6 +49,6 @@ char const * Rice::Exception::
54
49
  what() const throw()
55
50
  {
56
51
  message_ = message();
57
- return from_ruby<std::string>(message_).c_str();
52
+ return from_ruby<char const *>(message_);
58
53
  }
59
54
 
@@ -5,8 +5,8 @@
5
5
  #include "Array.hpp"
6
6
  #include "to_from_ruby_defn.hpp"
7
7
  #include "detail/ruby.hpp"
8
- #include "detail/traits.hpp"
9
8
  #include <iterator>
9
+ #include <type_traits>
10
10
 
11
11
  namespace Rice
12
12
  {
@@ -146,11 +146,14 @@ bool operator<(Hash::Entry const & lhs, Hash::Entry const & rhs);
146
146
  //! A helper class for implementing iterators for a Hash.
147
147
  template<typename Hash_Ref_T, typename Value_T>
148
148
  class Hash::Iterator
149
- : public std::iterator<
150
- std::input_iterator_tag,
151
- Value_T>
152
149
  {
153
150
  public:
151
+ using iterator_category = std::input_iterator_tag;
152
+ using value_type = Value_T;
153
+ using difference_type = long;
154
+ using pointer = Object*;
155
+ using reference = Value_T&;
156
+
154
157
  //! Construct a new Iterator.
155
158
  Iterator(Hash_Ref_T hash);
156
159
 
@@ -202,7 +205,7 @@ private:
202
205
  size_t current_index_;
203
206
  VALUE keys_;
204
207
 
205
- mutable typename detail::remove_const<Value_T>::Type tmp_;
208
+ mutable typename std::remove_const<Value_T>::type tmp_;
206
209
  };
207
210
 
208
211
  } // namespace Rice
@@ -292,13 +292,13 @@ begin() const
292
292
  inline Rice::Hash::iterator Rice::Hash::
293
293
  end()
294
294
  {
295
- return iterator(*this, size());
295
+ return iterator(*this, (int)size());
296
296
  }
297
297
 
298
298
  inline Rice::Hash::const_iterator Rice::Hash::
299
299
  end() const
300
300
  {
301
- return const_iterator(*this, size());
301
+ return const_iterator(*this, (int)size());
302
302
  }
303
303
 
304
304
  inline bool Rice::
@@ -78,6 +78,7 @@ to_from_ruby.hpp \
78
78
  to_from_ruby.ipp \
79
79
  to_from_ruby_defn.hpp \
80
80
  ruby_mark.hpp \
81
+ config.hpp \
81
82
  detail/Auto_Function_Wrapper.hpp \
82
83
  detail/Auto_Function_Wrapper.ipp \
83
84
  detail/Auto_Member_Function_Wrapper.hpp \
@@ -103,17 +104,13 @@ detail/from_ruby.hpp \
103
104
  detail/from_ruby.ipp \
104
105
  detail/method_data.hpp \
105
106
  detail/node.hpp \
106
- detail/object_call.hpp \
107
- detail/object_call.ipp \
108
107
  detail/protect.hpp \
109
108
  detail/ruby.hpp \
110
109
  detail/st.hpp \
111
- detail/traits.hpp \
112
110
  detail/to_ruby.hpp \
113
111
  detail/to_ruby.ipp \
114
112
  detail/win32.hpp \
115
113
  detail/wrap_function.hpp \
116
- detail/wrap_function.ipp \
117
114
  detail/ruby_version_code.hpp
118
115
 
119
116
  includedir = ${prefix}/include/rice
@@ -1,7 +1,7 @@
1
- # Makefile.in generated by automake 1.15 from Makefile.am.
1
+ # Makefile.in generated by automake 1.16.3 from Makefile.am.
2
2
  # @configure_input@
3
3
 
4
- # Copyright (C) 1994-2014 Free Software Foundation, Inc.
4
+ # Copyright (C) 1994-2020 Free Software Foundation, Inc.
5
5
 
6
6
  # This Makefile.in is free software; the Free Software Foundation
7
7
  # gives unlimited permission to copy and/or distribute it,
@@ -91,7 +91,7 @@ build_triplet = @build@
91
91
  host_triplet = @host@
92
92
  subdir = rice
93
93
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
94
- am__aclocal_m4_deps = $(top_srcdir)/check_stdcxx_11.ac \
94
+ am__aclocal_m4_deps = $(top_srcdir)/ax_cxx_compile_stdcxx.m4 \
95
95
  $(top_srcdir)/ruby.ac $(top_srcdir)/doxygen.ac \
96
96
  $(top_srcdir)/configure.ac
97
97
  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -162,7 +162,16 @@ am__v_at_0 = @
162
162
  am__v_at_1 =
163
163
  DEFAULT_INCLUDES = -I.@am__isrc@
164
164
  depcomp = $(SHELL) $(top_srcdir)/depcomp
165
- am__depfiles_maybe = depfiles
165
+ am__maybe_remake_depfiles = depfiles
166
+ am__depfiles_remade = ./$(DEPDIR)/Address_Registration_Guard.Po \
167
+ ./$(DEPDIR)/Arg_operators.Po ./$(DEPDIR)/Class.Po \
168
+ ./$(DEPDIR)/Data_Type.Po ./$(DEPDIR)/Director.Po \
169
+ ./$(DEPDIR)/Exception.Po ./$(DEPDIR)/Identifier.Po \
170
+ ./$(DEPDIR)/Module.Po ./$(DEPDIR)/Object.Po \
171
+ ./$(DEPDIR)/String.Po ./$(DEPDIR)/Struct.Po \
172
+ ./$(DEPDIR)/Symbol.Po detail/$(DEPDIR)/check_ruby_type.Po \
173
+ detail/$(DEPDIR)/demangle.Po detail/$(DEPDIR)/method_data.Po \
174
+ detail/$(DEPDIR)/protect.Po
166
175
  am__mv = mv -f
167
176
  CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
168
177
  $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -185,8 +194,8 @@ am__can_run_installinfo = \
185
194
  *) (install-info --version) >/dev/null 2>&1;; \
186
195
  esac
187
196
  HEADERS = $(nobase_include_HEADERS)
188
- am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
189
- $(LISP)config.hpp.in
197
+ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
198
+ config.hpp.in
190
199
  # Read a list of newline-separated strings from the standard input,
191
200
  # and print each of them once, without duplicates. Input order is
192
201
  # *not* preserved.
@@ -250,7 +259,7 @@ ECHO_C = @ECHO_C@
250
259
  ECHO_N = @ECHO_N@
251
260
  ECHO_T = @ECHO_T@
252
261
  EXEEXT = @EXEEXT@
253
- HAVE_CXX11 = @HAVE_CXX11@
262
+ HAVE_CXX14 = @HAVE_CXX14@
254
263
  INSTALL = @INSTALL@
255
264
  INSTALL_DATA = @INSTALL_DATA@
256
265
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -420,6 +429,7 @@ to_from_ruby.hpp \
420
429
  to_from_ruby.ipp \
421
430
  to_from_ruby_defn.hpp \
422
431
  ruby_mark.hpp \
432
+ config.hpp \
423
433
  detail/Auto_Function_Wrapper.hpp \
424
434
  detail/Auto_Function_Wrapper.ipp \
425
435
  detail/Auto_Member_Function_Wrapper.hpp \
@@ -445,17 +455,13 @@ detail/from_ruby.hpp \
445
455
  detail/from_ruby.ipp \
446
456
  detail/method_data.hpp \
447
457
  detail/node.hpp \
448
- detail/object_call.hpp \
449
- detail/object_call.ipp \
450
458
  detail/protect.hpp \
451
459
  detail/ruby.hpp \
452
460
  detail/st.hpp \
453
- detail/traits.hpp \
454
461
  detail/to_ruby.hpp \
455
462
  detail/to_ruby.ipp \
456
463
  detail/win32.hpp \
457
464
  detail/wrap_function.hpp \
458
- detail/wrap_function.ipp \
459
465
  detail/ruby_version_code.hpp
460
466
 
461
467
  AM_CPPFLAGS = @RUBY_CPPFLAGS@
@@ -482,8 +488,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
482
488
  *config.status*) \
483
489
  cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
484
490
  *) \
485
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
486
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
491
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
492
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
487
493
  esac;
488
494
 
489
495
  $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -567,22 +573,28 @@ mostlyclean-compile:
567
573
  distclean-compile:
568
574
  -rm -f *.tab.c
569
575
 
570
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Address_Registration_Guard.Po@am__quote@
571
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Arg_operators.Po@am__quote@
572
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Class.Po@am__quote@
573
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Data_Type.Po@am__quote@
574
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Director.Po@am__quote@
575
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Exception.Po@am__quote@
576
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Identifier.Po@am__quote@
577
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Module.Po@am__quote@
578
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Object.Po@am__quote@
579
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/String.Po@am__quote@
580
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Struct.Po@am__quote@
581
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Symbol.Po@am__quote@
582
- @AMDEP_TRUE@@am__include@ @am__quote@detail/$(DEPDIR)/check_ruby_type.Po@am__quote@
583
- @AMDEP_TRUE@@am__include@ @am__quote@detail/$(DEPDIR)/demangle.Po@am__quote@
584
- @AMDEP_TRUE@@am__include@ @am__quote@detail/$(DEPDIR)/method_data.Po@am__quote@
585
- @AMDEP_TRUE@@am__include@ @am__quote@detail/$(DEPDIR)/protect.Po@am__quote@
576
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Address_Registration_Guard.Po@am__quote@ # am--include-marker
577
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Arg_operators.Po@am__quote@ # am--include-marker
578
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Class.Po@am__quote@ # am--include-marker
579
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Data_Type.Po@am__quote@ # am--include-marker
580
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Director.Po@am__quote@ # am--include-marker
581
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Exception.Po@am__quote@ # am--include-marker
582
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Identifier.Po@am__quote@ # am--include-marker
583
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Module.Po@am__quote@ # am--include-marker
584
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Object.Po@am__quote@ # am--include-marker
585
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/String.Po@am__quote@ # am--include-marker
586
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Struct.Po@am__quote@ # am--include-marker
587
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Symbol.Po@am__quote@ # am--include-marker
588
+ @AMDEP_TRUE@@am__include@ @am__quote@detail/$(DEPDIR)/check_ruby_type.Po@am__quote@ # am--include-marker
589
+ @AMDEP_TRUE@@am__include@ @am__quote@detail/$(DEPDIR)/demangle.Po@am__quote@ # am--include-marker
590
+ @AMDEP_TRUE@@am__include@ @am__quote@detail/$(DEPDIR)/method_data.Po@am__quote@ # am--include-marker
591
+ @AMDEP_TRUE@@am__include@ @am__quote@detail/$(DEPDIR)/protect.Po@am__quote@ # am--include-marker
592
+
593
+ $(am__depfiles_remade):
594
+ @$(MKDIR_P) $(@D)
595
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
596
+
597
+ am--depfiles: $(am__depfiles_remade)
586
598
 
587
599
  .cpp.o:
588
600
  @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -676,7 +688,10 @@ cscopelist-am: $(am__tagged_files)
676
688
  distclean-tags:
677
689
  -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
678
690
 
679
- distdir: $(DISTFILES)
691
+ distdir: $(BUILT_SOURCES)
692
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
693
+
694
+ distdir-am: $(DISTFILES)
680
695
  @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
681
696
  topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
682
697
  list='$(DISTFILES)'; \
@@ -750,7 +765,22 @@ clean: clean-am
750
765
  clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
751
766
 
752
767
  distclean: distclean-am
753
- -rm -rf ./$(DEPDIR) detail/$(DEPDIR)
768
+ -rm -f ./$(DEPDIR)/Address_Registration_Guard.Po
769
+ -rm -f ./$(DEPDIR)/Arg_operators.Po
770
+ -rm -f ./$(DEPDIR)/Class.Po
771
+ -rm -f ./$(DEPDIR)/Data_Type.Po
772
+ -rm -f ./$(DEPDIR)/Director.Po
773
+ -rm -f ./$(DEPDIR)/Exception.Po
774
+ -rm -f ./$(DEPDIR)/Identifier.Po
775
+ -rm -f ./$(DEPDIR)/Module.Po
776
+ -rm -f ./$(DEPDIR)/Object.Po
777
+ -rm -f ./$(DEPDIR)/String.Po
778
+ -rm -f ./$(DEPDIR)/Struct.Po
779
+ -rm -f ./$(DEPDIR)/Symbol.Po
780
+ -rm -f detail/$(DEPDIR)/check_ruby_type.Po
781
+ -rm -f detail/$(DEPDIR)/demangle.Po
782
+ -rm -f detail/$(DEPDIR)/method_data.Po
783
+ -rm -f detail/$(DEPDIR)/protect.Po
754
784
  -rm -f Makefile
755
785
  distclean-am: clean-am distclean-compile distclean-generic \
756
786
  distclean-hdr distclean-tags
@@ -796,7 +826,22 @@ install-ps-am:
796
826
  installcheck-am:
797
827
 
798
828
  maintainer-clean: maintainer-clean-am
799
- -rm -rf ./$(DEPDIR) detail/$(DEPDIR)
829
+ -rm -f ./$(DEPDIR)/Address_Registration_Guard.Po
830
+ -rm -f ./$(DEPDIR)/Arg_operators.Po
831
+ -rm -f ./$(DEPDIR)/Class.Po
832
+ -rm -f ./$(DEPDIR)/Data_Type.Po
833
+ -rm -f ./$(DEPDIR)/Director.Po
834
+ -rm -f ./$(DEPDIR)/Exception.Po
835
+ -rm -f ./$(DEPDIR)/Identifier.Po
836
+ -rm -f ./$(DEPDIR)/Module.Po
837
+ -rm -f ./$(DEPDIR)/Object.Po
838
+ -rm -f ./$(DEPDIR)/String.Po
839
+ -rm -f ./$(DEPDIR)/Struct.Po
840
+ -rm -f ./$(DEPDIR)/Symbol.Po
841
+ -rm -f detail/$(DEPDIR)/check_ruby_type.Po
842
+ -rm -f detail/$(DEPDIR)/demangle.Po
843
+ -rm -f detail/$(DEPDIR)/method_data.Po
844
+ -rm -f detail/$(DEPDIR)/protect.Po
800
845
  -rm -f Makefile
801
846
  maintainer-clean-am: distclean-am maintainer-clean-generic
802
847
 
@@ -816,9 +861,9 @@ uninstall-am: uninstall-libLIBRARIES uninstall-nobase_includeHEADERS
816
861
 
817
862
  .MAKE: all install-am install-strip
818
863
 
819
- .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
820
- clean-libLIBRARIES cscopelist-am ctags ctags-am distclean \
821
- distclean-compile distclean-generic distclean-hdr \
864
+ .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
865
+ clean-generic clean-libLIBRARIES cscopelist-am ctags ctags-am \
866
+ distclean distclean-compile distclean-generic distclean-hdr \
822
867
  distclean-tags distdir dvi dvi-am html html-am info info-am \
823
868
  install install-am install-data install-data-am install-dvi \
824
869
  install-dvi-am install-exec install-exec-am install-html \
@@ -285,7 +285,7 @@ bool
285
285
  Rice::Module_impl<Base_T, Derived_T>::
286
286
  const_defined(Identifier name) const
287
287
  {
288
- int result = protect(rb_const_defined, *this, name);
288
+ size_t result = protect(rb_const_defined, *this, name);
289
289
  return bool(result);
290
290
  }
291
291
 
@@ -117,7 +117,7 @@ vcall(
117
117
  a[i] = it->value();
118
118
  }
119
119
 
120
- return protect(rb_funcall3, *this, id, args.size(), &a[0]);
120
+ return protect(rb_funcall3, *this, id, (int)args.size(), a.data());
121
121
  }
122
122
 
123
123
  void Rice::Object::
@@ -3,8 +3,22 @@
3
3
 
4
4
  #include "protect.hpp"
5
5
  #include "detail/ruby.hpp"
6
+ #include "to_from_ruby.hpp"
6
7
 
7
- #include "detail/object_call.ipp"
8
+ #include <vector>
9
+
10
+ template<typename ...ArgT>
11
+ inline Rice::Object Rice::Object::
12
+ call(Identifier id, ArgT... args) const
13
+ {
14
+ auto asList = this->convert_args<ArgT...>(args...);
15
+ return protect(rb_funcall2, value(), id, (int)asList.size(), asList.data());
16
+ }
17
+
18
+ template<typename ...ArgT>
19
+ std::vector<VALUE> Rice::Object::convert_args(ArgT&... args) const {
20
+ return std::vector<VALUE>{ to_ruby(args)... };
21
+ }
8
22
 
9
23
  template<typename T>
10
24
  void Rice::Object::
@@ -8,6 +8,7 @@
8
8
  #include "detail/ruby.hpp"
9
9
 
10
10
  #include <iosfwd>
11
+ #include <vector>
11
12
 
12
13
  namespace Rice
13
14
  {
@@ -151,7 +152,25 @@ public:
151
152
  Object attr_get(
152
153
  Identifier name) const;
153
154
 
154
- #include "detail/object_call.hpp"
155
+ //! Call the Ruby method specified by 'id' on object 'obj'.
156
+ /*! Pass in arguments (arg1, arg2, ...). The arguments will be converted to
157
+ * Ruby objects with to_ruby<>.
158
+ *
159
+ * E.g.:
160
+ * \code
161
+ * Rice::Object obj = x.call("foo", "one", 2);
162
+ * \endcode
163
+ *
164
+ * If a return type is specified, the return value will automatically be
165
+ * converted to that type as long as 'from_ruby' exists for that type.
166
+ *
167
+ * E.g.:
168
+ * \code
169
+ * float ret = x.call<float>("foo", z, 42);
170
+ * \endcode
171
+ */
172
+ template<typename ...ArgT>
173
+ Object call(Identifier id, ArgT... args) const;
155
174
 
156
175
  //! Vectorized call.
157
176
  /*! Calls the method identified by id with the list of arguments
@@ -169,6 +188,10 @@ protected:
169
188
  //! Set the encapsulated value.
170
189
  void set_value(VALUE v);
171
190
 
191
+ //! Unpack the provided arguments and convert them all to Ruby types.
192
+ template<typename ...ArgT>
193
+ std::vector<VALUE> convert_args(ArgT&... args) const;
194
+
172
195
  private:
173
196
  volatile VALUE value_;
174
197
  };