Exposure of C++ objects to the polyglot library is done through the usage of Proxy objects provided by the polyglot library.
More...
|
static poly_value | handler_release_collectable (poly_thread thread, poly_callback_info args) |
|
template<typename Config > |
static poly_value | native_handler_no_args (poly_thread thread, poly_callback_info args) |
| Generic handler to be used with pure native functions, no interaction with the polyglot library is done: More...
|
|
template<typename Config > |
static poly_value | polyglot_handler_no_args (poly_thread thread, poly_callback_info args) |
| Generic handler to be used with functions that interact with the polyglot library: More...
|
|
template<typename Config > |
static poly_value | native_handler_fixed_args (poly_thread thread, poly_callback_info args) |
| Generic handler to be used with pure native functions, no interaction with the polyglot library is done: More...
|
|
template<typename Config > |
static poly_value | polyglot_handler_fixed_args (poly_thread thread, poly_callback_info args) |
| Generic handler to be used with functions that interact with the polyglot library, this is: More...
|
|
template<typename Config > |
static poly_value | native_handler_variable_args (poly_thread thread, poly_callback_info args) |
| Generic handler to be used with pure native functions, no interaction with the polyglot library is done: More...
|
|
template<typename
T,
Collectable_type t>
class shcore::polyglot::Polyglot_native_wrapper< T, t >
Exposure of C++ objects to the polyglot library is done through the usage of Proxy objects provided by the polyglot library.
Those proxy objects implement the needed operations to treat a C++ object as a standard polyglot object, each of those operations require a C++ callback for the execution.
In the C++ side it is needed to create the callbacks required by the proxy objects in the polyglot library, for each C++ object type to be supported there's a wrapper class which provides the needed callbacks.
When a C++ object is given to the polyglot library, 2 things are needed:
- The registrations of the C++ callbacks
- The identification of the target C++ instance to be used on the callbacks
Each object wrapper provides the above. For the second item, a Collectable object is created and given to the polyglot proxy object. This Collectable object contains the necessary information to identify the target C++ object on which the operation will be executed.
This class holds general callback function to be used to release the created Collectable objects once the Proxy object is garbage collected in the Polyglot library.