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

Function addHandleAnnotation

include/daScript/ast/ast_handle.h:959–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

957
958 template <typename T>
959 void addHandleAnnotation ( Module * mod, ModuleLibrary & lib,
960 const string & name,
961 const string & destroyFnName = string(),
962 const string & cppTypeName = string() ) {
963 handleRegistry_registerDump(&dumpHandleLeaks<T>);
964 handleRegistry_registerCount(&countHandleLeaks<T>);
965 mod->addAnnotation(new ManagedHandleAnnotation<T>(lib, name, cppTypeName));
966 addExtern<decltype(&das_handle_equ<T>), das_handle_equ<T>>
967 (*mod, lib, "==", SideEffects::none, "das_handle_equ");
968 addExtern<decltype(&das_handle_nequ<T>), das_handle_nequ<T>>
969 (*mod, lib, "!=", SideEffects::none, "das_handle_nequ");
970 addExtern<decltype(&das_handle_is_alive<T>), das_handle_is_alive<T>>
971 (*mod, lib, "is_alive", SideEffects::accessExternal, "das_handle_is_alive");
972 if ( !destroyFnName.empty() ) {
973 addExtern<decltype(&das_handle_release<T>), das_handle_release<T>>
974 (*mod, lib, destroyFnName.c_str(), SideEffects::modifyExternal, "das_handle_release");
975 }
976 }
977
978 void setParents ( Module * mod, const char * child, const std::initializer_list<const char *> & parents );
979}

Callers

nothing calls this directly

Calls 6

stringClass · 0.85
addAnnotationMethod · 0.80
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected