mirror of
https://github.com/openharmony/ace_napi.git
synced 2026-07-22 17:25:23 -04:00
4a50eb04c0
Signed-off-by: wuhy_irobot2013 <wuhuayang@huawei.com> Change-Id: Id4e5ff2fac88dee3357b26dad23287a013d5f518
40 lines
1.4 KiB
C++
40 lines
1.4 KiB
C++
/*
|
|
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef FOUNDATION_ACE_NAPI_NATIVE_ENGINE_IMPL_JERRYSCRIPT_JERRYSCRIPT_NATIVE_REFERENCE_H
|
|
#define FOUNDATION_ACE_NAPI_NATIVE_ENGINE_IMPL_JERRYSCRIPT_JERRYSCRIPT_NATIVE_REFERENCE_H
|
|
|
|
#include "native_engine/native_reference.h"
|
|
|
|
#include "jerryscript_headers.h"
|
|
|
|
class JerryScriptNativeReference : public NativeReference {
|
|
public:
|
|
JerryScriptNativeReference(JerryScriptNativeEngine* engine, NativeValue* value, uint32_t initialRefcount);
|
|
virtual ~JerryScriptNativeReference();
|
|
|
|
virtual uint32_t Ref() override;
|
|
virtual uint32_t Unref() override;
|
|
virtual NativeValue* Get() override;
|
|
virtual operator NativeValue*() override;
|
|
|
|
private:
|
|
JerryScriptNativeEngine* engine_;
|
|
jerry_value_t value_;
|
|
uint32_t refCount_;
|
|
};
|
|
|
|
#endif /* FOUNDATION_ACE_NAPI_NATIVE_ENGINE_IMPL_JERRYSCRIPT_JERRYSCRIPT_NATIVE_REFERENCE_H */
|