Rice  3.0.0
Class_defn.hpp
1 #ifndef Rice__Class_defn__hpp_
2 #define Rice__Class_defn__hpp_
3 
4 #include "Object_defn.hpp"
5 #include "Module_impl.hpp"
6 #include "Module_defn.hpp"
7 #include "to_from_ruby_defn.hpp"
8 #include "Identifier.hpp"
9 
15 namespace Rice
16 {
17 
19 
22 class Class
23  : public Module_impl<Module, Class>
24 {
25 public:
28  Class();
29 
31  Class(VALUE v);
32 
34 
38 };
39 
41 
46 Class define_class_under(
47  Object module,
48  char const * name,
49  Object superclass = rb_cObject);
50 
52 
56 Class define_class(
57  char const * name,
58  Object superclass = rb_cObject);
59 
61 
64 Class anonymous_class(
65  Object superclass = rb_cObject);
66 
67 } // namespace Rice
68 
69 template<>
70 inline
71 Rice::Class from_ruby<Rice::Class>(Rice::Object x)
72 {
73  return Rice::Class(x);
74 }
75 
76 template<>
77 inline
78 Rice::Object to_ruby<Rice::Class>(Rice::Class const & x)
79 {
80  return x;
81 }
82 
83 #endif // Rice__Class_defn__hpp_
84 
A helper for defining a Class and its methods.
Definition: Class_defn.hpp:24
Class & undef_creation_funcs()
Disallow creation of an instance from Ruby code.
Class(VALUE v)
Construct a new class wrapper from a ruby object of type T_CLASS.
Definition: Module_impl.hpp:49
The base class for all Objects.
Definition: Object_defn.hpp:25