Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

Exc_Ruby Namespace Reference

All memebers of the Exceptional Ruby library are found in the Exc_Ruby namespace. More...


Classes

class  Constructor
class  Constructor_Base_0
class  Constructor< T, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void >
class  Constructor_Base_1
class  Constructor< T, Arg1_T, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void >
class  Constructor_Base_2
class  Constructor< T, Arg1_T, Arg2_T, void, void, void, void, void, void, void, void, void, void, void, void, void, void >
class  Constructor_Base_3
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, void, void, void, void, void, void, void, void, void, void, void, void, void >
class  Constructor_Base_4
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, void, void, void, void, void, void, void, void, void, void, void, void >
class  Constructor_Base_5
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, void, void, void, void, void, void, void, void, void, void, void >
class  Constructor_Base_6
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, void, void, void, void, void, void, void, void, void, void >
class  Constructor_Base_7
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, void, void, void, void, void, void, void, void, void >
class  Constructor_Base_8
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, void, void, void, void, void, void, void, void >
class  Constructor_Base_9
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, void, void, void, void, void, void, void >
class  Constructor_Base_10
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, void, void, void, void, void, void >
class  Constructor_Base_11
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, void, void, void, void, void >
class  Constructor_Base_12
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, void, void, void, void >
class  Constructor_Base_13
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, void, void, void >
class  Constructor_Base_14
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, void, void >
class  Constructor_Base_15
class  Constructor< T, Arg1_T, Arg2_T, Arg3_T, Arg4_T, Arg5_T, Arg6_T, Arg7_T, Arg8_T, Arg9_T, Arg10_T, Arg11_T, Arg12_T, Arg13_T, Arg14_T, Arg15_T, void >
class  Ruby_Array
class  Ruby_Array::Iterator
 A helper class for implementing iterators for a Ruby_Array.

class  Class
class  Ruby_Hash
class  Ruby_Hash::Proxy
 A helper class so hash[key]=value can work.

class  Ruby_Hash::Iterator
 A helper class for implementing iterators for a Ruby_Hash.

class  Module
class  Ruby_Struct
class  Ruby_Struct::Instance
class  Critical_Guard
class  Enum_Wrapper
class  Ruby_Cmdline_Args
struct  Ruby_Exception
 A placeholder for Ruby exceptions. More...

struct  Ruby_Jump_Tag
 A placeholder for Ruby longjmps. More...

struct  Ruby_Delete_Strategy
 Some strategies for deleting objects. More...

struct  Fast_Ruby_Data_Wrapper
struct  Exception_Safe_Ruby_Data_Wrapper
struct  Fast_Builtin_Wrapper
 A wrapper for builtin data types (such as RArray or RString). More...

struct  Exception_Safe_Builtin_Wrapper
struct  Ruby_Reference
 A smartpointer-like wrapper for Ruby VALUEs. More...

struct  Ruby_Type_Wrapper
class  Ruby_Type
class  Use_Ruby_Allocator
struct  Value_Holder

Typedefs

typedef VALUE(* Rb_Protect_Signature )(RUBY_VALUE_FUNC, VALUE, int *)
typedef void(* Rb_Gc_Mark_Signature )(VALUE)
typedef void(* Rb_Set_End_Proc_Signature )(void(*)(VALUE), VALUE)
typedef VALUE(* RUBY_PROC_FUNC )(VALUE proc_arg, VALUE data, VALUE self)

Functions

Class define_class_under (Value_Holder module, char const *name, Value_Holder superclass=rb_cObject)
Class define_class (char const *name, Value_Holder superclass=rb_cObject)
Module define_module_under (Value_Holder module, char const *name)
Module define_module (char const *name)
VALUE call_ruby_function (Function f, T1 arg1, T2 arg2,...)
 Call the C function f with arguments (arg1, arg2, ...).

void throw_type_error (VALUE value, VALUE klass)
void raise_type_error (VALUE value, VALUE klass)
template<typename Type_Error_Thrower> void check_ruby_type (VALUE value, VALUE klass, bool include_super, Type_Error_Thrower type_error_thrower=throw_type_error)
void rb_cpp_define_alloc_func (Value_Holder klass, RUBY_VALUE_FUNC allocate_func)
template<typename Initialize_Func_T> void rb_cpp_define_creation_funcs (Value_Holder klass, RUBY_VALUE_FUNC allocate_func, Initialize_Func_T initialize_func)
void rb_cpp_undef_alloc_func (Value_Holder klass)
void rb_cpp_undef_creation_funcs (Value_Holder klass)
template<typename T> VALUE default_allocation_func (VALUE klass)
VALUE rb_cpp_proc_new (RUBY_PROC_FUNC func, VALUE data)
VALUE rb_cpp_define_method (VALUE klass, char const *name, VALUE(*f)(VALUE arg1, VALUE arg2,...))
VALUE rb_cpp_define_module_function (VALUE klass, char const *name, VALUE(*f)(VALUE arg1, VALUE arg2,...))
VALUE rb_cpp_define_protected_method (VALUE klass, char const *name, VALUE(*f)(VALUE arg1, VALUE arg2,...))
VALUE rb_cpp_define_private_method (VALUE klass, char const *name, VALUE(*f)(VALUE arg1, VALUE arg2,...))
VALUE rb_cpp_define_singleton_method (VALUE klass, char const *name, VALUE(*f)(VALUE arg1, VALUE arg2,...))
void rb_cpp_define_global_function (char const *name, VALUE(*f)(VALUE arg1, VALUE arg2,...))
VALUE rb_cpp_funcall (VALUE obj, ID id, T1 arg1, T2 arg2,...)
void * rb_cpp_method_data ()
void rb_cpp_define_method_with_data (VALUE klass, char const *name, RUBY_METHOD_FUNC func, int num_args, void *data)
char * CPP_STR2CSTR (VALUE str)
long CPP_NUM2LONG (VALUE x)
 Like NUM2LONG but throws C++ exceptions.

unsigned long CPP_NUM2ULONG (VALUE x)
 Like NUM2ULONG but throws C++ exceptions.

long CPP_NUM2INT (VALUE x)
 Like NUM2INT but throws C++ exceptions.

unsigned long CPP_NUM2UINT (VALUE x)
 Like NUM2UINT but throws C++ exceptions.

double CPP_NUM2DBL (VALUE x)
 Like NUM2DBL but throws C++ exceptions.

template<typename Exc_Converter> VALUE rb_cpp_protect (RUBY_VALUE_FUNC f, VALUE arg, Exc_Converter ec)
VALUE rb_cpp_protect (RUBY_VALUE_FUNC f, VALUE arg)
VALUE rb_cpp_funcall3 (VALUE obj, ID method, int argc, VALUE const *argv)


Detailed Description

All memebers of the Exceptional Ruby library are found in the Exc_Ruby namespace.

Function Documentation

VALUE call_ruby_function Function  f,
T1  arg1,
T2  arg2,
  ...
 

Call the C function f with arguments (arg1, arg2, ...).

E.g.:

VALUE x = call_ruby_function(rb_ary_new); call_ruby_function(rb_ary_push(x, INT2NUM(42));

Note that this function makes copies of all of its arguments; it does not take anything by reference. All of the copies are const so that call_ruby_function will not work if f takes a non-const reference to any of its arguments (though you can use non-const pointers).

char* CPP_STR2CSTR VALUE  str  ) 
 

Like STR2STR but throws C++ exceptions. Unlike STR2CSTR, does not convert the argument to a string if it is not one already, since this can cause GC problems (see [ruby-talk:67220]).

template<typename T>
VALUE default_allocation_func VALUE  klass  ) 
 

A default implementation of an allocate_func. This function does no actual allocation; the initialize_func can later do the real allocation with: DATA_PTR(self) = new Type(arg1, arg2, ...)

void rb_cpp_define_alloc_func Value_Holder  klass,
RUBY_VALUE_FUNC  allocate_func
 

Ruby 1.6.x doesn't have rb_define_alloc_func, but Ruby 1.8 will. It's the "new" way to allocate objects. This function will just define a singleton new method on older versions of Ruby, and will call rb_define_alloc_func() on newer versions of Ruby.

template<typename Initialize_Func_T>
void rb_cpp_define_creation_funcs Value_Holder  klass,
RUBY_VALUE_FUNC  allocate_func,
Initialize_Func_T  initialize_func
 

Like rb_cpp_define_alloc_func, but allows the user to define an "initialize" method too.

void rb_cpp_define_global_function char const *  name,
VALUE(*  f)(VALUE arg1, VALUE arg2,...)
 

Define a global function. Like rb_define_global_function, but automatically calculates the number of arguments based on the prototype of the supplied function f.

VALUE rb_cpp_define_method VALUE  klass,
char const *  name,
VALUE(*  f)(VALUE arg1, VALUE arg2,...)
 

Define a method method. Like rb_define_method, but automatically calculates the number of arguments based on the prototype of the supplied function f.

VALUE rb_cpp_define_module_function VALUE  klass,
char const *  name,
VALUE(*  f)(VALUE arg1, VALUE arg2,...)
 

Define a module_function method. Like rb_define_module_function, but automatically calculates the number of arguments based on the prototype of the supplied function f.

VALUE rb_cpp_define_private_method VALUE  klass,
char const *  name,
VALUE(*  f)(VALUE arg1, VALUE arg2,...)
 

Define a private_method method. Like rb_define_private_method, but automatically calculates the number of arguments based on the prototype of the supplied function f.

VALUE rb_cpp_define_protected_method VALUE  klass,
char const *  name,
VALUE(*  f)(VALUE arg1, VALUE arg2,...)
 

Define a protected_method method. Like rb_define_protected_method, but automatically calculates the number of arguments based on the prototype of the supplied function f.

VALUE rb_cpp_define_singleton_method VALUE  klass,
char const *  name,
VALUE(*  f)(VALUE arg1, VALUE arg2,...)
 

Define a singleton_method method. Like rb_define_singleton_method, but automatically calculates the number of arguments based on the prototype of the supplied function f.

VALUE rb_cpp_funcall VALUE  obj,
ID  id,
T1  arg1,
T2  arg2,
  ...
 

E.g.:

VALUE y = rb_cpp_funcall(x, rb_intern("foo"), z, INT2NUM(42));

VALUE rb_cpp_funcall3 VALUE  obj,
ID  method,
int  argc,
VALUE const *  argv
[inline]
 

Call method on obj, but convert Ruby exceptions to C++ exceptions (should be equivalent to rb_funcall3).

VALUE rb_cpp_protect RUBY_VALUE_FUNC  f,
VALUE  arg
[inline]
 

Same as rb_cpp_protect<>, but does not call a user-defined exception converter.

template<typename Exc_Converter>
VALUE rb_cpp_protect RUBY_VALUE_FUNC  f,
VALUE  arg,
Exc_Converter  ec
 

Call the function f with the parameter arg If f raises a Ruby exception, then ec is called with the exception as a parameter. If ec returns, or if a jump tag is returned by rb_protect that does not represent an exception, then a Ruby_Jump_Tag is thrown.

void rb_cpp_undef_alloc_func Value_Holder  klass  ) 
 

This is just the opposite of rb_cpp_define_alloc_func. It can be used to create a class that cannot be instantiated by the user.

void rb_cpp_undef_creation_funcs Value_Holder  klass  ) 
 

This is just the opposite of rb_cpp_define_creation_func. It can be used to create a class that cannot be instantiated by the user.


Generated on Sat Jan 1 12:02:26 2005 for Exceptional Ruby by doxygen 1.3.6