| 1180 | }; |
| 1181 | |
| 1182 | class FunctionReference: public Reference<Function> { |
| 1183 | public: |
| 1184 | FunctionReference(); |
| 1185 | FunctionReference(napi_env env, napi_ref ref); |
| 1186 | |
| 1187 | // A reference can be moved but cannot be copied. |
| 1188 | FunctionReference(Reference<Function>&& other); |
| 1189 | FunctionReference& operator =(Reference<Function>&& other); |
| 1190 | FunctionReference(FunctionReference&& other); |
| 1191 | FunctionReference& operator =(FunctionReference&& other); |
| 1192 | FunctionReference(const FunctionReference&) = delete; |
| 1193 | FunctionReference& operator =(FunctionReference&) = delete; |
| 1194 | |
| 1195 | Napi::Value operator ()(const std::initializer_list<napi_value>& args) const; |
| 1196 | |
| 1197 | Napi::Value Call(const std::initializer_list<napi_value>& args) const; |
| 1198 | Napi::Value Call(const std::vector<napi_value>& args) const; |
| 1199 | Napi::Value Call(napi_value recv, const std::initializer_list<napi_value>& args) const; |
| 1200 | Napi::Value Call(napi_value recv, const std::vector<napi_value>& args) const; |
| 1201 | Napi::Value Call(napi_value recv, size_t argc, const napi_value* args) const; |
| 1202 | |
| 1203 | #ifndef NODE_ADDON_API_DISABLE_NODE_SPECIFIC |
| 1204 | Napi::Value MakeCallback(napi_value recv, |
| 1205 | const std::initializer_list<napi_value>& args, |
| 1206 | napi_async_context context = nullptr) const; |
| 1207 | Napi::Value MakeCallback(napi_value recv, |
| 1208 | const std::vector<napi_value>& args, |
| 1209 | napi_async_context context = nullptr) const; |
| 1210 | Napi::Value MakeCallback(napi_value recv, |
| 1211 | size_t argc, |
| 1212 | const napi_value* args, |
| 1213 | napi_async_context context = nullptr) const; |
| 1214 | #endif // NODE_ADDON_API_DISABLE_NODE_SPECIFIC |
| 1215 | |
| 1216 | Object New(const std::initializer_list<napi_value>& args) const; |
| 1217 | Object New(const std::vector<napi_value>& args) const; |
| 1218 | }; |
| 1219 | |
| 1220 | // Shortcuts to creating a new reference with inferred type and refcount = 0. |
| 1221 | template <typename T> Reference<T> Weak(T value); |
nothing calls this directly
no outgoing calls
no test coverage detected