MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
shcore::polyglot::Java_script_interface Class Reference

#include <polyglot_javascript.h>

Inheritance diagram for shcore::polyglot::Java_script_interface:
[legend]

Public Member Functions

 ~Java_script_interface () override=default
 
const char * get_language_id () const override
 
void initialize (const std::shared_ptr< IFile_system > &fs={}) override
 
void finalize () override
 
poly_value undefined () const override
 Return the a guest language interpretation of the Undefined C++ value. More...
 
bool is_undefined (poly_value value) const override
 Returns true if the provided value is undefined in the guest language. More...
 
poly_value array_buffer (const std::string &data) const override
 Return the guest language interpretation of a binary string. More...
 
bool is_object (poly_value object, std::string *class_name=nullptr) const override
 Return true if the guest language identifies the value as an object. More...
 
const std::vector< std::string > & keywords () const override
 Retrieves the list of keywords in the guest language. More...
 
 Polyglot_language (Polyglot_common_context *common_context, const std::string &debug_port="")
 
 Polyglot_language (const Polyglot_language &)=delete
 
 Polyglot_language (Polyglot_language &&)=delete
 
- Public Member Functions inherited from shcore::polyglot::Polyglot_language
 Polyglot_language (Polyglot_common_context *common_context, const std::string &debug_port="")
 
 Polyglot_language (const Polyglot_language &)=delete
 
Polyglot_languageoperator= (const Polyglot_language &)=delete
 
 Polyglot_language (Polyglot_language &&)=delete
 
Polyglot_languageoperator= (Polyglot_language &&)=delete
 
virtual ~Polyglot_language ()=default
 
virtual void init_context_builder ()
 
Polyglot_languagelanguage ()
 The polyglot_utils file has the following functions that can be used to export C++ functions as polyglot global functions: More...
 
void throw_jit_executor_exception (const Jit_executor_exception &exception)
 Throws a specific exception type in the GraalVM environment, with a specific message. More...
 
virtual poly_value from_native_object (const Object_bridge_t &object) const =0
 Converts a C++ object into a representation of the object in the guest language. More...
 
virtual shcore::Value to_native_object (poly_value object, const std::string &class_name)
 Converts a guest language object into its C++ representation. More...
 
void throw_exception_object (const shcore::Dictionary_t &data) const
 Translates a dictionary object into an exception in the guest language. More...
 
void throw_exception_object (const Polyglot_error &data) const
 Translates a Polyglot_error into an exception in the guest language. More...
 
int64_t eval (const std::string &source, const std::string &code_str, poly_value *result) const
 Wraps a call to poly_context_eval. More...
 
poly_value create_source (const std::string &path) const
 
std::pair< Value, bool > debug (const std::string &path)
 Debugs the given script. More...
 
std::pair< Value, bool > execute (const std::string &code_str, const std::string &source)
 Executes the given script. More...
 
virtual bool load_plugin (const std::string &path)
 This function should be implemented to provide plugin load support. More...
 
poly_context copy_global_context () const
 Creates a copy of the global context. More...
 
poly_value poly_string (const std::string &data) const
 
std::string to_string (poly_value obj) const
 
poly_context context () const
 
poly_thread thread () const
 
const std::shared_ptr< Polyglot_object > & globals () const
 
poly_reference store (poly_value value)
 
void erase (poly_reference value)
 
void set_global (const std::string &name, const Value &value) const
 
void set_global (const std::string &name, poly_value value) const
 
void set_global_function (const std::string &name, poly_callback callback, void *data=nullptr)
 
Store get_global (const std::string &name) const
 
void terminate ()
 
bool is_terminating () const
 
Script_scope enter_script (const std::string &s)
 
Value convert (poly_value value) const
 
poly_value convert (const Value &value) const
 
Argument_list convert_args (const std::vector< poly_value > &args) const
 
poly_value type_info (poly_value value) const
 
bool get_member (poly_value object, const char *name, poly_value *member) const
 
std::string current_script_folder () const
 
Polyglot_common_contextcommon_context ()
 

Private Member Functions

poly_value create_exception_object (const std::string &error, poly_value exception_object) const override
 

Private Attributes

Store m_undefined
 

Additional Inherited Members

- Protected Member Functions inherited from shcore::polyglot::Polyglot_language
poly_value wrap_callback (poly_callback callback, void *data) const
 
void clear_is_terminating ()
 
- Protected Attributes inherited from shcore::polyglot::Polyglot_language
Polyglot_common_contextm_common_context
 
poly_thread m_thread = nullptr
 
poly_context_builder m_context_builder = nullptr
 
Store m_context
 
std::unique_ptr< Polyglot_type_bridgerm_types
 
std::shared_ptr< Polyglot_objectm_globals
 
Current_script m_current_script
 
std::unique_ptr< Polyglot_storagem_storage
 
std::shared_ptr< IFile_systemm_file_system
 
std::string m_debug_port
 

Constructor & Destructor Documentation

◆ ~Java_script_interface()

shcore::polyglot::Java_script_interface::~Java_script_interface ( )
overridedefault

Member Function Documentation

◆ array_buffer()

poly_value shcore::polyglot::Java_script_interface::array_buffer ( const std::string &  data) const
overridevirtual

Return the guest language interpretation of a binary string.

Implements shcore::polyglot::Polyglot_language.

◆ create_exception_object()

poly_value shcore::polyglot::Java_script_interface::create_exception_object ( const std::string &  error,
poly_value  exception_object 
) const
overrideprivatevirtual

◆ finalize()

void shcore::polyglot::Java_script_interface::finalize ( )
overridevirtual

◆ get_language_id()

const char * shcore::polyglot::Java_script_interface::get_language_id ( ) const
inlineoverridevirtual

◆ initialize()

void shcore::polyglot::Java_script_interface::initialize ( const std::shared_ptr< IFile_system > &  fs = {})
overridevirtual

◆ is_object()

bool shcore::polyglot::Java_script_interface::is_object ( poly_value  object,
std::string *  class_name = nullptr 
) const
overridevirtual

Return true if the guest language identifies the value as an object.

Implements shcore::polyglot::Polyglot_language.

◆ is_undefined()

bool shcore::polyglot::Java_script_interface::is_undefined ( poly_value  value) const
overridevirtual

Returns true if the provided value is undefined in the guest language.

Implements shcore::polyglot::Polyglot_language.

◆ keywords()

const std::vector< std::string > & shcore::polyglot::Java_script_interface::keywords ( ) const
overridevirtual

Retrieves the list of keywords in the guest language.

Implements shcore::polyglot::Polyglot_language.

◆ Polyglot_language() [1/3]

shcore::polyglot::Polyglot_language::Polyglot_language ( const Polyglot_language )
delete

◆ Polyglot_language() [2/3]

shcore::polyglot::Polyglot_language::Polyglot_language ( Polyglot_common_context common_context,
const std::string &  debug_port = "" 
)
explicit

◆ Polyglot_language() [3/3]

shcore::polyglot::Polyglot_language::Polyglot_language ( Polyglot_language &&  )
delete

◆ undefined()

poly_value shcore::polyglot::Java_script_interface::undefined ( ) const
overridevirtual

Return the a guest language interpretation of the Undefined C++ value.

Implements shcore::polyglot::Polyglot_language.

Member Data Documentation

◆ m_undefined

Store shcore::polyglot::Java_script_interface::m_undefined
private

The documentation for this class was generated from the following files: