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


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

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


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

示例1: getTiObjectFromJsObject

/* Call back for V8 named properties.  This is the entry point for setting
 * properties from js.  We handle the properties we know and let V8 handle
 * all other properties.
 */
Handle<Value> TiObject::_propSetter(Local<String> prop, Local<Value> value, const AccessorInfo& info)
{
    HandleScope handleScope;
    Handle<Object> result;
    TiObject* obj = getTiObjectFromJsObject(info.Holder());
    if (obj == NULL)
    {
        // We are not tracking this object so let V8 handle it.
        info.Holder()->ForceSet(prop, value);
        return value;
    }
    return obj->setPropHelper(*String::Utf8Value(prop), value, &TiObject::setValue);
}
开发者ID:HazemKhaled,项目名称:titanium_mobile_blackberry,代码行数:17,代码来源:TiObject.cpp

示例2: getTiObjectFromJsObject

/* Call back for V8 named properties.  This is the entry point for accessing
 * properties from js.  We handle the properties we know and let V8 handle
 * all other properties.
 */
Handle<Value> TiObject::_propGetter(Local<String> prop, const AccessorInfo& info)
{
    HandleScope handleScope;
    Handle<Object> result;
    TiObject* obj = getTiObjectFromJsObject(info.Holder());
    if (obj == NULL)
    {
        // Returns "empty". This will cause V8 to go back to default lookup.
        return result;
    }
    Handle<ObjectTemplate> global = getObjectTemplateFromJsObject(info.Holder());
    String::Utf8Value propName(prop);
    const char* propString = (const char*)(*propName);
    TiObject* propObject = obj->onLookupMember(propString);
    if (propObject == NULL)
    {
        // TODO: Fix the following block of commented out code. Currently it breaks
        // Titanium runtime.
        /*
        if(obj->canAddMembers())
        {
            // If we're allowed to add members, return an "empty" result
            // so V8 will handle it. V8 will set the value internally so
            // we can ignore non-Titanium objects.
            return result;
        }
        */
        return Handle<Value>();
    }
    Handle<Value> ret = propObject->getValue();
    if (!ret.IsEmpty())
    {
        return handleScope.Close(ret);
    }
    if ((propObject->hasMembers()) || (propObject->isFunction()))
    {
        result = global->NewInstance();
        propObject->setValue(result);
        setTiObjectToJsObject(result, propObject);
    }
    else
    {
        propObject->release();
        return handleScope.Close(propObject->getValue());
    }
    propObject->release();
    return handleScope.Close(result);
}
开发者ID:saggy,项目名称:titanium_mobile_blackberry,代码行数:52,代码来源:TiObject.cpp

示例3: nroSetter

/* Generic setter for all NdbRecordObjects
*/
void nroSetter(Local<String>, Local<Value> value, const AccessorInfo& info) 
{
  NdbRecordObject * nro = 
    static_cast<NdbRecordObject *>(info.Holder()->GetPointerFromInternalField(1));
  int nField = info.Data()->Int32Value();
  nro->setField(nField, value);
}
开发者ID:Bendalexis,项目名称:mysql-js,代码行数:9,代码来源:ValueObject.cpp

示例4: New

Handle<Value> get_classification(Local<String> property, const AccessorInfo &info) {
  const NdbError *err = unwrapPointer<const NdbError *>(info.Holder());

  switch(err->classification) {
    MAP_CODE(NoError);
    MAP_CODE(ApplicationError);
    MAP_CODE(NoDataFound);
    MAP_CODE(ConstraintViolation);
    MAP_CODE(SchemaError);
    MAP_CODE(UserDefinedError);
    MAP_CODE(InsufficientSpace);
    MAP_CODE(TemporaryResourceError);
    MAP_CODE(NodeRecoveryError);
    MAP_CODE(OverloadError);
    MAP_CODE(TimeoutExpired);
    MAP_CODE(UnknownResultError);
    MAP_CODE(InternalError);
    MAP_CODE(FunctionNotImplemented);
    MAP_CODE(UnknownErrorCode);
    MAP_CODE(NodeShutdown);
    MAP_CODE(SchemaObjectExists);
    MAP_CODE(InternalTemporary);
  }
  return String::New("-unknown-");
}
开发者ID:Bendalexis,项目名称:mysql-js,代码行数:25,代码来源:NdbError_wrapper.cpp

示例5:

Handle<Value> ODBCResult::FetchModeGetter(Local<String> property, const AccessorInfo &info) {
  HandleScope scope;

  ODBCResult *obj = ObjectWrap::Unwrap<ODBCResult>(info.Holder());

  return scope.Close(Integer::New(obj->m_fetchMode));
}
开发者ID:hcsoft,项目名称:nodewebhis,代码行数:7,代码来源:odbc_result.cpp

示例6: setter_enabled

void PushbotsModule::setter_enabled(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
	LOGD(TAG, "set enabled");
	HandleScope scope;

	JNIEnv *env = titanium::JNIScope::getEnv();
	if (!env) {
		LOGE(TAG, "Failed to get environment, enabled wasn't set");
		return;
	}

	static jmethodID methodID = NULL;
	if (!methodID) {
		methodID = env->GetMethodID(PushbotsModule::javaClass, "setEnabled", "(Ljava/lang/Boolean;)V");
		if (!methodID) {
			const char *error = "Couldn't find proxy method 'setEnabled' with signature '(Ljava/lang/Boolean;)V'";
			LOGE(TAG, error);
		}
	}

	titanium::Proxy* proxy = titanium::Proxy::unwrap(info.Holder());
	if (!proxy) {
		return;
	}

	jvalue jArguments[1];

	bool isNew_0;
	
	if (!value->IsNull()) {
		Local<Value> arg_0 = value;
		jArguments[0].l =
			titanium::TypeConverter::jsValueToJavaObject(env, arg_0, &isNew_0);
	} else {
		jArguments[0].l = NULL;
	}

	jobject javaProxy = proxy->getJavaObject();
	env->CallVoidMethodA(javaProxy, methodID, jArguments);

	if (!JavaObject::useGlobalRefs) {
		env->DeleteLocalRef(javaProxy);
	}



			if (isNew_0) {
				env->DeleteLocalRef(jArguments[0].l);
			}


	if (env->ExceptionCheck()) {
		titanium::JSException::fromJavaException();
		env->ExceptionClear();
	}




}
开发者ID:appcelerator-forks,项目名称:drmas.Pushbots,代码行数:60,代码来源:com.pushbots.android.PushbotsModule.cpp

示例7: SetStmtCacheSize

/*
   DESCRIPTION
     Set Accessor of stmtCacheSize property
*/
void Oracledb::SetStmtCacheSize ( Local<String> property, Local<Value> value,
                                  const AccessorInfo& info)
{
  HandleScope scope;
  Oracledb* oracledb = ObjectWrap::Unwrap<Oracledb>(info.Holder());
  NJS_SET_PROP_UINT(oracledb->stmtCacheSize_, value, "stmtCacheSize");
}
开发者ID:Dahriel,项目名称:node-oracledb,代码行数:11,代码来源:njsOracle.cpp

示例8: PropertySetter

void MSMap::PropertySetter (Local<String> property, Local<Value> value, const AccessorInfo& info) {
  MSMap *map = ObjectWrap::Unwrap<MSMap>(info.Holder());
  v8::String::AsciiValue n(property);
  if (strcmp(*n, "width") == 0) {
    map->this_->width = value->Int32Value();
  } else if (strcmp(*n, "height") == 0) {
    map->this_->height = value->Int32Value();
  } else if (strcmp(*n, "maxsize") == 0) {
    map->this_->maxsize = value->Int32Value();
  } else if (strcmp(*n, "units") == 0) {
    int32_t units = value->Int32Value();
    if (units >= MS_INCHES && units <= MS_NAUTICALMILES) {
      map->this_->units = (MS_UNITS) units;
    }
  } else if (strcmp(*n, "resolution") == 0) {
    map->this_->resolution = value->NumberValue();
  } else if (strcmp(*n, "defresolution") == 0) {
    map->this_->defresolution = value->NumberValue();
  } else if (strcmp(*n, "name") == 0) {
    REPLACE_STRING(map->this_->name, value);
  } else if (strcmp(*n, "imagetype") == 0) {
    REPLACE_STRING(map->this_->imagetype, value);
  } else if (strcmp(*n, "shapepath") == 0) {
    REPLACE_STRING(map->this_->shapepath, value);
  } else if (strcmp(*n, "projection") == 0) {
    v8::String::AsciiValue _v_(value->ToString());
    msLoadProjectionString(&(map->this_->projection), *_v_);
  } else if (strcmp(*n, "mappath") == 0) {
    REPLACE_STRING(map->this_->mappath, value);
  }
}
开发者ID:MarkHauenstein,项目名称:node-mapserver,代码行数:31,代码来源:ms_map.cpp

示例9: SetOutFormat

/*
   DESCRIPTION
     Set Accessor of outFormat property
*/
void Oracledb::SetOutFormat ( Local<String> property, Local<Value> value,
                              const AccessorInfo& info )
{
  HandleScope scope;
  Oracledb* oracledb = ObjectWrap::Unwrap<Oracledb>(info.Holder());
  NJS_SET_PROP_UINT(oracledb->outFormat_, value, "outFormat");
}
开发者ID:Dahriel,项目名称:node-oracledb,代码行数:11,代码来源:njsOracle.cpp

示例10: SetIsExternalAuth

/*
   DESCRIPTION
     Set Accessor of isExternalAuth property
*/
void Oracledb::SetIsExternalAuth(Local<String> property, Local<Value> value,
                                 const AccessorInfo& info )
{
  HandleScope scope;
  Oracledb* oracledb = ObjectWrap::Unwrap<Oracledb>(info.Holder());
  oracledb->isExternalAuth_ = value->ToBoolean()->Value();
}
开发者ID:Dahriel,项目名称:node-oracledb,代码行数:11,代码来源:njsOracle.cpp

示例11: Undefined

Handle<Value> Proxy::setIndexedProperty(uint32_t index, Local<Value> value, const AccessorInfo& info)
{
	JNIEnv* env = JNIScope::getEnv();
	if (!env) {
		LOG_JNIENV_GET_ERROR(TAG);
		return Undefined();
	}

	Proxy* proxy = NativeObject::Unwrap<Proxy>(info.Holder());

	bool javaValueIsNew;
	jobject javaValue = TypeConverter::jsValueToJavaObject(value, &javaValueIsNew);
	jobject javaProxy = proxy->getJavaObject();
	env->CallVoidMethod(javaProxy,
		JNIUtil::krollProxySetIndexedPropertyMethod,
		index,
		javaValue);

	if (!JavaObject::useGlobalRefs) {
		env->DeleteLocalRef(javaProxy);
	}
	if (javaValueIsNew) {
		env->DeleteLocalRef(javaValue);
	}

	return value;
}
开发者ID:ayeung,项目名称:titanium_mobile,代码行数:27,代码来源:Proxy.cpp

示例12: nroGetter

/* Generic getter for all NdbRecordObjects
*/
Handle<Value> nroGetter(Local<String>, const AccessorInfo & info) 
{
  NdbRecordObject * nro = 
    static_cast<NdbRecordObject *>(info.Holder()->GetPointerFromInternalField(1));
  int nField = info.Data()->Int32Value();
  return nro->getField(nField);
}                    
开发者ID:Bendalexis,项目名称:mysql-js,代码行数:9,代码来源:ValueObject.cpp

示例13:

Handle<Value> PDFHexStringDriver::GetValue(Local<String> property,const AccessorInfo &info)
{
    HandleScope scope;
    
    Handle<String> result = String::New(ObjectWrap::Unwrap<PDFHexStringDriver>(info.Holder())->TheObject->GetValue().c_str());
    return scope.Close(result);
}
开发者ID:abyr,项目名称:HummusJS,代码行数:7,代码来源:PDFHexStringDriver.cpp

示例14:

Handle<Value> Ti::TiProxy::_Setter (Local<String> property, Local<Value> value, const AccessorInfo& info)
{
	HandleScope handleScope;
	// Ti::TiHelper::LogInternal(QString("Property Setter: ").append(Ti::TiHelper::QStringFromValue(property)));

	// Todo: Come back to this later
	// if(value == info.Holder()->Get(property)) {
	//	 Ti::TiHelper::LogInternal(QString("Already set: ").append(Ti::TiHelper::QStringFromValue(property)));
	//	 return value;
	// }


	Handle<Object> obj = Handle<Object>::Cast(info.Holder());
	// Todo: come back to this - might not be allowing GC to collect proxies
	obj->ForceSet(property, value);
	// for example. scrollView.views = [a,b,c]
	// scrollView.remove(a) <--- removed from view, but still in array
	Handle<External> proxyObject = Handle<External>::Cast(obj->GetHiddenValue(String::New("module")));
	if(proxyObject.IsEmpty())
		proxyObject = Handle<External>::Cast(obj->GetHiddenValue(String::New("proxy")));

	if(proxyObject.IsEmpty())
		return value;

	Ti::TiProxy* tiProxy = static_cast<Ti::TiProxy*>(proxyObject->Value());
	if(tiProxy->properties.contains(Ti::TiHelper::QStringFromValue(property)))
	{

		Ti::TiProperty *prop = tiProxy->properties[Ti::TiHelper::QStringFromValue(property)];
		return handleScope.Close(prop->setValue(value));
	}

	return value;
}
开发者ID:pec1985,项目名称:titanium_mobile_blackberry,代码行数:34,代码来源:Ti_Proxy.cpp

示例15: ThrowException

Handle<Value> Geometry::GetSRID(Local<String> name, const AccessorInfo& info)
{
    Geometry *geom = ObjectWrap::Unwrap<Geometry>(info.Holder());
    const int srid = GEOSGetSRID(geom->geos_geom_);
    if (srid == 0)
        return ThrowException(String::New("couldn't get SRID (maybe it wasn't set)"));
    return Integer::New(srid);
}
开发者ID:netconstructor,项目名称:node-geos,代码行数:8,代码来源:geometry.cpp


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