rice2 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/COPYING +23 -0
- data/Doxyfile +2268 -0
- data/Makefile.am +26 -0
- data/Makefile.in +929 -0
- data/README.md +1054 -0
- data/README.mingw +8 -0
- data/Rakefile +24 -0
- data/aclocal.m4 +1090 -0
- data/bootstrap +8 -0
- data/config.guess +1667 -0
- data/config.sub +1793 -0
- data/configure +8209 -0
- data/configure.ac +55 -0
- data/depcomp +791 -0
- data/doxygen.ac +314 -0
- data/doxygen.am +186 -0
- data/extconf.rb +66 -0
- data/install-sh +529 -0
- data/missing +215 -0
- data/post-autoconf.rb +22 -0
- data/post-automake.rb +28 -0
- data/rice/Address_Registration_Guard.cpp +22 -0
- data/rice/Address_Registration_Guard.hpp +7 -0
- data/rice/Address_Registration_Guard.ipp +37 -0
- data/rice/Address_Registration_Guard_defn.hpp +75 -0
- data/rice/Arg.hpp +8 -0
- data/rice/Arg_impl.hpp +129 -0
- data/rice/Arg_operators.cpp +21 -0
- data/rice/Arg_operators.hpp +19 -0
- data/rice/Array.hpp +214 -0
- data/rice/Array.ipp +256 -0
- data/rice/Builtin_Object.hpp +8 -0
- data/rice/Builtin_Object.ipp +50 -0
- data/rice/Builtin_Object_defn.hpp +50 -0
- data/rice/Class.cpp +57 -0
- data/rice/Class.hpp +8 -0
- data/rice/Class.ipp +6 -0
- data/rice/Class_defn.hpp +83 -0
- data/rice/Constructor.hpp +47 -0
- data/rice/Data_Object.hpp +8 -0
- data/rice/Data_Object.ipp +133 -0
- data/rice/Data_Object_defn.hpp +138 -0
- data/rice/Data_Type.cpp +54 -0
- data/rice/Data_Type.hpp +8 -0
- data/rice/Data_Type.ipp +365 -0
- data/rice/Data_Type_defn.hpp +261 -0
- data/rice/Data_Type_fwd.hpp +12 -0
- data/rice/Director.cpp +13 -0
- data/rice/Director.hpp +39 -0
- data/rice/Enum.hpp +117 -0
- data/rice/Enum.ipp +246 -0
- data/rice/Exception.cpp +59 -0
- data/rice/Exception.hpp +13 -0
- data/rice/Exception_Base.hpp +8 -0
- data/rice/Exception_Base.ipp +13 -0
- data/rice/Exception_Base_defn.hpp +27 -0
- data/rice/Exception_defn.hpp +69 -0
- data/rice/Hash.hpp +227 -0
- data/rice/Hash.ipp +329 -0
- data/rice/Identifier.cpp +8 -0
- data/rice/Identifier.hpp +50 -0
- data/rice/Identifier.ipp +33 -0
- data/rice/Jump_Tag.hpp +24 -0
- data/rice/Makefile.am +122 -0
- data/rice/Makefile.in +885 -0
- data/rice/Module.cpp +84 -0
- data/rice/Module.hpp +8 -0
- data/rice/Module.ipp +6 -0
- data/rice/Module_defn.hpp +88 -0
- data/rice/Module_impl.hpp +281 -0
- data/rice/Module_impl.ipp +345 -0
- data/rice/Object.cpp +169 -0
- data/rice/Object.hpp +8 -0
- data/rice/Object.ipp +33 -0
- data/rice/Object_defn.hpp +214 -0
- data/rice/Require_Guard.hpp +21 -0
- data/rice/String.cpp +94 -0
- data/rice/String.hpp +91 -0
- data/rice/Struct.cpp +117 -0
- data/rice/Struct.hpp +162 -0
- data/rice/Struct.ipp +26 -0
- data/rice/Symbol.cpp +25 -0
- data/rice/Symbol.hpp +66 -0
- data/rice/Symbol.ipp +44 -0
- data/rice/config.hpp +47 -0
- data/rice/config.hpp.in +46 -0
- data/rice/detail/Arguments.hpp +118 -0
- data/rice/detail/Auto_Function_Wrapper.hpp +898 -0
- data/rice/detail/Auto_Function_Wrapper.ipp +3694 -0
- data/rice/detail/Auto_Member_Function_Wrapper.hpp +897 -0
- data/rice/detail/Auto_Member_Function_Wrapper.ipp +2774 -0
- data/rice/detail/Caster.hpp +103 -0
- data/rice/detail/Exception_Handler.hpp +8 -0
- 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/Not_Copyable.hpp +25 -0
- data/rice/detail/Wrapped_Function.hpp +33 -0
- data/rice/detail/cfp.hpp +24 -0
- data/rice/detail/cfp.ipp +51 -0
- data/rice/detail/check_ruby_type.cpp +27 -0
- data/rice/detail/check_ruby_type.hpp +23 -0
- data/rice/detail/creation_funcs.hpp +37 -0
- data/rice/detail/creation_funcs.ipp +36 -0
- data/rice/detail/default_allocation_func.hpp +23 -0
- data/rice/detail/default_allocation_func.ipp +11 -0
- data/rice/detail/define_method_and_auto_wrap.hpp +31 -0
- data/rice/detail/define_method_and_auto_wrap.ipp +30 -0
- data/rice/detail/demangle.cpp +56 -0
- data/rice/detail/demangle.hpp +19 -0
- data/rice/detail/env.hpp +11 -0
- data/rice/detail/from_ruby.hpp +43 -0
- data/rice/detail/from_ruby.ipp +60 -0
- data/rice/detail/method_data.cpp +92 -0
- data/rice/detail/method_data.hpp +21 -0
- data/rice/detail/node.hpp +13 -0
- data/rice/detail/protect.cpp +29 -0
- data/rice/detail/protect.hpp +34 -0
- data/rice/detail/ruby.hpp +74 -0
- data/rice/detail/ruby_version_code.hpp +6 -0
- data/rice/detail/ruby_version_code.hpp.in +6 -0
- data/rice/detail/st.hpp +22 -0
- data/rice/detail/to_ruby.hpp +22 -0
- data/rice/detail/to_ruby.ipp +36 -0
- data/rice/detail/traits.hpp +43 -0
- data/rice/detail/win32.hpp +16 -0
- data/rice/detail/wrap_function.hpp +66 -0
- data/rice/global_function.hpp +33 -0
- data/rice/global_function.ipp +22 -0
- data/rice/protect.hpp +38 -0
- data/rice/protect.ipp +1134 -0
- data/rice/ruby_mark.hpp +13 -0
- data/rice/ruby_try_catch.hpp +86 -0
- data/rice/rubypp.rb +97 -0
- data/rice/to_from_ruby.hpp +8 -0
- data/rice/to_from_ruby.ipp +418 -0
- data/rice/to_from_ruby_defn.hpp +70 -0
- data/ruby.ac +135 -0
- data/ruby/Makefile.am +1 -0
- data/ruby/Makefile.in +628 -0
- data/ruby/lib/Makefile.am +3 -0
- data/ruby/lib/Makefile.in +506 -0
- data/ruby/lib/mkmf-rice.rb.in +217 -0
- data/ruby/lib/version.rb +3 -0
- data/sample/Makefile.am +47 -0
- data/sample/Makefile.in +489 -0
- data/sample/enum/extconf.rb +3 -0
- data/sample/enum/sample_enum.cpp +54 -0
- data/sample/enum/test.rb +8 -0
- data/sample/inheritance/animals.cpp +98 -0
- data/sample/inheritance/extconf.rb +3 -0
- data/sample/inheritance/test.rb +7 -0
- data/sample/map/extconf.rb +3 -0
- data/sample/map/map.cpp +81 -0
- data/sample/map/test.rb +7 -0
- data/test/Makefile.am +72 -0
- data/test/Makefile.in +1213 -0
- data/test/ext/Makefile.am +41 -0
- data/test/ext/Makefile.in +483 -0
- data/test/ext/t1/Foo.hpp +10 -0
- data/test/ext/t1/extconf.rb +2 -0
- data/test/ext/t1/t1.cpp +15 -0
- data/test/ext/t2/extconf.rb +2 -0
- data/test/ext/t2/t2.cpp +11 -0
- data/test/test_Address_Registration_Guard.cpp +43 -0
- data/test/test_Array.cpp +248 -0
- data/test/test_Builtin_Object.cpp +71 -0
- data/test/test_Class.cpp +496 -0
- data/test/test_Constructor.cpp +128 -0
- data/test/test_Data_Object.cpp +275 -0
- data/test/test_Data_Type.cpp +348 -0
- data/test/test_Director.cpp +308 -0
- data/test/test_Enum.cpp +215 -0
- data/test/test_Exception.cpp +47 -0
- data/test/test_Hash.cpp +212 -0
- data/test/test_Identifier.cpp +70 -0
- data/test/test_Jump_Tag.cpp +17 -0
- data/test/test_Memory_Management.cpp +50 -0
- data/test/test_Module.cpp +497 -0
- data/test/test_Object.cpp +159 -0
- data/test/test_String.cpp +107 -0
- data/test/test_Struct.cpp +205 -0
- data/test/test_Symbol.cpp +63 -0
- data/test/test_To_From_Ruby.cpp +428 -0
- data/test/test_global_functions.cpp +114 -0
- data/test/test_rice.rb +41 -0
- data/test/unittest.cpp +136 -0
- data/test/unittest.hpp +294 -0
- metadata +297 -0
@@ -0,0 +1,103 @@
|
|
1
|
+
#ifndef Rice__detail__Caster__hpp_
|
2
|
+
#define Rice__detail__Caster__hpp_
|
3
|
+
|
4
|
+
#include "../Module.hpp"
|
5
|
+
#include <stdexcept>
|
6
|
+
|
7
|
+
namespace Rice
|
8
|
+
{
|
9
|
+
|
10
|
+
namespace detail
|
11
|
+
{
|
12
|
+
|
13
|
+
class Abstract_Caster
|
14
|
+
{
|
15
|
+
public:
|
16
|
+
virtual void * cast_to_base(void * derived, Module type) const = 0;
|
17
|
+
virtual ~Abstract_Caster() { }
|
18
|
+
};
|
19
|
+
|
20
|
+
template<typename Derived_T, typename Base_T>
|
21
|
+
class Caster
|
22
|
+
: public Abstract_Caster
|
23
|
+
{
|
24
|
+
public:
|
25
|
+
Caster(Abstract_Caster * base_caster, Module type)
|
26
|
+
: base_caster_(base_caster)
|
27
|
+
, type_(type)
|
28
|
+
{
|
29
|
+
}
|
30
|
+
|
31
|
+
protected:
|
32
|
+
virtual void * cast_to_base(void * derived, Module type) const
|
33
|
+
{
|
34
|
+
if(type.value() == type_.value())
|
35
|
+
{
|
36
|
+
Derived_T * d(static_cast<Derived_T *>(derived));
|
37
|
+
return static_cast<Base_T *>(d);
|
38
|
+
}
|
39
|
+
else
|
40
|
+
{
|
41
|
+
if(base_caster_)
|
42
|
+
{
|
43
|
+
return base_caster_->cast_to_base(derived, type);
|
44
|
+
}
|
45
|
+
else
|
46
|
+
{
|
47
|
+
std::string s = "bad cast. No caster found for ";
|
48
|
+
s += type_.name().str();
|
49
|
+
throw std::runtime_error(s);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
private:
|
55
|
+
Abstract_Caster * base_caster_;
|
56
|
+
Module type_;
|
57
|
+
};
|
58
|
+
|
59
|
+
template<typename To_T, typename From_T>
|
60
|
+
class Implicit_Caster
|
61
|
+
: public Abstract_Caster
|
62
|
+
{
|
63
|
+
public:
|
64
|
+
Implicit_Caster(Abstract_Caster * base_caster, Module type)
|
65
|
+
: base_caster_(base_caster)
|
66
|
+
, type_(type)
|
67
|
+
{
|
68
|
+
}
|
69
|
+
|
70
|
+
protected:
|
71
|
+
virtual void * cast_to_base(void * derived, Module type) const
|
72
|
+
{
|
73
|
+
if(type.value() == type_.value())
|
74
|
+
{
|
75
|
+
return new To_T( *static_cast<From_T*>(derived) );
|
76
|
+
}
|
77
|
+
else
|
78
|
+
{
|
79
|
+
if(base_caster_)
|
80
|
+
{
|
81
|
+
return base_caster_->cast_to_base(derived, type);
|
82
|
+
}
|
83
|
+
else
|
84
|
+
{
|
85
|
+
std::string s = "bad cast. No implicit caster found for ";
|
86
|
+
s += type_.name().str();
|
87
|
+
throw std::runtime_error(s);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
private:
|
93
|
+
Abstract_Caster * base_caster_;
|
94
|
+
Module type_;
|
95
|
+
};
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
} // detail
|
100
|
+
|
101
|
+
} // Rice
|
102
|
+
|
103
|
+
#endif //Rice__detail__Caster__hpp_
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#include "../Data_Type_defn.hpp"
|
2
|
+
|
3
|
+
inline
|
4
|
+
Rice::detail::Exception_Handler::
|
5
|
+
Exception_Handler(
|
6
|
+
Data_Object<Exception_Handler> next_exception_handler)
|
7
|
+
: next_exception_handler_(next_exception_handler)
|
8
|
+
, next_exception_handler_guard_(&next_exception_handler_)
|
9
|
+
{
|
10
|
+
}
|
11
|
+
|
12
|
+
inline
|
13
|
+
Rice::detail::Exception_Handler::
|
14
|
+
~Exception_Handler()
|
15
|
+
{
|
16
|
+
}
|
17
|
+
|
18
|
+
inline
|
19
|
+
VALUE
|
20
|
+
Rice::detail::Exception_Handler::
|
21
|
+
call_next_exception_handler() const
|
22
|
+
{
|
23
|
+
return next_exception_handler_->handle_exception();
|
24
|
+
}
|
25
|
+
|
26
|
+
inline Rice::detail::Default_Exception_Handler::
|
27
|
+
Default_Exception_Handler()
|
28
|
+
: Exception_Handler(
|
29
|
+
Data_Object<Exception_Handler>(0, rb_cObject))
|
30
|
+
{
|
31
|
+
}
|
32
|
+
|
33
|
+
inline
|
34
|
+
VALUE
|
35
|
+
Rice::detail::Default_Exception_Handler::
|
36
|
+
handle_exception() const
|
37
|
+
{
|
38
|
+
throw;
|
39
|
+
}
|
40
|
+
|
41
|
+
template <typename Exception_T, typename Functor_T>
|
42
|
+
inline
|
43
|
+
Rice::detail::Functor_Exception_Handler<Exception_T, Functor_T>::
|
44
|
+
Functor_Exception_Handler(
|
45
|
+
Functor_T handler,
|
46
|
+
Data_Object<Exception_Handler> next_exception_handler)
|
47
|
+
: Exception_Handler(next_exception_handler)
|
48
|
+
, handler_(handler)
|
49
|
+
{
|
50
|
+
}
|
51
|
+
|
52
|
+
template <typename Exception_T, typename Functor_T>
|
53
|
+
inline
|
54
|
+
VALUE
|
55
|
+
Rice::detail::Functor_Exception_Handler<Exception_T, Functor_T>::
|
56
|
+
handle_exception() const
|
57
|
+
{
|
58
|
+
try
|
59
|
+
{
|
60
|
+
return call_next_exception_handler();
|
61
|
+
}
|
62
|
+
catch(Exception_T const & ex)
|
63
|
+
{
|
64
|
+
handler_(ex);
|
65
|
+
throw;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
@@ -0,0 +1,96 @@
|
|
1
|
+
#ifndef Rice__detail__Exception_Handler_defn__hpp_
|
2
|
+
#define Rice__detail__Exception_Handler_defn__hpp_
|
3
|
+
|
4
|
+
#include "ruby.h"
|
5
|
+
#undef TYPE
|
6
|
+
|
7
|
+
#include "Not_Copyable.hpp"
|
8
|
+
#include "../Address_Registration_Guard_defn.hpp"
|
9
|
+
#include "../Data_Object_defn.hpp"
|
10
|
+
|
11
|
+
namespace Rice
|
12
|
+
{
|
13
|
+
|
14
|
+
namespace detail
|
15
|
+
{
|
16
|
+
|
17
|
+
// A class for converting C++ exceptions to ruby exceptions. It's used
|
18
|
+
// like this:
|
19
|
+
//
|
20
|
+
// try
|
21
|
+
// {
|
22
|
+
// }
|
23
|
+
// catch(...)
|
24
|
+
// {
|
25
|
+
// handler->handle_exception();
|
26
|
+
// }
|
27
|
+
//
|
28
|
+
// If an exception is thrown the handler will pass the exception up the
|
29
|
+
// chain, then the last handler in the chain will throw the exception
|
30
|
+
// down the chain until a lower handler can handle it, e.g.:
|
31
|
+
//
|
32
|
+
// try
|
33
|
+
// {
|
34
|
+
// return call_next_exception_handler();
|
35
|
+
// }
|
36
|
+
// catch(MyException const & ex)
|
37
|
+
// {
|
38
|
+
// throw Rice::Exception(rb_cMyException, "%s", ex.what());
|
39
|
+
// }
|
40
|
+
//
|
41
|
+
class Exception_Handler
|
42
|
+
: public Rice::detail::Not_Copyable
|
43
|
+
{
|
44
|
+
public:
|
45
|
+
Exception_Handler(
|
46
|
+
Data_Object<Exception_Handler> next_exception_handler);
|
47
|
+
|
48
|
+
virtual ~Exception_Handler();
|
49
|
+
|
50
|
+
virtual VALUE handle_exception() const = 0;
|
51
|
+
|
52
|
+
VALUE call_next_exception_handler() const;
|
53
|
+
|
54
|
+
private:
|
55
|
+
Data_Object<Exception_Handler> next_exception_handler_;
|
56
|
+
Address_Registration_Guard next_exception_handler_guard_;
|
57
|
+
};
|
58
|
+
|
59
|
+
// The default exception handler just rethrows the exception. If there
|
60
|
+
// are other handlers in the chain, they will try to handle the rethrown
|
61
|
+
// exception.
|
62
|
+
class Default_Exception_Handler
|
63
|
+
: public Exception_Handler
|
64
|
+
{
|
65
|
+
public:
|
66
|
+
Default_Exception_Handler();
|
67
|
+
|
68
|
+
virtual VALUE handle_exception() const;
|
69
|
+
};
|
70
|
+
|
71
|
+
// An exception handler that takes a functor as an argument. The
|
72
|
+
// functor should throw a Rice::Exception to handle the exception. If
|
73
|
+
// the functor does not handle the exception, the exception will be
|
74
|
+
// re-thrown.
|
75
|
+
template <typename Exception_T, typename Functor_T>
|
76
|
+
class Functor_Exception_Handler
|
77
|
+
: public Exception_Handler
|
78
|
+
{
|
79
|
+
public:
|
80
|
+
Functor_Exception_Handler(
|
81
|
+
Functor_T handler,
|
82
|
+
Data_Object<Exception_Handler> next_exception_handler);
|
83
|
+
|
84
|
+
private:
|
85
|
+
virtual VALUE handle_exception() const;
|
86
|
+
|
87
|
+
private:
|
88
|
+
Functor_T handler_;
|
89
|
+
};
|
90
|
+
|
91
|
+
} // namespace detail
|
92
|
+
|
93
|
+
} // namespace Rice
|
94
|
+
|
95
|
+
#endif // Rice__detail__Exception_Handler_defn__hpp_
|
96
|
+
|
@@ -0,0 +1,93 @@
|
|
1
|
+
#ifndef Rice__detail__Iterator__hpp_
|
2
|
+
#define Rice__detail__Iterator__hpp_
|
3
|
+
|
4
|
+
#include "method_data.hpp"
|
5
|
+
#include "ruby.hpp"
|
6
|
+
#include "../protect.hpp"
|
7
|
+
#include "../Data_Object.hpp"
|
8
|
+
#include "../Identifier.hpp"
|
9
|
+
|
10
|
+
namespace Rice
|
11
|
+
{
|
12
|
+
|
13
|
+
namespace detail
|
14
|
+
{
|
15
|
+
|
16
|
+
class Iterator
|
17
|
+
{
|
18
|
+
public:
|
19
|
+
virtual ~Iterator() { }
|
20
|
+
|
21
|
+
virtual VALUE call_impl(VALUE self) = 0;
|
22
|
+
|
23
|
+
static VALUE call(VALUE self)
|
24
|
+
{
|
25
|
+
VALUE data = (VALUE)method_data();
|
26
|
+
Data_Object<Iterator> iterator(
|
27
|
+
data,
|
28
|
+
Data_Type<Iterator>());
|
29
|
+
return iterator->call_impl(self);
|
30
|
+
}
|
31
|
+
};
|
32
|
+
|
33
|
+
template<typename T, typename Iterator_T>
|
34
|
+
class Iterator_Impl
|
35
|
+
: public Iterator
|
36
|
+
{
|
37
|
+
public:
|
38
|
+
Iterator_Impl(
|
39
|
+
Iterator_T (T::*begin)(),
|
40
|
+
Iterator_T (T::*end)(),
|
41
|
+
Data_Type<T> data_type)
|
42
|
+
: begin_(begin)
|
43
|
+
, end_(end)
|
44
|
+
, data_type_(data_type)
|
45
|
+
{
|
46
|
+
}
|
47
|
+
|
48
|
+
virtual VALUE call_impl(VALUE self)
|
49
|
+
{
|
50
|
+
Data_Object<T> obj(self, data_type_);
|
51
|
+
Iterator_T it = (*obj.*begin_)();
|
52
|
+
Iterator_T end = (*obj.*end_)();
|
53
|
+
for(; it != end; ++it)
|
54
|
+
{
|
55
|
+
Rice::protect(rb_yield, to_ruby(*it));
|
56
|
+
}
|
57
|
+
return self;
|
58
|
+
}
|
59
|
+
|
60
|
+
private:
|
61
|
+
Iterator_T (T::*begin_)();
|
62
|
+
Iterator_T (T::*end_)();
|
63
|
+
Data_Type<T> data_type_;
|
64
|
+
};
|
65
|
+
|
66
|
+
template<typename T, typename Iterator_T>
|
67
|
+
void define_iterator(
|
68
|
+
Module klass,
|
69
|
+
Identifier name,
|
70
|
+
Iterator_T (T::*begin)(),
|
71
|
+
Iterator_T (T::*end)())
|
72
|
+
{
|
73
|
+
Data_Type<Iterator> iterator_klass;
|
74
|
+
Data_Object<Iterator> iterator(
|
75
|
+
new Iterator_Impl<T, Iterator_T>(
|
76
|
+
begin,
|
77
|
+
end,
|
78
|
+
Data_Type<T>(klass)),
|
79
|
+
iterator_klass);
|
80
|
+
define_method_with_data(
|
81
|
+
klass,
|
82
|
+
name,
|
83
|
+
(RUBY_METHOD_FUNC)iterator->call,
|
84
|
+
0,
|
85
|
+
iterator);
|
86
|
+
}
|
87
|
+
|
88
|
+
} // namespace detail
|
89
|
+
|
90
|
+
} // namespace Rice
|
91
|
+
|
92
|
+
#endif // Rice__detail__Iterator__hpp_
|
93
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#ifndef Rice__Not_Copyable__hpp_
|
2
|
+
#define Rice__Not_Copyable__hpp_
|
3
|
+
|
4
|
+
namespace Rice
|
5
|
+
{
|
6
|
+
|
7
|
+
namespace detail
|
8
|
+
{
|
9
|
+
|
10
|
+
// Inherit from Not_Copyable to prevent copying instances of a class.
|
11
|
+
class Not_Copyable
|
12
|
+
{
|
13
|
+
public:
|
14
|
+
Not_Copyable() { }
|
15
|
+
|
16
|
+
private:
|
17
|
+
Not_Copyable(Not_Copyable const &);
|
18
|
+
Not_Copyable & operator=(Not_Copyable const &);
|
19
|
+
};
|
20
|
+
|
21
|
+
} // namespace detail
|
22
|
+
|
23
|
+
} // namespace Rice
|
24
|
+
|
25
|
+
#endif // Rice__Not_Copyable__hpp_
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#ifndef Rice__detail__Wrapped_Function__hpp_
|
2
|
+
#define Rice__detail__Wrapped_Function__hpp_
|
3
|
+
|
4
|
+
#include "ruby.hpp"
|
5
|
+
|
6
|
+
namespace Rice
|
7
|
+
{
|
8
|
+
|
9
|
+
namespace detail
|
10
|
+
{
|
11
|
+
|
12
|
+
class Wrapped_Function
|
13
|
+
{
|
14
|
+
public:
|
15
|
+
Wrapped_Function(RUBY_METHOD_FUNC func, int arity)
|
16
|
+
: func_(func)
|
17
|
+
, arity_(arity)
|
18
|
+
{
|
19
|
+
}
|
20
|
+
|
21
|
+
RUBY_METHOD_FUNC func() const { return func_; }
|
22
|
+
int arity() const { return arity_; }
|
23
|
+
|
24
|
+
private:
|
25
|
+
RUBY_METHOD_FUNC func_;
|
26
|
+
int arity_;
|
27
|
+
};
|
28
|
+
|
29
|
+
} // detail
|
30
|
+
|
31
|
+
} // Rice
|
32
|
+
|
33
|
+
#endif // Rice__detail__Wrapped_Function__hpp_
|
data/rice/detail/cfp.hpp
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#ifndef Rice__detail__cfp__hpp_
|
2
|
+
#define Rice__detail__cfp__hpp_
|
3
|
+
|
4
|
+
#include "ruby.hpp"
|
5
|
+
|
6
|
+
namespace Rice
|
7
|
+
{
|
8
|
+
|
9
|
+
namespace detail
|
10
|
+
{
|
11
|
+
|
12
|
+
VALUE * cfp();
|
13
|
+
|
14
|
+
VALUE & cfp_data_memo_node_and_pc(VALUE * cfp);
|
15
|
+
VALUE & cfp_self(VALUE * cfp);
|
16
|
+
VALUE & cfp_method_class(VALUE * cfp);
|
17
|
+
|
18
|
+
} // detail
|
19
|
+
|
20
|
+
} // Rice
|
21
|
+
|
22
|
+
#include "cfp.ipp"
|
23
|
+
|
24
|
+
#endif // Rice__detail__cfp__hpp_
|