当前位置: 首页>>代码示例>>C++>>正文


C++ JLocalEnv::CallStaticLongMethod方法代码示例

本文整理汇总了C++中JLocalEnv::CallStaticLongMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ JLocalEnv::CallStaticLongMethod方法的具体用法?C++ JLocalEnv::CallStaticLongMethod怎么用?C++ JLocalEnv::CallStaticLongMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JLocalEnv的用法示例。


在下文中一共展示了JLocalEnv::CallStaticLongMethod方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getRuntime

extern "C" VALUE
rb_thread_blocking_region(rb_blocking_function_t func, void* data, rb_unblock_function_t ub_func, void* data2)
{
    JLocalEnv env;
    jlong jret = env->CallStaticLongMethod(JRuby_class, JRuby_nativeBlockingRegion, getRuntime(),
            p2j((void *)func), p2j(data),
            p2j((void *)ub_func), p2j(data2));
    checkExceptions(env);

    return (VALUE)(j2p(jret));
}
开发者ID:Epictetus,项目名称:jruby,代码行数:11,代码来源:thread.cpp

示例2: valueToObject

extern "C" unsigned long
rb_big2ulong(VALUE obj)
{
    if (TYPE(obj) == T_BIGNUM) {
        JLocalEnv env;
        jlong result = env->CallStaticLongMethod(RubyBignum_class, RubyBignum_big2ulong_method, valueToObject(env, obj));
        checkExceptions(env);
        return (unsigned long) result;
    } else {
        return (unsigned long) rb_big2ll(obj);
    }
}
开发者ID:ajeygore,项目名称:jruby,代码行数:12,代码来源:bignum.cpp

示例3: size

static VALUE
newString(const char* ptr, int len, int capacity = 0, bool tainted = false)
{
    if (len < 0) {
        rb_raise(rb_eArgError, "negative string size (or size too big)");
    }

    JLocalEnv env;

    jbyteArray bytes = env->NewByteArray(capacity > len ? capacity : len);
    checkExceptions(env);

    if (len > 0 && ptr != NULL) {
        env->SetByteArrayRegion(bytes, 0, len, (jbyte *) ptr);
        checkExceptions(env);
    }

    jlong result = env->CallStaticLongMethod(JRuby_class, JRuby_newString, jruby::getRuntime(), bytes, (jint)len, (jboolean) tainted);
    checkExceptions(env);

    return (VALUE) result;
}
开发者ID:brasten,项目名称:jruby,代码行数:22,代码来源:string.cpp

示例4: nsync

RString*
RubyString::toRString(bool readonly)
{
    if (rwdata.rstring != NULL) {
        if (readonly || !rwdata.readonly) {
            return rwdata.rstring;
        }

        // Switch from readonly to read-write
        rwdata.readonly = false;
        TAILQ_INSERT_TAIL(&jruby::nsyncq, &rwdata.nsync, syncq);
        JLocalEnv env;
        nsync(env);

        return rwdata.rstring;
    }

    JLocalEnv env;
    rwdata.jsync.data = this;
    rwdata.jsync.sync = RubyString_jsync;
    rwdata.nsync.data = this;
    rwdata.nsync.sync = RubyString_nsync;
    rwdata.clean.data = this;
    rwdata.clean.sync = RubyString_clean;
    rwdata.rstring = (RString *) j2p(env->CallStaticLongMethod(JRuby_class, JRuby_getRString, obj));
    checkExceptions(env);
    rwdata.readonly = readonly;

    TAILQ_INSERT_TAIL(&jruby::cleanq, &rwdata.clean, syncq);
    TAILQ_INSERT_TAIL(&jruby::jsyncq, &rwdata.jsync, syncq);
    if (!readonly) {
        TAILQ_INSERT_TAIL(&jruby::nsyncq, &rwdata.nsync, syncq);
    }
    nsync(env);

    return rwdata.rstring;
}
开发者ID:brasten,项目名称:jruby,代码行数:37,代码来源:string.cpp

示例5: return

extern "C" VALUE
rb_class_of(VALUE obj)
{
    JLocalEnv env;
    return (VALUE) env->CallStaticLongMethod(JRuby_class, JRuby_getMetaClass, valueToObject(env, obj));
}
开发者ID:Vouters,项目名称:jruby,代码行数:6,代码来源:class.cpp


注:本文中的JLocalEnv::CallStaticLongMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。