MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / Getter

Function Getter

src/NodeRTLib/CppTemplates/MemberPropertyGetter.cpp:1–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1 static void @(Model.Name)Getter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
2 HandleScope scope;
3
4 if (!NodeRT::Utils::IsWinRtWrapperOf<@(TX.ToWinRT(Model.DeclaringType,true))>(info.This())) {
5 return;
6 }
7
8 @(Model.DeclaringType.Name) *wrapper = @(Model.DeclaringType.Name)::Unwrap<@(Model.DeclaringType.Name)>(info.This());
9
10 try {@{
11 var jsConversionInfo = Converter.ToJS(Model.PropertyType, TX.MainModel.Types.ContainsKey(Model.PropertyType));
12 var winrtConversionInfo = Converter.ToWinRT(Model.PropertyType);}
13 @winrtConversionInfo[0] result = wrapper->_instance->@(Model.Name);
14 info.GetReturnValue().Set(@string.Format(jsConversionInfo[1], "result"));
15 return;
16 } catch (Platform::Exception ^exception) {
17 NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
18 return;
19 }
20 }

Callers

nothing calls this directly

Calls 3

ToJSMethod · 0.80
ToWinRTMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected