5#ifndef MOLYBDEN_JS_PROXY_OBJECT_HPP
6#define MOLYBDEN_JS_PROXY_OBJECT_HPP
10#include "molybden/js/js_return_value.hpp"
18class JsProxyObjectRoot;
49class JsProxyObject :
public std::enable_shared_from_this<JsProxyObject> {
78 std::shared_ptr<T>
as();
97 const std::vector<JsValue>& args) = 0;
130 virtual bool hasMethod(
const std::string& method_name) = 0;
161 virtual internal::ProxyObjectType* proxyType() = 0;
174 internal::ProxyObjectType* proxyType()
final;
A JavaScript proxy object.
Definition js_proxy_object.hpp:49
virtual std::string getType()=0
Called when the JavaScript engine requests the proxy object type name.
virtual bool hasMethod(const std::string &method_name)=0
Called when the JavaScript engine requests whether the proxy object has the method with method_name.
virtual std::vector< std::string > enumerateMembers()=0
Called when the JavaScript engine requests all the members of the proxy object.
std::shared_ptr< T > as()
Downcasts the object to the appropriate proxy type.
Definition js_proxy_object_detail.hpp:174
virtual JsValue getProperty(const std::string &property_name)=0
Called when the JavaScript proxy object property with property_name has been accessed to read.
virtual bool hasProperty(const std::string &property_name)=0
Called when the JavaScript engine requests whether the proxy object has the property with property_na...
virtual JsReturnValue call(const std::string &method_name, const std::vector< JsValue > &args)=0
Called when the JavaScript proxy object method with method_name has been called in the corresponding ...
virtual bool setProperty(const std::string &property_name, const JsValue &value)=0
Called when the JavaScript proxy object property with property_name has been accessed to write.
Derive C from JsProxyObjectImpl<C> via CRTP pattern and implement the interface of JsProxyObject.
Definition js_proxy_object.hpp:171
Represents the JS function return value.
Definition js_return_value.hpp:35
A JavaScript value.
Definition js_value.hpp:44