本文整理汇总了C++中RUBY_METHOD_FUNC函数的典型用法代码示例。如果您正苦于以下问题:C++ RUBY_METHOD_FUNC函数的具体用法?C++ RUBY_METHOD_FUNC怎么用?C++ RUBY_METHOD_FUNC使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RUBY_METHOD_FUNC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: define_ruby_class
void
define_ruby_class()
{
if(rb_klass)
return;
/*
* opencv = rb_define_module("OpenCV");
* cvpoint2d32f = rb_define_class_under(opencv, "CvPoint2D32f", rb_cObject);
*
* note: this comment is used by rdoc.
*/
VALUE opencv = rb_module_opencv();
VALUE cvpoint2d32f = cCvPoint2D32f::rb_class();
rb_klass = rb_define_class_under(opencv, "CvPoint3D32f", cvpoint2d32f);
rb_define_alloc_func(rb_klass, rb_allocate);
rb_define_singleton_method(rb_klass, "compatible?", RUBY_METHOD_FUNC(rb_compatible_q), 1);
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
rb_define_method(rb_klass, "x", RUBY_METHOD_FUNC(rb_x), 0);
rb_define_method(rb_klass, "x=", RUBY_METHOD_FUNC(rb_set_x), 1);
rb_define_method(rb_klass, "y", RUBY_METHOD_FUNC(rb_y), 0);
rb_define_method(rb_klass, "y=", RUBY_METHOD_FUNC(rb_set_y), 1);
rb_define_method(rb_klass, "z", RUBY_METHOD_FUNC(rb_z), 0);
rb_define_method(rb_klass, "z=", RUBY_METHOD_FUNC(rb_set_z), 1);
rb_define_method(rb_klass, "to_s", RUBY_METHOD_FUNC(rb_to_s), 0);
rb_define_method(rb_klass, "to_ary", RUBY_METHOD_FUNC(rb_to_ary), 0);
}
示例2: Init_blake2_ext
void Init_blake2_ext() {
cBlake2 = rb_define_class("Blake2", rb_cObject);
rb_define_alloc_func(cBlake2, blake2_alloc);
rb_define_private_method(cBlake2, "initialize", RUBY_METHOD_FUNC(m_blake2_initialize), 2);
rb_define_method(cBlake2, "digest", RUBY_METHOD_FUNC(m_blake2_digest), 2);
}
示例3: define_ruby_class
void
define_ruby_class()
{
if (rb_klass)
return;
/*
* opencv = rb_define_module("OpenCV");
*
* note: this comment is used by rdoc.
*/
VALUE opencv = rb_module_opencv();
rb_klass = rb_define_class_under(opencv, "CvHuMoments", rb_cObject);
rb_define_alloc_func(rb_klass, rb_allocate);
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), 1);
rb_define_method(rb_klass, "to_ary", RUBY_METHOD_FUNC(rb_to_ary), 0);
rb_define_alias(rb_klass, "to_a", "to_ary");
DEFINE_CVHUMOMENTS_GETTER(hu1);
DEFINE_CVHUMOMENTS_GETTER(hu2);
DEFINE_CVHUMOMENTS_GETTER(hu3);
DEFINE_CVHUMOMENTS_GETTER(hu4);
DEFINE_CVHUMOMENTS_GETTER(hu5);
DEFINE_CVHUMOMENTS_GETTER(hu6);
DEFINE_CVHUMOMENTS_GETTER(hu7);
}
示例4: wdm_rb_monitor_init
void
wdm_rb_monitor_init()
{
WDM_DEBUG("Registering WDM::Monitor with Ruby!");
wdm_rb_sym_call = rb_intern("call");
wdm_rb_sym_files = rb_intern("files");
wdm_rb_sym_directories = rb_intern("directories");
wdm_rb_sym_attributes = rb_intern("attributes");
wdm_rb_sym_size = rb_intern("size");
wdm_rb_sym_last_write = rb_intern("last_write");
wdm_rb_sym_last_access = rb_intern("last_access");
wdm_rb_sym_creation = rb_intern("creation");
wdm_rb_sym_security = rb_intern("security");
wdm_rb_sym_default = rb_intern("default");
eWDM_MonitorRunningError = rb_define_class_under(mWDM, "MonitorRunningError", eWDM_Error);
eWDM_InvalidDirectoryError = rb_define_class_under(mWDM, "InvalidDirectoryError", eWDM_Error);
eWDM_UnknownFlagError = rb_define_class_under(mWDM, "UnknownFlagError", eWDM_Error);
eWDM_UnwatchableDirectoryError = rb_define_class_under(mWDM, "UnwatchableDirectoryError", eWDM_Error);
cWDM_Monitor = rb_define_class_under(mWDM, "Monitor", rb_cObject);
rb_define_alloc_func(cWDM_Monitor, rb_monitor_alloc);
rb_define_method(cWDM_Monitor, "watch", RUBY_METHOD_FUNC(rb_monitor_watch), -1);
rb_define_method(cWDM_Monitor, "watch_recursively", RUBY_METHOD_FUNC(rb_monitor_watch_recursively), -1);
rb_define_method(cWDM_Monitor, "run!", RUBY_METHOD_FUNC(rb_monitor_run_bang), 0);
rb_define_method(cWDM_Monitor, "stop", RUBY_METHOD_FUNC(rb_monitor_stop), 0);
}
示例5: Init_hello
/**
* require時に呼び出し
*/
extern "C" void Init_hello()
{
VALUE c = rb_define_class("Hello", rb_cObject);
rb_define_alloc_func(c, wrap_Hello_alloc);
rb_define_private_method(c, "initialize", RUBY_METHOD_FUNC(wrap_Hello_init), 0);
rb_define_method(c, "say_hello", RUBY_METHOD_FUNC(wrap_Hello_sayHello), 0);
}
示例6: init_IdMapDb
// init
void init_IdMapDb()
{
cIdMapDb = rb_define_class_under(GettextpoHelper, "IdMapDb", rb_cObject);
rb_define_singleton_method(cIdMapDb, "new", RUBY_METHOD_FUNC(cIdMapDb_new), 1);
rb_define_method(cIdMapDb, "create", RUBY_METHOD_FUNC(cIdMapDb_create), 1);
rb_define_method(cIdMapDb, "normalize_database", RUBY_METHOD_FUNC(cIdMapDb_normalize_database), 0);
rb_define_method(cIdMapDb, "get_min_id", RUBY_METHOD_FUNC(cIdMapDb_get_min_id), 1);
rb_define_method(cIdMapDb, "get_min_id_array", RUBY_METHOD_FUNC(cIdMapDb_get_min_id_array), 2);
}
示例7: Initialize
void Initialize()
{
rb_mStorage = rb_define_module_under(rb_mJubatus, "Storage");
rb_cBasicStorage = rb_define_class_under(rb_mStorage, "BasicStorage", rb_cObject);
rb_define_alloc_func(rb_cBasicStorage, storage_alloc);
rb_define_method(rb_cBasicStorage, "initialize", RUBY_METHOD_FUNC(storage_init), 0);
rb_define_method(rb_cBasicStorage, "type", RUBY_METHOD_FUNC(storage_type), 0);
}
示例8: Init_sort
void Init_sort() {
VALUE c = rb_define_class("Sort", rb_cObject);
rb_define_alloc_func(c, wrap_Sort_alloc);
rb_define_private_method(c, "initialize", RUBY_METHOD_FUNC(wrap_Sort_init), 1);
rb_define_method(c, "inspect", RUBY_METHOD_FUNC(wrap_Sort_toString), 0);
rb_define_method(c, "to_s", RUBY_METHOD_FUNC(wrap_Sort_toString), 0);
rb_define_method(c, "greet", RUBY_METHOD_FUNC(wrap_Sort_greet), 0);
rb_define_method(c, "values", RUBY_METHOD_FUNC(wrap_Sort_getValues), 0);
}
示例9: define_ruby_class
void
define_ruby_class()
{
if (rb_klass)
return;
/*
* opencv = rb_define_module("OpenCV");
* cvmat = rb_define_class_under(opencv, "CvMat", rb_cObject);
*
* note: this comment is used by rdoc.
*/
VALUE opencv = rb_module_opencv();
VALUE cvmat = cCvMat::rb_class();
rb_klass = rb_define_class_under(opencv, "IplImage", cvmat);
rb_define_alloc_func(rb_klass, rb_allocate);
rb_define_singleton_method(rb_klass, "load", RUBY_METHOD_FUNC(rb_load_image), -1);
rb_define_private_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
rb_define_method(rb_klass, "get_roi", RUBY_METHOD_FUNC(rb_get_roi), 0);
rb_define_alias(rb_klass, "roi", "get_roi");
rb_define_method(rb_klass, "set_roi", RUBY_METHOD_FUNC(rb_set_roi), 1);
rb_define_alias(rb_klass, "roi=", "set_roi");
rb_define_method(rb_klass, "reset_roi", RUBY_METHOD_FUNC(rb_reset_roi), 0);
rb_define_method(rb_klass, "get_coi", RUBY_METHOD_FUNC(rb_get_coi), 0);
rb_define_alias(rb_klass, "coi", "get_coi");
rb_define_method(rb_klass, "set_coi", RUBY_METHOD_FUNC(rb_set_coi), 1);
rb_define_alias(rb_klass, "coi=", "set_coi");
rb_define_method(rb_klass, "reset_coi", RUBY_METHOD_FUNC(rb_reset_coi), 0);
rb_define_method(rb_klass, "smoothness", RUBY_METHOD_FUNC(rb_smoothness), -1);
}
示例10: Init_sash
void Init_sash() {
VALUE mSash = rb_define_module("Sash");
rb_define_singleton_method(mSash, "digest", RUBY_METHOD_FUNC(rb_digest), -1);
rb_define_singleton_method(mSash, "base64", RUBY_METHOD_FUNC(rb_base64), -1);
rb_define_const(mSash, "METHOD_SDBM", INT2FIX(0));
rb_define_const(mSash, "METHOD_DJB2", INT2FIX(1));
sMethod = ID2SYM(rb_intern("method"));
rb_gc_mark(sMethod);
}
示例11: Init_ruby_bluetooth
// The initialization method for this module
void Init_ruby_bluetooth()
{
bt_module = rb_define_module("Bluetooth");
bt_device_class = rb_define_class_under(bt_module, "Device", rb_cObject);
bt_devices_class = rb_define_class_under(bt_module, "Devices", rb_cObject);
rb_define_singleton_method(bt_devices_class, "scan", RUBY_METHOD_FUNC(bt_devices_scan), 0);
rb_define_method(bt_device_class, "initialize", RUBY_METHOD_FUNC(bt_device_new), 2);
rb_define_attr(bt_device_class, "addr", Qtrue, Qfalse);
rb_define_attr(bt_device_class, "name", Qtrue, Qfalse);
rb_undef_method(bt_devices_class, "initialize");
}
示例12: _equal
/*
* call-seq:
* == image -> bool
*
* compares two image.
*
*
*/
DLL_LOCAL VALUE _equal(VALUE self, VALUE other)
{
equal_obj obj;
obj.self = _self;
obj.other = other;
return rb_rescue(
RUBY_METHOD_FUNC(_equal_block),(VALUE)&obj,
RUBY_METHOD_FUNC(_equal_rescue),Qnil
);
}
示例13: Init_client
void Init_client () {
mysql_module = rb_define_module("MySQL");
binlog_class = rb_define_class_under(mysql_module, "Binlog", rb_cObject);
client_class = rb_define_class_under(binlog_class, "Client", rb_cObject);
rb_define_private_method (client_class, "initialize", RUBY_METHOD_FUNC(mysql_binlog_client_initialize), 1);
rb_define_method(client_class, "connect", RUBY_METHOD_FUNC(mysql_binlog_client_connect), 0);
rb_define_method(client_class, "set_position", RUBY_METHOD_FUNC(mysql_binlog_client_set_position), 1);
rb_define_method(client_class, "get_position", RUBY_METHOD_FUNC(mysql_binlog_client_get_position), 0);
rb_define_method(client_class, "wait_for_next_event", RUBY_METHOD_FUNC(mysql_binlog_client_wait_for_next_event), 0);
}
示例14: Init_bayeux_sioux
extern "C" void Init_bayeux_sioux()
{
const VALUE mod_sioux = rb_define_module_under( rb_define_module( "Rack" ), "Sioux" );
VALUE class_ = rb_define_class_under( mod_sioux, "SiouxBayeuxImplementation", rb_cObject );
rb_define_alloc_func( class_, alloc_bayeux );
rb_define_method( class_, "run", RUBY_METHOD_FUNC( run_bayeux ), 2 );
rb_define_method( class_, "[]=", RUBY_METHOD_FUNC( update_node_bayeux ), 2 );
rb_define_method( class_, "subscribe_for_testing", RUBY_METHOD_FUNC( subscribe_bayeux ), 1 );
Init_pubsub_sioux();
}
示例15: Init_OgreMovableObjectListener
void Init_OgreMovableObjectListener(VALUE rb_mOgre)
{
#if 0
rb_mOgre = rb_define_module("Ogre");
rb_mOgreMovableObject = rb_define_module_under(rb_mOgre,"MovableObject");
#endif
rb_mOgreMovableObjectListener = rb_define_module_under(rb_mOgreMovableObject,"Listener");
rb_define_method(rb_mOgreMovableObjectListener,"object_destroyed",RUBY_METHOD_FUNC(Ogre_dummy1),1);// in ogre.y
rb_define_method(rb_mOgreMovableObjectListener,"object_attached",RUBY_METHOD_FUNC(Ogre_dummy1),1);// in ogre.y
rb_define_method(rb_mOgreMovableObjectListener,"object_detached",RUBY_METHOD_FUNC(Ogre_dummy1),1);// in ogre.y
rb_define_method(rb_mOgreMovableObjectListener,"object_moved",RUBY_METHOD_FUNC(Ogre_dummy1),1);// in ogre.y
}