Rice  1.5.2
 All Classes Files Functions Variables Typedefs Friends Pages
Builtin_Object_defn.hpp
1 #ifndef Rice__Builtin_Object_defn__hpp_
2 #define Rice__Builtin_Object_defn__hpp_
3 
4 #include "Object_defn.hpp"
5 #include "detail/ruby.hpp"
6 
7 namespace Rice
8 {
9 
11 
17 template<typename T, int Builtin_Type>
19  : public Object
20 {
21 public:
23 
28 
30 
32  Builtin_Object(Builtin_Object const & other);
33 
34  T & operator*() const { return *obj_; }
35  T * operator->() const { return obj_; }
36  T * get() const { return obj_; }
37 
39 
42 
43 private:
44  T * obj_;
45 };
46 
47 } // namespace Rice
48 
49 #endif // Rice__Builtin_Object_defn__hpp_
50 
Builtin_Object(Object value)
Wrap an already allocated Ruby object.
A smartpointer-like wrapper for Ruby builtin objects.
Definition: Builtin_Object_defn.hpp:18
T * operator->() const
Return a pointer to obj_.
Definition: Builtin_Object_defn.hpp:35
VALUE const volatile & value() const
Explicitly get the encapsulated VALUE.
Definition: Object_defn.hpp:55
The base class for all Objects.
Definition: Object_defn.hpp:23
void swap(Builtin_Object< T, Builtin_Type > &ref)
Swap with another builtin object of the same type.
T & operator*() const
Return a reference to obj_.
Definition: Builtin_Object_defn.hpp:34