My Project
|
for automatic C function NPL.activate() without registration. More...
#include <NPLActivationFile.h>
Public Types | |
typedef NPL::NPLReturnCode(* | NPL_Activate_CallbackFunc) (INPLRuntimeState *pState) |
Public Member Functions | |
NPL_C_Func_ActivationFile (const std::string &filename) | |
virtual NPL::NPLReturnCode | OnActivate (INPLRuntimeState *pState) |
Function to be called when NPL.activate(filename, {msg}); subclass should always overwrite this function. More... | |
![]() | |
void | addref () const |
add reference count of the object. More... | |
bool | delref () const |
decrease reference count of the object. More... | |
int | GetRefCount () const |
get the reference count | |
virtual int | Release () |
Protected Member Functions | |
void | SetFunctionByName (const std::string &filename) |
Protected Attributes | |
NPL_Activate_CallbackFunc | m_pFuncCallBack |
![]() | |
int | m_refcount |
for automatic C function NPL.activate() without registration.
for example, you have a static C function named as below. must be qualified as extern "C" to avoid the symbol name being mangled. extern "C"{ NPL::NPLReturnCode NPL_activate_script_helloworld_cpp(INPLRuntimeState* pState); } NPL.activate("script/helloworld.cpp", {}) or NPL.activate("script_helloworld.cpp", {}) will both activate it, however 2 instances of this class object is created.
|
virtual |
Function to be called when NPL.activate(filename, {msg}); subclass should always overwrite this function.
usage: the input message in secure code format. Read data as follows: auto msg = NPLHelper::MsgStringToNPLTable(pState->GetCurrentMsg(), pState->GetCurrentMsgLength()); std::string sType = msg["type"];
Implements NPL::INPLActivationFile.