| 261 | template <typename ArgType, int ArgConst, typename RetType, typename FuncT, FuncT fn, template <typename FuncTT, FuncTT fnt> class SimNodeT = SimNode_ExtFuncCall> |
| 262 | #endif |
| 263 | inline auto addExternPropertyForType ( Module & mod, const ModuleLibrary & lib, const char * name, const char * cppName = nullptr, |
| 264 | bool explicitConst=false, SideEffects sideEffects = SideEffects::none) { |
| 265 | #if DAS_SLOW_CALL_INTEROP |
| 266 | using SimNodeType = SimNodeT<FuncT>; |
| 267 | auto fnX = new ExternalFn<FuncT, fn, SimNodeType, FuncT>(name, cppName); |
| 268 | #else |
| 269 | using SimNodeType = SimNodeT<FuncT, fn>; |
| 270 | auto fnX = new ExternalFn<FuncT, fn, SimNodeType, FuncT>(name, cppName); |
| 271 | #endif |
| 272 | vector<TypeDeclPtr> types(2); |
| 273 | types[0] = makeType<RetType>(lib); |
| 274 | types[1] = makeType<ArgType>(lib); |
| 275 | types[1]->constant = ArgConst; |
| 276 | fnX->constructExternal(types); |
| 277 | defaultTempFn tempFn; |
| 278 | tempFn(fnX); |
| 279 | fnX->arguments[0]->type->explicitConst = explicitConst; |
| 280 | fnX->setSideEffects(sideEffects); |
| 281 | fnX->propertyFunction = true; |
| 282 | DAS_ASSERTF(!fnX->result->isSmartPointer(), "property function can't return smart pointer %s::%s", mod.name.c_str(), name); |
| 283 | #if VERIFY_JIT_ARGUMENTS |
| 284 | VerifyFn<FuncT, fn>::verify(fnX); |
| 285 | #endif |
| 286 | mod.addFunction(fnX,true); // yes, this one can fail. same C++ bound property can be in multiple classes before or after refactor |
| 287 | return fnX; |
| 288 | } |
| 289 | |
| 290 | #if DAS_SLOW_CALL_INTEROP |
| 291 | template <typename FuncT, FuncT fn, template <typename FuncTT> class SimNodeT = SimNode_ExtFuncCall, typename QQ = defaultTempFn> |
nothing calls this directly
no test coverage detected