26#ifndef MYSQLSHDK_SCRIPTING_POLYGLOT_NATIVE_WRAPPERS_POLYGLOT_OBJECT_BRIDGE_H_
27#define MYSQLSHDK_SCRIPTING_POLYGLOT_NATIVE_WRAPPERS_POLYGLOT_OBJECT_BRIDGE_H_
44 virtual std::string &
append_descr(std::string &s_out,
int indent = -1,
45 int quote_strings = 0)
const;
47 virtual std::string &
append_repr(std::string &s_out)
const;
52 virtual std::vector<std::string>
get_members()
const;
55 virtual bool has_member(
const std::string &prop)
const;
70 virtual size_t length()
const {
return 0; }
73 bool has_method(
const std::string &name)
const;
85 virtual const std::vector<std::string> *
properties()
const {
return nullptr; }
86 virtual const std::vector<std::string> *
methods()
const {
return nullptr; }
Definition: utils_json.h:49
Definition: polyglot_object_bridge.h:38
virtual size_t length() const
Returns the number of indexable members.
Definition: polyglot_object_bridge.h:70
virtual const std::vector< std::string > * methods() const
Definition: polyglot_object_bridge.h:86
virtual Value call(const std::string &, const Argument_list &)
Calls the named method with the given args.
Definition: polyglot_object_bridge.h:79
virtual bool is_indexed() const
Returns the value of a member.
Definition: polyglot_object_bridge.h:61
bool has_method(const std::string &name) const
Returns true if a method with the given name exists.
Definition: polyglot_object_bridge.cc:55
virtual ~Object_bridge()=default
virtual void append_json(shcore::JSON_dumper &dumper) const
Definition: polyglot_object_bridge.cc:33
virtual std::vector< std::string > get_members() const
Returns the list of members that this object has.
Definition: polyglot_object_bridge.cc:63
virtual void set_member(const std::string &, Value)
Sets the value of a member.
Definition: polyglot_object_bridge.h:58
virtual Value get_member(const std::string &) const
Returns the value of a member.
Definition: polyglot_object_bridge.h:76
virtual const std::vector< std::string > * properties() const
Definition: polyglot_object_bridge.h:85
virtual std::string class_name() const =0
virtual std::string & append_repr(std::string &s_out) const
Definition: polyglot_object_bridge.cc:44
virtual void set_member(size_t, Value)
Sets the value of a member.
Definition: polyglot_object_bridge.h:67
virtual Value get_member(size_t) const
Returns the value of a member.
Definition: polyglot_object_bridge.h:64
virtual std::string & append_descr(std::string &s_out, int indent=-1, int quote_strings=0) const
Definition: polyglot_object_bridge.cc:39
virtual bool has_member(const std::string &prop) const
Verifies if the object has a member.
Definition: polyglot_object_bridge.cc:48
std::shared_ptr< Object_bridge > Object_bridge_t
Definition: polyglot_object_bridge.h:89
Definition: file_system_exceptions.h:34
std::vector< Value > Argument_list
Definition: jit_executor_value.h:429
Pointer to a function that may be implemented in any language.
Definition: jit_executor_value.h:130