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


C++ AccessorInfo::This方法代码示例

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


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

示例1: Undefined

Handle<Value> ArrayType::PlatformLengthGet(Local<String> property, const AccessorInfo& info) {
  HandleScope scope;
  jobject ob = (jobject)info.This()->GetPointerFromInternalField(0);
  ArrayType *arr = (ArrayType *)info.This()->GetPointerFromInternalField(1);
  JNIEnv *jniEnv = arr->env->getVM()->getJNIEnv();
  jint length = jniEnv->CallIntMethod(ob, arr->getLength);
  if(arr->env->getConv()->CheckForException(jniEnv)) {
    return Undefined();
  }
  return scope.Close(Integer::New(length));
}
开发者ID:CodeFridge,项目名称:anode,代码行数:11,代码来源:ArrayConv.cpp

示例2: ClassNameSetter

	void Widget::ClassNameSetter(Local<String> name, Local<Value> value, const AccessorInfo& info)
	{
		HandleScope scope;

		if (value->IsString()) {
			ClutterActor *instance = ObjectWrap::Unwrap<Actor>(info.This())->_actor;

			ObjectWrap::Unwrap<Widget>(info.This())->hasClassName = TRUE;
			mx_stylable_set_style_class(MX_STYLABLE(instance), *String::Utf8Value(value->ToString()));
			mx_stylable_set_style(MX_STYLABLE(instance), mx_style_get_default());
		}
	}
开发者ID:cfsghost,项目名称:jsdx-toolkit,代码行数:12,代码来源:widget.cpp

示例3: PlatformLengthSet

void ArrayType::PlatformLengthSet(Local<String> property, Local<Value> value, const AccessorInfo& info) {
  HandleScope scope;
  jobject ob = (jobject)info.This()->GetPointerFromInternalField(0);
  ArrayType *arr = (ArrayType *)info.This()->GetPointerFromInternalField(1);
  JNIEnv *jniEnv = arr->env->getVM()->getJNIEnv();
  if(value.IsEmpty()) {
    ThrowException(Exception::ReferenceError(String::New("No value specified")));
    return;
  }
  jint length = (jint)value->IntegerValue();
  jniEnv->CallVoidMethod(ob, arr->setLength, length);
  arr->env->getConv()->CheckForException(jniEnv);
}
开发者ID:CodeFridge,项目名称:anode,代码行数:13,代码来源:ArrayConv.cpp

示例4:

 Handle<v8::Value> Function::GetOnlyReadsMemory (Local<String> property, const AccessorInfo& info)
 {
   HandleScope scope;
   Function* fun = ObjectWrap::Unwrap<Function>(info.This());
   Handle<v8::Value> result = Boolean::New(fun->llvm_fun->onlyReadsMemory());
   return scope.Close(result);
 }
开发者ID:JulianoSousa,项目名称:echojs,代码行数:7,代码来源:function.cpp

示例5: Undefined

Handle<Value> Interface::PlatformAttrGet(Local<String> property, const AccessorInfo& info) {
  HandleScope scope;
  jobject ob = (jobject)info.This()->GetPointerFromInternalField(0);
  int attrData = info.Data()->Int32Value();
  int attrIdx = attrData & 0xffff;
  int clsid = attrData >> 16;
  Env *env = Env::getEnv_nocheck();
  Interface *interface = env->getInterface(clsid);
  if(interface) {
    Attribute *attr = interface->attributes->addr(attrIdx);
    JNIEnv *jniEnv = interface->env->getVM()->getJNIEnv();
    jniEnv->PushLocalFrame(256);
    jobject jVal = jniEnv->CallStaticObjectMethod(interface->jPlatformStub, interface->jPlatformGet, ob, attrIdx);
    if(env->getConv()->CheckForException(jniEnv)) {
      jniEnv->PopLocalFrame(0);
      return Undefined();
    }
    Local<Value> val;
    int result = interface->conv->ToV8Value(jniEnv, jVal, attr->type, &val);
    jniEnv->PopLocalFrame(0);
    if(result == OK) {
      return scope.Close(val);
    }
    interface->conv->ThrowV8ExceptionForErrno(result);
  }
  return Undefined();
}
开发者ID:amolmk,项目名称:anode,代码行数:27,代码来源:Interface.cpp

示例6: if

Handle<Value> Layer::get_prop(Local<String> property,
                         const AccessorInfo& info)
{
    HandleScope scope;
    Layer* l = ObjectWrap::Unwrap<Layer>(info.This());
    std::string a = TOSTR(property);
    if (a == "name")
        return scope.Close(String::New(l->layer_->name().c_str()));
    else if (a == "srs")
        return scope.Close(String::New(l->layer_->srs().c_str()));
    else if (a == "styles") {
        std::vector<std::string> const& style_names = l->layer_->styles();
        Local<Array> s = Array::New(style_names.size());
        for (unsigned i = 0; i < style_names.size(); ++i)
        {
            s->Set(i, String::New(style_names[i].c_str()) );
        }
        return scope.Close(s);
    }
    else if (a == "datasource") {
        mapnik::datasource_ptr ds = l->layer_->datasource();
        if (ds)
        {
            return scope.Close(Datasource::New(ds));
        }
    }
    return Undefined();
}
开发者ID:netconstructor,项目名称:node-mapnik,代码行数:28,代码来源:mapnik_layer.cpp

示例7:

void
Image::SetOnerror(Local<String>, Local<Value> val, const AccessorInfo &info) {
  if (val->IsFunction()) {
    Image *img = ObjectWrap::Unwrap<Image>(info.This());
    img->onerror = Persistent<Function>::New(Handle<Function>::Cast(val));
  }
}
开发者ID:ngocdaothanh,项目名称:jsg,代码行数:7,代码来源:Image.cpp

示例8:

void
NodeSandbox::node_setDebugOnCrash(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
  SandboxWrapper* wrap;
  wrap = node::ObjectWrap::Unwrap<SandboxWrapper>(info.This());
  wrap->sbox->m_debuggerOnCrash = value->ToBoolean()->Value();
}
开发者ID:codius,项目名称:codius-sandbox,代码行数:7,代码来源:sandbox-node-module.cpp

示例9: New

Handle<Value>
NodeSandbox::node_getDebugOnCrash(Local<String> property, const AccessorInfo& info)
{
  SandboxWrapper* wrap;
  wrap = node::ObjectWrap::Unwrap<SandboxWrapper>(info.This());
  return Boolean::New (wrap->sbox->m_debuggerOnCrash);
}
开发者ID:codius,项目名称:codius-sandbox,代码行数:7,代码来源:sandbox-node-module.cpp

示例10:

Handle<Array> jsWindow::WindowEnum( const AccessorInfo &info )
{
    HandleScope scope;

    Handle<Array> retval = Local<Array>::New(Array::New());

    Local<Object> self = info.This();
    Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
    void* ptr = wrap->Value();
    jsWindow* el = static_cast<jsWindow*>(ptr);

    map<string, int> prop_list;
    size_t i;
    for (i = 0; i < ro_props.size(); ++i) {
        prop_list[ro_props[i]] = 1;
    }
    jsPropertyMap::iterator it;
    for (it = el->props.begin(); it != el->props.end(); ++it) {
        prop_list[it->first] = 1;
    }
    map<string, int>::iterator ins;
    i = 0;
    for (ins = prop_list.begin(); ins != prop_list.end(); ++ins) {
        string val = ins->first;
        retval->Set(Number::New(i), String::New(val.c_str()));
        i++;
    }

    return scope.Close(retval);
}
开发者ID:abhishekbhalani,项目名称:webapptools,代码行数:30,代码来源:jsWindow.cpp

示例11: justificationSetter

void FieldDefn::justificationSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
{
	HandleScope scope;
	FieldDefn *def = ObjectWrap::Unwrap<FieldDefn>(info.This());
	

	OGRJustification justification;
	std::string str = TOSTR(value);
	if(value->IsString()){
		if(str == "Left") {
			justification = OJLeft;
		} else if (str == "Right") {
			justification = OJRight;
		} else if (str == "Undefined") {
			justification = OJUndefined; 
		} else {
			NODE_THROW("Unrecognized justification");
			return;
		}
	} else if (value->IsNull() || value->IsUndefined()){
		justification = OJUndefined;
	} else {
		NODE_THROW("justification must be a string or undefined");
		return;
	}
	
	def->this_->SetJustify(justification);
}
开发者ID:jarped,项目名称:node-gdal,代码行数:28,代码来源:gdal_field_defn.cpp

示例12: SetSize

void NodeFFT::SetSize (Local<String> property, Local<Value> value, const AccessorInfo &info) {
	NodeFFT *nfft = ObjectWrap::Unwrap<NodeFFT>(info.This());

	if (!nfft->reset(value->Uint32Value())) {
		/* TODO: Throw an error somehow */
	}
}
开发者ID:EQ4,项目名称:node-dsp,代码行数:7,代码来源:fft.cpp

示例13: Base_SetA

void Base_SetA(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
    Base* ptr = GetObjectPtr(info.This());
    assert(ptr);

    ptr->a = value->Int32Value();
}
开发者ID:Kanma,项目名称:Athena-Scripting,代码行数:7,代码来源:Base.cpp

示例14: New

Handle<Value> Base_GetA(Local<String> property, const AccessorInfo &info)
{
    Base* ptr = GetObjectPtr(info.This());
    assert(ptr);

    return Integer::New(ptr->a);
}
开发者ID:Kanma,项目名称:Athena-Scripting,代码行数:7,代码来源:Base.cpp

示例15:

	Handle<Value> Widget::ClassNameGetter(Local<String> name, const AccessorInfo& info)
	{
		HandleScope scope;

		/* This widget has no class name */
		if (!ObjectWrap::Unwrap<Widget>(info.This())->hasClassName) {
			return scope.Close(
				String::New("")
			);
		}

		ClutterActor *instance = ObjectWrap::Unwrap<Actor>(info.This())->_actor;

		return scope.Close(
			String::New(mx_stylable_get_style_class(MX_STYLABLE(instance)))
		);
	}
开发者ID:cfsghost,项目名称:jsdx-toolkit,代码行数:17,代码来源:widget.cpp


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