My Project
|
Mono scripting state. More...
#include <MonoScriptingState.h>
Public Member Functions | |
void | Init () |
call this function before calling anything else. More... | |
const char * | GetName () const |
return the name of this runtime state. More... | |
MonoDomain * | GetMonoDomain () |
get the mono domain. | |
void | LoadNPLLib () |
load only NPL related functions. | |
void | LoadParaLib () |
load only Para related functions. | |
virtual void | Release () |
this is something like delete this | |
virtual void * | GetState () |
get the Mono Domain state. More... | |
virtual bool | IsValid () |
return true if the runtime state is valid | |
virtual bool | IsScriptFileLoaded (const string &filepath) |
whether a given script file is loaded. More... | |
virtual bool | LoadFile (const string &filePath, bool bReload) |
load a new CS script file without running it. More... | |
virtual int | DoString (const char *sCall, int nLength=0) |
do string in the current state. More... | |
virtual NPL::NPLReturnCode | ActivateFile (const string &filepath, const char *code=NULL, int nLength=0) |
Activate a local file. More... | |
virtual bool | CreateState (const char *name, NPL::INPLRuntimeState *pState=0) |
load or restore the runtime state More... | |
virtual void | DestroyState () |
destroy the runtime state careful with this function, it will make the state invalid. | |
virtual void | SetNPLRuntimeState (NPL::INPLRuntimeState *pState) |
set the NPL runtime state that this mono scripting state belongs to. More... | |
virtual NPL::INPLRuntimeState * | GetNPLRuntimeState () |
Get the NPL runtime state that this mono scripting state belongs to. | |
void | Init () |
call this function before calling anything else. More... | |
const char * | GetName () const |
return the name of this runtime state. More... | |
MonoDomain * | GetMonoDomain () |
get the mono domain. | |
void | LoadNPLLib () |
load only NPL related functions. | |
void | LoadParaLib () |
load only Para related functions. | |
virtual void | Release () |
this is something like delete this | |
virtual void * | GetState () |
get the Mono Domain state. More... | |
virtual bool | IsValid () |
return true if the runtime state is valid | |
virtual bool | IsScriptFileLoaded (const string &filepath) |
whether a given script file is loaded. More... | |
virtual bool | LoadFile (const string &filePath, bool bReload) |
load a new CS script file without running it. More... | |
virtual int | DoString (const char *sCall, int nLength=0) |
do string in the current state. More... | |
virtual NPL::NPLReturnCode | ActivateFile (const string &filepath, const char *code=NULL, int nLength=0) |
Activate a local file. More... | |
virtual bool | CreateState (const char *name, NPL::INPLRuntimeState *pState=0) |
load or restore the runtime state More... | |
virtual void | DestroyState () |
destroy the runtime state careful with this function, it will make the state invalid. | |
virtual void | SetNPLRuntimeState (NPL::INPLRuntimeState *pState) |
set the NPL runtime state that this mono scripting state belongs to. More... | |
virtual NPL::INPLRuntimeState * | GetNPLRuntimeState () |
Get the NPL runtime state that this mono scripting state belongs to. | |
![]() | |
virtual bool | IsScriptFileLoaded (const std::string &filepath)=0 |
whether a given script file is loaded. More... | |
virtual bool | LoadFile (const std::string &filePath, bool bReload)=0 |
load a new CS script file without running it. More... | |
virtual NPL::NPLReturnCode | ActivateFile (const std::string &filepath, const char *code=NULL, int nLength=0)=0 |
Activate a local file. More... | |
Protected Member Functions | |
void | CreateAppDomain () |
it is safe to call this multiple times. More... | |
void | CreateAppDomain () |
it is safe to call this multiple times. More... | |
Static Protected Member Functions | |
static const char * | GetStringProperty (const char *propertyName, MonoClass *classType, MonoObject *classObject) |
Mono scripting state.
|
virtual |
Activate a local file.
The file should be loaded already.
filepath | pointer to the file path. |
|
virtual |
Activate a local file.
The file should be loaded already.
filepath | pointer to the file path. |
|
protected |
it is safe to call this multiple times.
however only the first time does the init. it will set the mono dir and load the mono configuration for all mono domains.
|
protected |
it is safe to call this multiple times.
however only the first time does the init. it will set the mono dir and load the mono configuration for all mono domains.
in 3.8 which fixed following configuration exception under win32. System.ArgumentException: The 'ExeConfigFilename' argument cannot be null.
|
virtual |
load or restore the runtime state
name | any runtime state name. |
pState | the NPL runtime state that this mono scripting state belongs to. |
Implements NPL::INPLScriptingState.
|
virtual |
load or restore the runtime state
name | any runtime state name. |
pState | the NPL runtime state that this mono scripting state belongs to. |
The official doc says: If your applications has threads that will access Mono, access Mono variables, point to Mono objects, be called back by Mono, these threads must be registered with the Mono runtime using the mono_thread_attach
Implements NPL::INPLScriptingState.
|
virtual |
do string in the current state.
This function is usually called from the scripting interface.
sCall | the string to executed. |
nLength | length in bytes.if this is 0, length will be calculated, but must be smaller than a predefined safe length. If this is positive. any string length is allowed. |
Implements NPL::INPLScriptingState.
|
virtual |
do string in the current state.
This function is usually called from the scripting interface.
sCall | the string to executed. |
nLength | length in bytes.if this is 0, length will be calculated, but must be smaller than a predefined safe length. If this is positive. any string length is allowed. |
Implements NPL::INPLScriptingState.
const char* CMonoScriptingState::GetName | ( | ) | const |
return the name of this runtime state.
if "", it is considered an anonymous name
const char * CMonoScriptingState::GetName | ( | ) | const |
return the name of this runtime state.
if "", it is considered an anonymous name
|
inlinevirtual |
|
inlinevirtual |
void CMonoScriptingState::Init | ( | ) |
call this function before calling anything else.
It will load all NPL modules into the runtime state.
void CMonoScriptingState::Init | ( | void | ) |
call this function before calling anything else.
It will load all NPL modules into the runtime state.
|
virtual |
whether a given script file is loaded.
filePath | the local file path in the following format: [dir0]/[dir1]/[dir2]/[filename.lua] |
|
virtual |
whether a given script file is loaded.
filePath | the local file path in the following format: [dir0]/[dir1]/[dir2]/[filename.lua] |
|
virtual |
load a new CS script file without running it.
If the file is already loaded, it will not be loaded again.
filePath | the local CS script file path, such as "test.dll/test.cs", "test.dll/ParaMono.test.cs", where ParaMono can be a namespace. |
bReload | if true, the file will be reloaded even if it is already loaded. otherwise, the file will only be loaded if it is not loaded yet. |
|
virtual |
load a new CS script file without running it.
If the file is already loaded, it will not be loaded again.
filePath | the local CS script file path, such as "test.dll/test.cs", "test.dll/ParaMono.test.cs", where ParaMono can be a namespace. |
bReload | if true, the file will be reloaded even if it is already loaded. otherwise, the file will only be loaded if it is not loaded yet. |
|
virtual |
set the NPL runtime state that this mono scripting state belongs to.
This function is used internally by NPLRuntimeState.
Implements NPL::INPLScriptingState.
|
virtual |
set the NPL runtime state that this mono scripting state belongs to.
This function is used internally by NPLRuntimeState.
Implements NPL::INPLScriptingState.