11cb0ef41Sopenharmony_ci#ifndef TEST_JS_NATIVE_API_7_FACTORY_WRAP_MYOBJECT_H_ 21cb0ef41Sopenharmony_ci#define TEST_JS_NATIVE_API_7_FACTORY_WRAP_MYOBJECT_H_ 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ci#include <js_native_api.h> 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ciclass MyObject { 71cb0ef41Sopenharmony_ci public: 81cb0ef41Sopenharmony_ci static napi_status Init(napi_env env); 91cb0ef41Sopenharmony_ci static void Destructor(napi_env env, void* nativeObject, void* finalize_hint); 101cb0ef41Sopenharmony_ci static napi_value GetFinalizeCount(napi_env env, napi_callback_info info); 111cb0ef41Sopenharmony_ci static napi_status NewInstance(napi_env env, 121cb0ef41Sopenharmony_ci napi_value arg, 131cb0ef41Sopenharmony_ci napi_value* instance); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci private: 161cb0ef41Sopenharmony_ci MyObject(); 171cb0ef41Sopenharmony_ci ~MyObject(); 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ci static napi_ref constructor; 201cb0ef41Sopenharmony_ci static napi_value New(napi_env env, napi_callback_info info); 211cb0ef41Sopenharmony_ci static napi_value PlusOne(napi_env env, napi_callback_info info); 221cb0ef41Sopenharmony_ci uint32_t counter_; 231cb0ef41Sopenharmony_ci napi_env env_; 241cb0ef41Sopenharmony_ci napi_ref wrapper_; 251cb0ef41Sopenharmony_ci}; 261cb0ef41Sopenharmony_ci 271cb0ef41Sopenharmony_ci#endif // TEST_JS_NATIVE_API_7_FACTORY_WRAP_MYOBJECT_H_ 28