MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / addExternProperty

Function addExternProperty

include/daScript/ast/ast_interop.h:236–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234 template <typename FuncT, FuncT fn, template <typename FuncTT, FuncTT fnt> class SimNodeT = SimNode_ExtFuncCall>
235#endif
236 inline auto addExternProperty ( Module & mod, const ModuleLibrary & lib, const char * name, const char * cppName = nullptr,
237 bool explicitConst=false, SideEffects sideEffects = SideEffects::none ) {
238#if DAS_SLOW_CALL_INTEROP
239 using SimNodeType = SimNodeT<FuncT>;
240 auto fnX = new ExternalFn<FuncT, SimNodeType, FuncT>(fn, name, lib, cppName);
241#else
242 using SimNodeType = SimNodeT<FuncT, fn>;
243 auto fnX = new ExternalFn<FuncT, fn, SimNodeType, FuncT>(name, lib, cppName);
244#endif
245 defaultTempFn tempFn;
246 tempFn(fnX);
247 fnX->arguments[0]->type->explicitConst = explicitConst;
248 fnX->setSideEffects(sideEffects);
249 fnX->propertyFunction = true;
250 DAS_ASSERTF(!fnX->result->isSmartPointer(), "property function can't return smart pointer %s::%s", mod.name.c_str(), name);
251#if VERIFY_JIT_ARGUMENTS
252 VerifyFn<FuncT, fn>::verify(fnX);
253#endif
254 mod.addFunction(fnX,true); // yes, this one can fail. same C++ bound property can be in multiple classes before or after refactor
255 return fnX;
256 }
257
258#if DAS_SLOW_CALL_INTEROP
259 template <typename FuncT, FuncT fn, template <typename FuncTT> class SimNodeT = SimNode_ExtFuncCall, typename QQ = defaultTempFn>

Callers

nothing calls this directly

Calls 5

verifyFunction · 0.85
setSideEffectsMethod · 0.80
isSmartPointerMethod · 0.80
c_strMethod · 0.45
addFunctionMethod · 0.45

Tested by

no test coverage detected