Poco::JS::Bridge

class BridgeHolder

File Information

Library: JS/Bridge
Package: Bridging
Header: Poco/JS/Bridge/BridgeWrapper.h

Description

This is used by the BridgeWrapper to hold information about the bridged object, including it's Remoting URI and information necessary for implementing event callbacks.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Member Summary

Member Functions: clear, disableEvent, disableEvents, enableEvent, enableEvents, find, fireEvent, getPersistent, handleEvent, onExecutorStopped, registerHolder, setPersistent, subscriberURI, unregisterHolder, uri

Inherited Functions: duplicate, referenceCount, release

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < BridgeHolder >;

Constructors

BridgeHolder

BridgeHolder(
    const std::string & uri
);

Creates the BridgeHolder.

Destructor

~BridgeHolder virtual

~BridgeHolder();

Destroys the BridgeHolder.

Member Functions

clear

void clear();

Resets the associated JavaScript object.

disableEvent

void disableEvent(
    const std::string & event
);

Removes the given event from the set of handled events.

enableEvent

void enableEvent(
    const std::string & event
);

Adds the given event to the set of handled events.

enableEvents

void enableEvents();

Enables remote events by setting up the necessary Remoting machinery to deliver events.

find static

static Ptr find(
    const std::string & subscriberURI
);

Finds the Holder in the global holder map.

fireEvent

void fireEvent(
    const std::string & event,
    const std::string & args
);

Fires the event with the given name in the JavaScript environment.

getPersistent inline

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

Returns the associated JavaScript object.

handleEvent

bool handleEvent(
    const std::string & event
);

Returns true if the given event is handled.

setPersistent

void setPersistent(
    const v8::Persistent < v8::Object > & jsObject
);

Sets the associated JavaScript object.

subscriberURI inline

const std::string & subscriberURI() const;

Returns the event subscriber URI.

uri inline

const std::string & uri() const;

Returns the Remoting URI.

disableEvents protected

void disableEvents();

onExecutorStopped protected

void onExecutorStopped();

registerHolder protected

void registerHolder();

unregisterHolder protected

void unregisterHolder();

Securely control IoT edge devices from anywhere   Connect a Device