Poco::JS::Core

template < class T, class RP >

class WeakPersistentWrapper

File Information

Library: JS/Core
Package: Wrappers
Header: Poco/JS/Core/Wrapper.h

Description

Helper for wrapping native types in weak persistent handles.

Takes ownership of the native object and makes sure both the native object and the wrapping JS object are properly destroyed when garbage collected.

Inheritance

Direct Base Classes: WeakPersistentWrapperBase

All Base Classes: WeakPersistentWrapperBase

Member Summary

Member Functions: destruct, persistent

Constructors

WeakPersistentWrapper inline

WeakPersistentWrapper(
    v8::Isolate * pIsolate,
    const v8::Local < v8::Object > & jsObject,
    T pNative
);

WeakPersistentWrapper inline

WeakPersistentWrapper(
    v8::Isolate * pIsolate,
    const v8::MaybeLocal < v8::Object > & maybeJSObject,
    T pNative
);

Destructor

~WeakPersistentWrapper virtual inline

~WeakPersistentWrapper();

Member Functions

destruct static inline

static void destruct(
    const v8::WeakCallbackInfo < WeakPersistentWrapper > & info
);

persistent inline

v8::Persistent < v8::Object > & persistent();

Securely control IoT edge devices from anywhere   Connect a Device