Class jac::Class
template <class Builder>
Public Static Functions
Type | Name |
---|---|
std::enable_if_t< is_base_of_template_v< ProtoBuilder::Opaque, Bdr > &&std::is_base_of_v< typename Bdr::OpaqueType, T > &&std::is_same_v< Bdr, Builder >, Value > | createInstance (ContextRef ctx, T * instance) Create a new instance of this class in given context. |
JSClassID | getClassId () Get the class id of this class. |
Function | getConstructor (ContextRef ctx) Get the constructor object of this class in given context. |
Object | getProto (ContextRef ctx) Get the prototype object of this class in given context. |
void | init (std::string name, bool isCtor=false) Initialize the class. |
void | initContext (ContextRef ctx) Initialize the class prototype. |
Public Static Functions Documentation
function createInstance
Create a new instance of this class in given context.
template<typename T, typename Bdr>
static inline std::enable_if_t< is_base_of_template_v< ProtoBuilder::Opaque , Bdr > &&std::is_base_of_v< typename Bdr::OpaqueType, T > &&std::is_same_v< Bdr, Builder >, Value > jac::Class::createInstance (
ContextRef ctx,
T * instance
)
Note:
if the class wasn't initialized in the context, it will be initialized
Parameters:
ctx
the contextinstance
a new-allocated instance to be saved as opaque data
Returns:
The new instance
function getClassId
Get the class id of this class.
Returns:
JSClassID
function getConstructor
Get the constructor object of this class in given context.
Note:
if the class wasn't initialized in the context, it will be initialized
Parameters:
ctx
context to work in
Returns:
The constructor object
function getProto
Get the prototype object of this class in given context.
Note:
if the class wasn't initialized in the context, it will be initialized
Parameters:
ctx
context to work in
Returns:
The prototype object
function init
Initialize the class.
Note:
This function should be called only once. Any subsequent calls with different parameters will throw an exception
Parameters:
name
name of the classisCtor
whether or not the class is callable a constructor (if it's callable at all)
function initContext
Initialize the class prototype.
Note:
If the class is already initialized, this function does nothing
Parameters:
ctx
context to work in
The documentation for this class was generated from the following file src/jac/machine/class.h