API documentation  2.0rc1
Classes | Functions
cheerp Namespace Reference

Classes

class  ArrayRef
 
struct  CallbackHelper
 
struct  CallbackHelper< T, R(C::*)(Args...) const >
 
struct  CallbackHelper< T, R(C::*)(Args...)>
 
struct  CallbackHelperBase
 
struct  CallbackHelperBase< T, false, R, Args... >
 
struct  CallbackHelperBase< T, true, R, Args... >
 
struct  InvokeHelper
 
struct  InvokeHelper< void >
 
struct  TypedArrayForPointerType
 
struct  TypedArrayForPointerType< double >
 
struct  TypedArrayForPointerType< float >
 
struct  TypedArrayForPointerType< signed char >
 
struct  TypedArrayForPointerType< signed int >
 
struct  TypedArrayForPointerType< signed short >
 
struct  TypedArrayForPointerType< unsigned char >
 
struct  TypedArrayForPointerType< unsigned int >
 
struct  TypedArrayForPointerType< unsigned short >
 

Functions

template<typename... Args>
void console_log (const char *message, Args &&... optionalParams)
 
template<class T >
client::EventListenerCallback (const T &func)
 
template<class R , class... Args>
client::EventListenerCallback (R(*func)(Args...))
 
template<typename P , typename T = typename TypedArrayForPointerType<P>::type>
T * MakeTypedArray (const P *ptr, size_t size=0)
 
template<typename T >
T * MakeTypedArray (const void *ptr, size_t size=0)
 
client::ArrayBufferViewMakeArrayBufferView (const void *ptr, size_t size=0)
 
template<class T >
ArrayRef< T > makeArrayRef (T *obj)
 

Function Documentation

◆ Callback() [1/2]

template<class T >
client::EventListener* cheerp::Callback ( const T &  func)

Adapter from C++ functors and lambdas to code callable from JavaScript and the browser The implementation tries hard to directly forward the C++ function to JavaScript woth zero overhead when possible. For functors and capturing lambdas an std::function object and a JavaScript closure are created.

◆ Callback() [2/2]

template<class R , class... Args>
client::EventListener* cheerp::Callback ( R(*)(Args...)  func)

Adapter from C++ funtions to code callable from JavaScript and the browser The implementation directly forward the C++ function to JavaScript with zero overhead.

◆ console_log()

template<typename... Args>
void cheerp::console_log ( const char *  message,
Args &&...  optionalParams 
)

◆ MakeArrayBufferView()

client::ArrayBufferView* cheerp::MakeArrayBufferView ( const void *  ptr,
size_t  size = 0 
)
inline

◆ makeArrayRef()

template<class T >
ArrayRef<T> cheerp::makeArrayRef ( T *  obj)

◆ MakeTypedArray() [1/2]

template<typename P , typename T = typename TypedArrayForPointerType<P>::type>
T* cheerp::MakeTypedArray ( const P *  ptr,
size_t  size = 0 
)

◆ MakeTypedArray() [2/2]

template<typename T >
T* cheerp::MakeTypedArray ( const void *  ptr,
size_t  size = 0 
)