v8toolkit
0.0.1
Utility library for embedding V8 Javascript engine in a c++ program
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <type_traits>
#include <algorithm>
#include <iostream>
#include <vector>
#include <utility>
#include <assert.h>
#include <EASTL/vector_map.h>
#include "wrapped_class_base.h"
#include "v8toolkit.h"
#include "casts.hpp"
#include "v8_class_wrapper_impl.h"
Go to the source code of this file.
Namespaces | |
v8toolkit | |
Macros | |
#define | USE_EASTL_FOR_INTERNALS |
#define | V8TOOLKIT_DEBUG(format_string, ...) |
#define | V8TOOLKIT_V8CLASSWRAPPER_NO_POINTER_NO_REFERENCE_SFINAE !std::is_pointer<T>::value && !std::is_reference<T>::value |
#define | V8TOOLKIT_V8CLASSWRAPPER_FULL_TEMPLATE_SFINAE_PREFIX std::is_base_of<WrappedClassBase, T>::value |
#define | V8TOOLKIT_V8CLASSWRAPPER_USE_REAL_TEMPLATE_SFINAE |
#define | V8TOOLKIT_V8CLASSWRAPPER_USE_FAKE_TEMPLATE_SFINAE |
Typedefs | |
template<class... ArgTs> | |
using | MapT = eastl::vector_map< ArgTs... > |
Functions | |
template<class T > | |
std::string | v8toolkit::type_details () |
template<class T , std::enable_if_t< std::is_pointer< T >::value||std::is_reference< T >::value, int > = 0> | |
T & | v8toolkit::get_object_from_embedded_cpp_object (v8::Isolate *isolate, v8::Local< v8::Value > value) |
Variables | |
V8ClassWrapperInstanceRegistry | v8toolkit::wrapper_registery |
std::map< v8::Isolate *, std::vector< std::string > > | v8toolkit::used_constructor_name_list_map |
struct v8toolkit::WrapAsMostDerived |
Definition at line 160 of file v8_class_wrapper.h.
struct v8toolkit::TypeChecker |
Definition at line 190 of file v8_class_wrapper.h.
class v8toolkit::V8ClassWrapper |
Provides a mechanism for creating javascript-ready objects from an arbitrary C++ class Can provide a JS constructor method or wrap objects created in another c++ function
Const types should not be wrapped directly. Instead, a const version of a non-const type will automatically be created and populated with read-only members and any const-qualified method added to the non-const version.
All members/methods must be added, then finalize() called, then any desired constructors may be created.
struct v8toolkit::V8ClassWrapper< T, V8TOOLKIT_V8CLASSWRAPPER_USE_REAL_TEMPLATE_SFINAE >::NamedPropertyCallbackData |
Definition at line 1477 of file v8_class_wrapper.h.
#define USE_EASTL_FOR_INTERNALS |
Definition at line 15 of file v8_class_wrapper.h.
#define V8TOOLKIT_DEBUG | ( | format_string, | |
... | |||
) |
Definition at line 48 of file v8_class_wrapper.h.
Referenced by v8toolkit::V8ClassWrapper< T, V8TOOLKIT_V8CLASSWRAPPER_USE_REAL_TEMPLATE_SFINAE >::_add_method(), v8toolkit::V8ClassWrapper< T, V8TOOLKIT_V8CLASSWRAPPER_USE_REAL_TEMPLATE_SFINAE >::cast(), v8toolkit::V8ClassWrapper< T, V8TOOLKIT_V8CLASSWRAPPER_USE_REAL_TEMPLATE_SFINAE >::get_cpp_object(), v8toolkit::get_object_from_embedded_cpp_object(), v8toolkit::DestructorBehavior_Delete< T >::operator()(), v8toolkit::DestructorBehavior_LeaveAlone::operator()(), v8toolkit::CastToJS< T *, std::enable_if_t< is_wrapped_type_v< T > > >::operator()(), v8toolkit::ParameterBuilder< T, std::enable_if_t< std::is_copy_constructible_v< T > &&is_wrapped_type_v< T > > >::operator()(), and v8toolkit::V8ClassWrapper< T, V8TOOLKIT_V8CLASSWRAPPER_USE_REAL_TEMPLATE_SFINAE >::wrap_existing_cpp_object().
#define V8TOOLKIT_V8CLASSWRAPPER_NO_POINTER_NO_REFERENCE_SFINAE !std::is_pointer<T>::value && !std::is_reference<T>::value |
Definition at line 276 of file v8_class_wrapper.h.
#define V8TOOLKIT_V8CLASSWRAPPER_FULL_TEMPLATE_SFINAE_PREFIX std::is_base_of<WrappedClassBase, T>::value |
Definition at line 278 of file v8_class_wrapper.h.
#define V8TOOLKIT_V8CLASSWRAPPER_USE_REAL_TEMPLATE_SFINAE |
Allows user to specify a list of types to instantiate real V8ClassWrapper template for – CastToNative/CastToJS will otherwise try to instantiate it for a very large number of types which can drastically slow down compilation. Setting an explicit value for this is NOT required - it is just a compile-time, compile-RAM (and maybe binary size) optimizatioan
Definition at line 297 of file v8_class_wrapper.h.
#define V8TOOLKIT_V8CLASSWRAPPER_USE_FAKE_TEMPLATE_SFINAE |
Definition at line 301 of file v8_class_wrapper.h.
using MapT = eastl::vector_map<ArgTs...> |
Definition at line 20 of file v8_class_wrapper.h.