rice 1.0.2 → 1.1.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.
- data/COPYING +2 -2
- data/Doxyfile +1 -1
- data/Makefile.in +8 -3
- data/Rakefile +3 -3
- data/config.guess +30 -49
- data/config.sub +4 -22
- data/configure +319 -104
- data/configure.ac +6 -2
- data/doxygen.ac +2 -2
- data/extconf.rb +22 -0
- data/post-autoconf.rb +3 -3
- data/post-automake.rb +2 -2
- data/rice/Array.ipp +7 -6
- data/rice/Critical_Guard.hpp +6 -0
- data/rice/Critical_Guard.ipp +6 -0
- data/rice/Data_Object.hpp +1 -120
- data/rice/Data_Object.ipp +5 -1
- data/rice/Data_Object_defn.hpp +132 -0
- data/rice/Data_Type.ipp +18 -2
- data/rice/Enum.ipp +3 -3
- data/rice/Exception.hpp +1 -61
- data/rice/Exception_Base.hpp +2 -24
- data/rice/Exception_Base.ipp +2 -0
- data/rice/Exception_Base_defn.hpp +27 -0
- data/rice/Exception_defn.hpp +69 -0
- data/rice/Hash.hpp +5 -1
- data/rice/Hash.ipp +7 -7
- data/rice/Makefile.am +20 -3
- data/rice/Makefile.in +39 -4
- data/rice/Module.cpp +11 -3
- data/rice/Module_impl.hpp +20 -9
- data/rice/Module_impl.ipp +84 -87
- data/rice/Object.cpp +1 -1
- data/rice/VM.cpp +14 -1
- data/rice/VM.hpp +6 -1
- data/rice/config.hpp +24 -3
- data/rice/config.hpp.in +21 -0
- data/rice/detail/Auto_Function_Wrapper.hpp +97 -65
- data/rice/detail/Auto_Function_Wrapper.ipp +160 -128
- data/rice/detail/Auto_Member_Function_Wrapper.hpp +96 -64
- data/rice/detail/Auto_Member_Function_Wrapper.ipp +160 -128
- data/rice/detail/Exception_Handler.hpp +2 -112
- data/rice/detail/Exception_Handler.ipp +68 -0
- data/rice/detail/Exception_Handler_defn.hpp +96 -0
- data/rice/detail/Iterator.hpp +93 -0
- data/rice/detail/check_ruby_type.cpp +8 -2
- data/rice/detail/creation_funcs.ipp +2 -2
- data/rice/detail/define_method_and_auto_wrap.hpp +4 -2
- data/rice/detail/define_method_and_auto_wrap.ipp +14 -5
- data/rice/detail/env.hpp +4 -0
- data/rice/detail/method_data.cpp +362 -75
- data/rice/detail/method_data.cpp.rpp +301 -0
- data/rice/detail/method_data.hpp +6 -18
- data/rice/detail/mininode.cpp +1220 -0
- data/rice/detail/mininode.cpp.rpp +62 -0
- data/rice/detail/mininode.hpp +320 -0
- data/rice/detail/mininode.hpp.rpp +119 -0
- data/rice/detail/protect.cpp +4 -2
- data/rice/detail/ruby.hpp +44 -18
- data/rice/detail/ruby_version_code.hpp +6 -0
- data/rice/detail/ruby_version_code.hpp.in +6 -0
- data/rice/detail/rubysig.hpp +6 -0
- data/rice/detail/st.hpp +6 -2
- data/rice/detail/wrap_function.hpp +50 -48
- data/rice/detail/wrap_function.ipp +48 -48
- data/rice/generate_code.rb +43 -293
- data/rice/global_function.hpp +10 -4
- data/rice/global_function.ipp +1 -2
- data/rice/ruby_mark.hpp +13 -0
- data/rice/ruby_try_catch.hpp +1 -1
- data/rice/rubypp.rb +97 -0
- data/rice/to_from_ruby.ipp +3 -3
- data/ruby.ac +44 -8
- data/ruby/Makefile.in +2 -0
- data/ruby/lib/Makefile.in +2 -0
- data/ruby/lib/mkmf-rice.rb.in +4 -1
- data/ruby/lib/version.rb +3 -0
- data/sample/Makefile.am +2 -2
- data/sample/Makefile.in +4 -2
- data/test/Makefile.am +2 -1
- data/test/Makefile.in +7 -2
- data/test/test_Array.cpp +2 -2
- data/test/test_Class.cpp +4 -1
- data/test/test_Critical_Guard.cpp +4 -0
- data/test/test_Data_Object.cpp +43 -3
- data/test/test_Hash.cpp +3 -3
- data/test/test_String.cpp +8 -8
- data/test/test_VM.cpp +1 -1
- data/test/test_global_functions.cpp +45 -0
- data/test/test_rice.rb +5 -0
- metadata +115 -98
- data/rice/detail/Iterator_Definer.hpp +0 -98
@@ -1,98 +0,0 @@
|
|
1
|
-
#ifndef Rice__detail__Iterator_Definer__hpp_
|
2
|
-
#define Rice__detail__Iterator_Definer__hpp_
|
3
|
-
|
4
|
-
#include "method_data.hpp"
|
5
|
-
#include "ruby.hpp"
|
6
|
-
#include "../protect.hpp"
|
7
|
-
#include "../Data_Object.hpp"
|
8
|
-
|
9
|
-
namespace Rice
|
10
|
-
{
|
11
|
-
|
12
|
-
namespace detail
|
13
|
-
{
|
14
|
-
|
15
|
-
template<typename Derived_T>
|
16
|
-
class Iterator_Definer
|
17
|
-
{
|
18
|
-
public:
|
19
|
-
virtual ~Iterator_Definer()
|
20
|
-
{
|
21
|
-
}
|
22
|
-
|
23
|
-
class Iterator
|
24
|
-
{
|
25
|
-
public:
|
26
|
-
virtual ~Iterator() { }
|
27
|
-
|
28
|
-
virtual VALUE call_impl(VALUE self) = 0;
|
29
|
-
|
30
|
-
static VALUE call(VALUE self)
|
31
|
-
{
|
32
|
-
void * data = method_data();
|
33
|
-
Iterator * iterator = static_cast<Iterator *>(data);
|
34
|
-
return iterator->call_impl(self);
|
35
|
-
}
|
36
|
-
};
|
37
|
-
|
38
|
-
template<typename T, typename Iterator_T>
|
39
|
-
class Iterator_Impl
|
40
|
-
: public Iterator
|
41
|
-
{
|
42
|
-
public:
|
43
|
-
Iterator_Impl(
|
44
|
-
Iterator_T (T::*begin)(),
|
45
|
-
Iterator_T (T::*end)(),
|
46
|
-
Data_Type<T> data_type)
|
47
|
-
: begin_(begin)
|
48
|
-
, end_(end)
|
49
|
-
, data_type_(data_type)
|
50
|
-
{
|
51
|
-
}
|
52
|
-
|
53
|
-
virtual VALUE call_impl(VALUE self)
|
54
|
-
{
|
55
|
-
Data_Object<T> obj(self, data_type_);
|
56
|
-
Iterator_T it = obj->begin();
|
57
|
-
Iterator_T end = obj->end();
|
58
|
-
for(; it != end; ++it)
|
59
|
-
{
|
60
|
-
Rice::protect(rb_yield, to_ruby(*it));
|
61
|
-
}
|
62
|
-
return self;
|
63
|
-
}
|
64
|
-
|
65
|
-
private:
|
66
|
-
Iterator_T (T::*begin_)();
|
67
|
-
Iterator_T (T::*end_)();
|
68
|
-
Data_Type<T> data_type_;
|
69
|
-
};
|
70
|
-
|
71
|
-
template<typename T, typename Iterator_T>
|
72
|
-
Derived_T & define_iterator(
|
73
|
-
char const * name,
|
74
|
-
Iterator_T (T::*begin)(),
|
75
|
-
Iterator_T (T::*end)())
|
76
|
-
{
|
77
|
-
Derived_T & self = static_cast<Derived_T &>(*this);
|
78
|
-
// TODO: memory leak!!!!!!!
|
79
|
-
Iterator * iterator = new Iterator_Impl<T, Iterator_T>(
|
80
|
-
begin,
|
81
|
-
end,
|
82
|
-
Data_Type<T>(self));
|
83
|
-
define_method_with_data(
|
84
|
-
static_cast<VALUE>(self),
|
85
|
-
name,
|
86
|
-
(RUBY_METHOD_FUNC)iterator->call,
|
87
|
-
0,
|
88
|
-
iterator);
|
89
|
-
return self;
|
90
|
-
}
|
91
|
-
};
|
92
|
-
|
93
|
-
} // namespac edetail
|
94
|
-
|
95
|
-
} // namespace Rice
|
96
|
-
|
97
|
-
#endif // Rice__detail__Iterator_Definer__hpp_
|
98
|
-
|