这篇教程C++ Dictionary函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Dictionary函数的典型用法代码示例。如果您正苦于以下问题:C++ Dictionary函数的具体用法?C++ Dictionary怎么用?C++ Dictionary使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Dictionary函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Dictionaryvoid ILightingEngineFactory::add_common_params_metadata( Dictionary& metadata, const bool add_lighting_samples){ metadata.dictionaries().insert( "enable_ibl", Dictionary() .insert("type", "bool") .insert("default", "on") .insert("label", "Enable IBL") .insert("help", "Enable image-based lighting")); if (add_lighting_samples) { metadata.dictionaries().insert( "dl_light_samples", Dictionary() .insert("type", "float") .insert("default", "1.0") .insert("label", "Light Samples") .insert("help", "Number of samples used to estimate direct lighting")); metadata.dictionaries().insert( "ibl_env_samples", Dictionary() .insert("type", "float") .insert("default", "1.0") .insert("label", "IBL Samples") .insert("help", "Number of samples used to estimate environment lighting")); }}
开发者ID:caomw,项目名称:appleseed,代码行数:31,
示例2: DictionaryDictionaryArray GradientEnvironmentEDFFactory::get_widget_definitions() const{ DictionaryArray definitions; definitions.push_back( Dictionary() .insert("name", "horizon_exitance") .insert("label", "Horizon Exitance") .insert("widget", "entity_picker") .insert("entity_types", Dictionary() .insert("color", "Colors")) .insert("use", "required") .insert("default", "")); definitions.push_back( Dictionary() .insert("name", "zenith_exitance") .insert("label", "Zenith Exitance") .insert("widget", "entity_picker") .insert("entity_types", Dictionary() .insert("color", "Colors")) .insert("use", "required") .insert("default", "")); return definitions;}
开发者ID:Len3d,项目名称:appleseed,代码行数:28,
示例3: DictionaryDictionaryArray FisheyeLensCameraFactory::get_input_metadata() const{ DictionaryArray metadata = CameraFactory::get_input_metadata(); CameraFactory::add_film_metadata(metadata); CameraFactory::add_lens_metadata(metadata); CameraFactory::add_clipping_metadata(metadata); CameraFactory::add_shift_metadata(metadata); metadata.push_back( Dictionary() .insert("name", "projection_type") .insert("label", "Projection Type") .insert("type", "enumeration") .insert("items", Dictionary() .insert("Equisolid Angle", "equisolid_angle") .insert("Equidistant", "equidistant") .insert("Stereographic", "stereographic") .insert("Thoby", "thoby")) .insert("default", "equisolid_angle") .insert("use", "required")); return metadata;}
开发者ID:appleseedhq,项目名称:appleseed,代码行数:25,
示例4: TEST_FTEST_F(AnimationAnimationV8Test, SpecifiedDurationGetter){ Vector<Dictionary, 0> jsKeyframes; v8::Handle<v8::Object> timingInputWithDuration = v8::Object::New(m_isolate); setV8ObjectPropertyAsNumber(timingInputWithDuration, "duration", 2.5); Dictionary timingInputDictionaryWithDuration = Dictionary(v8::Handle<v8::Value>::Cast(timingInputWithDuration), m_isolate); RefPtrWillBeRawPtr<Animation> animationWithDuration = createAnimation(element.get(), jsKeyframes, timingInputDictionaryWithDuration, exceptionState); RefPtrWillBeRawPtr<AnimationNodeTiming> specifiedWithDuration = animationWithDuration->timing(); Nullable<double> numberDuration; String stringDuration; specifiedWithDuration->getDuration("duration", numberDuration, stringDuration); EXPECT_FALSE(numberDuration.isNull()); EXPECT_EQ(2.5, numberDuration.get()); EXPECT_TRUE(stringDuration.isNull()); v8::Handle<v8::Object> timingInputNoDuration = v8::Object::New(m_isolate); Dictionary timingInputDictionaryNoDuration = Dictionary(v8::Handle<v8::Value>::Cast(timingInputNoDuration), m_isolate); RefPtrWillBeRawPtr<Animation> animationNoDuration = createAnimation(element.get(), jsKeyframes, timingInputDictionaryNoDuration, exceptionState); RefPtrWillBeRawPtr<AnimationNodeTiming> specifiedNoDuration = animationNoDuration->timing(); Nullable<double> numberDuration2; String stringDuration2; specifiedNoDuration->getDuration("duration", numberDuration2, stringDuration2); EXPECT_TRUE(numberDuration2.isNull()); EXPECT_FALSE(stringDuration2.isNull()); EXPECT_EQ("auto", stringDuration2);}
开发者ID:dalecurtis,项目名称:mojo,代码行数:32,
示例5: DictionaryDictionaryArray LambertianBRDFFactory::get_widget_definitions() const{ DictionaryArray definitions; definitions.push_back( Dictionary() .insert("name", "reflectance") .insert("label", "Reflectance") .insert("widget", "entity_picker") .insert("entity_types", Dictionary() .insert("color", "Colors") .insert("texture_instance", "Textures")) .insert("use", "required") .insert("default", "")); definitions.push_back( Dictionary() .insert("name", "reflectance_multiplier") .insert("label", "Reflectance Multiplier") .insert("widget", "entity_picker") .insert("entity_types", Dictionary().insert("texture_instance", "Textures")) .insert("use", "optional") .insert("default", "1.0")); return definitions;}
开发者ID:EgoIncarnate,项目名称:appleseed,代码行数:28,
示例6: DictionaryPassRefPtr<EntrySync> WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemSyncURL(WorkerGlobalScope* worker, const String& url, ExceptionCode& ec){ ec = 0; KURL completedURL = worker->completeURL(url); ScriptExecutionContext* secureContext = worker->scriptExecutionContext(); if (!AsyncFileSystem::isAvailable() || !secureContext->securityOrigin()->canAccessFileSystem() || !secureContext->securityOrigin()->canRequest(completedURL)) { ec = FileException::SECURITY_ERR; return 0; } FileSystemType type; String filePath; if (!completedURL.isValid() || !DOMFileSystemBase::crackFileSystemURL(completedURL, type, filePath)) { ec = FileException::ENCODING_ERR; return 0; } FileSystemSyncCallbackHelper readFileSystemHelper; LocalFileSystem::localFileSystem().readFileSystem(worker, type, FileSystemCallbacks::create(readFileSystemHelper.successCallback(), readFileSystemHelper.errorCallback(), worker, type), SynchronousFileSystem); RefPtr<DOMFileSystemSync> fileSystem = readFileSystemHelper.getResult(ec); if (!fileSystem) return 0; RefPtr<EntrySync> entry = fileSystem->root()->getDirectory(filePath, Dictionary(), ec); if (ec == FileException::TYPE_MISMATCH_ERR) return fileSystem->root()->getFile(filePath, Dictionary(), ec); return entry.release();}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:29,
示例7: DictionaryDictionaryArray ObjectInstanceFactory::get_input_metadata(){ DictionaryArray metadata; metadata.push_back( Dictionary() .insert("name", "ray_bias_method") .insert("label", "Ray Bias Method") .insert("type", "enumeration") .insert("items", Dictionary() .insert("No Ray Bias", "none") .insert("Shift Along Surface Normal", "normal") .insert("Shift Along Incoming Direction", "incoming_direction") .insert("Shift Along Outgoing Direction", "outgoing_direction")) .insert("use", "optional") .insert("default", "none")); metadata.push_back( Dictionary() .insert("name", "ray_bias_distance") .insert("label", "Ray Bias Distance") .insert("type", "text") .insert("use", "optional") .insert("default", "0.0")); return metadata;}
开发者ID:yesoce,项目名称:appleseed,代码行数:28,
示例8: DictionaryDictionaryArray SheenBRDFFactory::get_input_metadata() const{ DictionaryArray metadata; metadata.push_back( Dictionary() .insert("name", "reflectance") .insert("label", "Reflectance") .insert("type", "colormap") .insert("entity_types", Dictionary() .insert("color", "Colors") .insert("texture_instance", "Texture Instances")) .insert("use", "required") .insert("default", "0.5")); metadata.push_back( Dictionary() .insert("name", "reflectance_multiplier") .insert("label", "Reflectance Multiplier") .insert("type", "colormap") .insert("entity_types", Dictionary().insert("texture_instance", "Texture Instances")) .insert("use", "optional") .insert("default", "1.0")); return metadata;}
开发者ID:appleseedhq,项目名称:appleseed,代码行数:28,
示例9: DictionaryDictionaryArray ConstantHemisphereEnvironmentEDFFactory::get_input_metadata() const{ DictionaryArray metadata; metadata.push_back( Dictionary() .insert("name", "upper_hemi_radiance") .insert("label", "Upper Hemisphere Radiance") .insert("type", "colormap") .insert("entity_types", Dictionary().insert("color", "Colors")) .insert("use", "required") .insert("default", "0.7") .insert("help", "Upper hemisphere radiance")); metadata.push_back( Dictionary() .insert("name", "lower_hemi_radiance") .insert("label", "Lower Hemisphere Radiance") .insert("type", "colormap") .insert("entity_types", Dictionary().insert("color", "Colors")) .insert("use", "required") .insert("default", "0.3") .insert("help", "Lower hemisphere radiance")); return metadata;}
开发者ID:appleseedhq,项目名称:appleseed,代码行数:28,
示例10: godot_variant_as_dictionarygodot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self) { godot_dictionary raw_dest; const Variant *self = (const Variant *)p_self; Dictionary *dest = (Dictionary *)&raw_dest; memnew_placement(dest, Dictionary(self->operator Dictionary())); // operator = is overloaded by Dictionary return raw_dest;}
开发者ID:suptoasty,项目名称:godot,代码行数:7,
示例11: ERR_FAIL_CONDvoid ConnectionsDialog::_connect() { TreeItem *it = tree->get_selected(); ERR_FAIL_COND(!it); String signal=it->get_metadata(0).operator Dictionary()["name"]; NodePath dst_path=connect_dialog->get_dst_path(); Node *target = node->get_node(dst_path); ERR_FAIL_COND(!target); StringName dst_method=connect_dialog->get_dst_method(); bool defer=connect_dialog->get_deferred(); Vector<Variant> binds = connect_dialog->get_binds(); StringArray args = it->get_metadata(0).operator Dictionary()["args"]; undo_redo->create_action("Connect '"+signal+"' to '"+String(dst_method)+"'"); undo_redo->add_do_method(node,"connect",signal,target,dst_method,binds,CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0)); undo_redo->add_undo_method(node,"disconnect",signal,target,dst_method); undo_redo->add_do_method(this,"update_tree"); undo_redo->add_undo_method(this,"update_tree"); undo_redo->commit_action(); if (connect_dialog->get_make_callback()) { print_line("request connect"); editor->emit_signal("script_add_function_request",target,dst_method,args); hide(); } update_tree();}
开发者ID:Ranmus,项目名称:godot,代码行数:33,
示例12: DictionaryDictionaryArray ConstantHemisphereEnvironmentEDFFactory::get_widget_definitions() const{ DictionaryArray definitions; definitions.push_back( Dictionary() .insert("name", "upper_hemi_exitance") .insert("label", "Upper Hemisphere Exitance") .insert("widget", "entity_picker") .insert("entity_types", Dictionary().insert("color", "Colors")) .insert("use", "required") .insert("default", "")); definitions.push_back( Dictionary() .insert("name", "lower_hemi_exitance") .insert("label", "Lower Hemisphere Exitance") .insert("widget", "entity_picker") .insert("entity_types", Dictionary().insert("color", "Colors")) .insert("use", "required") .insert("default", "")); return definitions;}
开发者ID:Len3d,项目名称:appleseed,代码行数:26,
示例13: Dictionaryvoid IEDFFactory::add_common_input_metadata(DictionaryArray& metadata){ metadata.push_back( Dictionary() .insert("name", "cast_indirect_light") .insert("label", "Cast Indirect Light") .insert("type", "boolean") .insert("use", "optional") .insert("default", "true")); metadata.push_back( Dictionary() .insert("name", "importance_multiplier") .insert("label", "Importance Multiplier") .insert("type", "numeric") .insert("min_value", "0.0") .insert("max_value", "10.0") .insert("use", "optional") .insert("default", "1.0")); metadata.push_back( Dictionary() .insert("name", "light_near_start") .insert("label", "Light Near Start") .insert("type", "numeric") .insert("min_value", "0.0") .insert("max_value", "10.0") .insert("use", "optional") .insert("default", "0.0"));}
开发者ID:Rapternmn,项目名称:appleseed,代码行数:30,
示例14: anamespace casadi {/**/ingroup expression_tools@{*/ /** /brief Solve a system of equations: A*x = b The solve routine works similar to Matlab's backslash when A is square and nonsingular. The algorithm used is the following: 1. A simple forward or backward substitution if A is upper or lower triangular 2. If the linear system is at most 3-by-3, form the inverse via minor expansion and multiply 3. Permute the variables and equations as to get a (structurally) nonzero diagonal, then perform a QR factorization without pivoting and solve the factorized system. Note 1: If there are entries of the linear system known to be zero, these will be removed. Elements that are very small, or will evaluate to be zero, can still cause numerical errors, due to the lack of pivoting (which is not possible since cannot compare the size of entries) Note 2: When permuting the linear system, a BLT (block lower triangular) transformation is formed. Only the permutation part of this is however used. An improvement would be to solve block-by-block if there are multiple BLT blocks. */ template<typename DataType> Matrix<DataType> solve(const Matrix<DataType>& A, const Matrix<DataType>& b) { return A.zz_solve(b); } /** /brief Computes the Moore-Penrose pseudo-inverse * * If the matrix A is fat (size2>size1), mul(A, pinv(A)) is unity. * If the matrix A is slender (size1<size2), mul(pinv(A), A) is unity. * */ template<typename DataType> Matrix<DataType> pinv(const Matrix<DataType>& A) { return A.zz_pinv();} /** /brief Solve a system of equations: A*x = b */ CASADI_EXPORT Matrix<double> solve(const Matrix<double>& A, const Matrix<double>& b, const std::string& lsolver, const Dictionary& dict = Dictionary()); /** /brief Computes the Moore-Penrose pseudo-inverse * * If the matrix A is fat (size1>size2), mul(A, pinv(A)) is unity. * If the matrix A is slender (size2<size1), mul(pinv(A), A) is unity. * */ CASADI_EXPORT Matrix<double> pinv(const Matrix<double>& A, const std::string& lsolver, const Dictionary& dict = Dictionary());/*@}*/} // namespace casadi
开发者ID:edmundus,项目名称:casadi,代码行数:57,
示例15: TEST_FTEST_F(AnimationAnimationTest, CanCreateAnAnimation){ v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope scope(isolate); v8::Local<v8::Context> context = v8::Context::New(isolate); v8::Context::Scope contextScope(context); Vector<Dictionary> jsKeyframes; v8::Handle<v8::Object> keyframe1 = v8::Object::New(isolate); v8::Handle<v8::Object> keyframe2 = v8::Object::New(isolate); setV8ObjectPropertyAsString(keyframe1, "width", "100px"); setV8ObjectPropertyAsString(keyframe1, "offset", "0"); setV8ObjectPropertyAsString(keyframe1, "easing", "ease-in-out"); setV8ObjectPropertyAsString(keyframe2, "width", "0px"); setV8ObjectPropertyAsString(keyframe2, "offset", "1"); setV8ObjectPropertyAsString(keyframe2, "easing", "cubic-bezier(1, 1, 0.3, 0.3)"); jsKeyframes.append(Dictionary(keyframe1, isolate)); jsKeyframes.append(Dictionary(keyframe2, isolate)); String value1; ASSERT_TRUE(jsKeyframes[0].get("width", value1)); ASSERT_EQ("100px", value1); String value2; ASSERT_TRUE(jsKeyframes[1].get("width", value2)); ASSERT_EQ("0px", value2); RefPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, 0); Element* target = animation->target(); EXPECT_EQ(*element.get(), *target); const KeyframeEffectModel::KeyframeVector keyframes = toKeyframeEffectModel(animation->effect())->getFrames(); EXPECT_EQ(0, keyframes[0]->offset()); EXPECT_EQ(1, keyframes[1]->offset()); const AnimatableValue* keyframe1Width = keyframes[0]->propertyValue(CSSPropertyWidth); const AnimatableValue* keyframe2Width = keyframes[1]->propertyValue(CSSPropertyWidth); ASSERT(keyframe1Width); ASSERT(keyframe2Width); EXPECT_TRUE(keyframe1Width->isLength()); EXPECT_TRUE(keyframe2Width->isLength()); EXPECT_EQ("100px", toAnimatableLength(keyframe1Width)->toCSSValue()->cssText()); EXPECT_EQ("0px", toAnimatableLength(keyframe2Width)->toCSSValue()->cssText()); EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut)), *keyframes[0]->easing()); EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), *keyframes[1]->easing());}
开发者ID:wangshijun,项目名称:Blink,代码行数:54,
示例16: mono_object_to_DictionaryDictionary mono_object_to_Dictionary(MonoObject *p_dict) { Dictionary ret; GDMonoUtils::MarshalUtils_DictToArrays dict_to_arrays = CACHED_METHOD_THUNK(MarshalUtils, DictionaryToArrays); MonoArray *keys = NULL; MonoArray *values = NULL; MonoObject *ex = NULL; dict_to_arrays(p_dict, &keys, &values, &ex); if (ex) { mono_print_unhandled_exception(ex); ERR_FAIL_V(Dictionary()); } int length = mono_array_length(keys); for (int i = 0; i < length; i++) { MonoObject *key_obj = mono_array_get(keys, MonoObject *, i); MonoObject *value_obj = mono_array_get(values, MonoObject *, i); Variant key = key_obj ? mono_object_to_variant(key_obj) : Variant(); Variant value = value_obj ? mono_object_to_variant(value_obj) : Variant(); ret[key] = value; } return ret;}
开发者ID:arcanis,项目名称:godot,代码行数:29,
示例17: applyTimingInputString Timing applyTimingInputString(String timingProperty, String timingPropertyValue) { v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate); setV8ObjectPropertyAsString(timingInput, timingProperty, timingPropertyValue); Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), m_isolate); return TimingInput::convert(timingInputDictionary); }
开发者ID:ericwilligers,项目名称:blink,代码行数:7,
示例18: DictionaryDictionary SphereObjectFactory::get_model_metadata() const{ return Dictionary() .insert("name", Model) .insert("label", "Sphere Object");}
开发者ID:appleseedhq,项目名称:appleseed,代码行数:7,
示例19: mono_object_newMonoObject *create_managed_from(const Dictionary &p_from, GDMonoClass *p_class) { MonoObject *mono_object = mono_object_new(SCRIPTS_DOMAIN, p_class->get_mono_ptr()); ERR_FAIL_NULL_V(mono_object, NULL); // Search constructor that takes a pointer as parameter MonoMethod *m; void *iter = NULL; while ((m = mono_class_get_methods(p_class->get_mono_ptr(), &iter))) { if (strcmp(mono_method_get_name(m), ".ctor") == 0) { MonoMethodSignature *sig = mono_method_signature(m); void *front = NULL; if (mono_signature_get_param_count(sig) == 1 && mono_class_from_mono_type(mono_signature_get_params(sig, &front)) == CACHED_CLASS(IntPtr)->get_mono_ptr()) { break; } } } CRASH_COND(m == NULL); Dictionary *new_dict = memnew(Dictionary(p_from)); void *args[1] = { &new_dict }; MonoException *exc = NULL; GDMonoUtils::runtime_invoke(m, mono_object, args, &exc); UNLIKELY_UNHANDLED_EXCEPTION(exc); return mono_object;}
开发者ID:93i,项目名称:godot,代码行数:29,
示例20: constructJSRTCSessionDescriptionEncodedJSValue JSC_HOST_CALL constructJSRTCSessionDescription(ExecState* exec){ ExceptionCode ec = 0; Dictionary sessionInit; if (exec->argumentCount() > 0) { sessionInit = Dictionary(exec, exec->argument(0)); if (!sessionInit.isObject()) return throwVMError(exec, createTypeError(exec, "Optional RTCSessionDescription constructor argument must be a valid Dictionary")); if (exec->hadException()) return JSValue::encode(jsUndefined()); } DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee()); RefPtr<RTCSessionDescription> sessionDescription = RTCSessionDescription::create(sessionInit, ec); if (ec == TYPE_MISMATCH_ERR) { setDOMException(exec, ec); return throwVMError(exec, createTypeError(exec, "Invalid RTCSessionDescription constructor arguments")); } if (ec) { setDOMException(exec, ec); return throwVMError(exec, createTypeError(exec, "Error creating RTCSessionDescription")); } return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor->globalObject(), RTCSessionDescription, sessionDescription.get()));}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:27,
示例21: assertParamArray& ParamArray::insert_path(const char* path, const char* value){ assert(path); assert(value); vector<string> parts; tokenize(path, PartSeparator, parts); assert(!parts.empty()); Dictionary* leaf = this; for (size_t i = 0; i < parts.size() - 1; ++i) { const string& part = parts[i]; if (!leaf->dictionaries().exist(part)) leaf->insert(part, Dictionary()); leaf = &leaf->dictionary(part); } leaf->insert(parts.back(), value); return *this;}
开发者ID:boberfly,项目名称:gafferDependencies,代码行数:26,
示例22: TEST_FTEST_F(AnimationAnimationV8Test, SetSpecifiedDuration){ Vector<Dictionary, 0> jsKeyframes; v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate); Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), m_isolate); RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, timingInputDictionary, exceptionState); RefPtrWillBeRawPtr<AnimationNodeTiming> specified = animation->timing(); bool isNumber = false; double numberDuration = std::numeric_limits<double>::quiet_NaN(); bool isString = false; String stringDuration = ""; specified->getDuration("duration", isNumber, numberDuration, isString, stringDuration); EXPECT_FALSE(isNumber); EXPECT_TRUE(std::isnan(numberDuration)); EXPECT_TRUE(isString); EXPECT_EQ("auto", stringDuration); specified->setDuration("duration", 2.5); isNumber = false; numberDuration = std::numeric_limits<double>::quiet_NaN(); isString = false; stringDuration = ""; specified->getDuration("duration", isNumber, numberDuration, isString, stringDuration); EXPECT_TRUE(isNumber); EXPECT_EQ(2.5, numberDuration); EXPECT_FALSE(isString); EXPECT_EQ("", stringDuration);}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:30,
示例23: DictionaryDictionary AlbedoAOVFactory::get_model_metadata() const{ return Dictionary() .insert("name", get_model()) .insert("label", "Albedo");}
开发者ID:appleseedhq,项目名称:appleseed,代码行数:7,
示例24: webkitGetUserMediaCallbackstatic v8::Handle<v8::Value> webkitGetUserMediaCallback(const v8::Arguments& args){ if (args.Length() < 2) return throwNotEnoughArgumentsError(args.GetIsolate()); Navigator* imp = V8Navigator::toNative(args.Holder()); ExceptionCode ec = 0; { V8TRYCATCH(Dictionary, options, Dictionary(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined), args.GetIsolate())); if (!options.isUndefinedOrNull() && !options.isObject()) return throwTypeError("Not an object.", args.GetIsolate()); if (args.Length() <= 1 || !args[1]->IsFunction()) return throwTypeError(0, args.GetIsolate()); RefPtr<NavigatorUserMediaSuccessCallback> successCallback = V8NavigatorUserMediaSuccessCallback::create(args[1], getScriptExecutionContext()); RefPtr<NavigatorUserMediaErrorCallback> errorCallback; if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) { if (!args[2]->IsFunction()) return throwTypeError(0, args.GetIsolate()); errorCallback = V8NavigatorUserMediaErrorCallback::create(args[2], getScriptExecutionContext()); } NavigatorMediaStream::webkitGetUserMedia(imp, options, successCallback, errorCallback, ec); if (UNLIKELY(ec)) goto fail; return v8Undefined(); } fail: return setDOMException(ec, args.GetIsolate());}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:27,
示例25: DictionaryDictionary AssemblyFactory::get_model_metadata() const{ return Dictionary() .insert("name", Model) .insert("label", "Generic Assembly");}
开发者ID:appleseedhq,项目名称:appleseed,代码行数:7,
注:本文中的Dictionary函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DieWithError函数代码示例 C++ Dict_new函数代码示例 |