![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
#include <ScriptModule.h>
Public Member Functions | |
DLLEXPORT | ScriptModule (asIScriptEngine *engine, const std::string &name, int id, const std::string &source) |
DLLEXPORT | ~ScriptModule () |
DLLEXPORT void | SetAccessMask (AccessFlags access) |
Sets the access mask to be used for this script. More... | |
DLLEXPORT void | AddAccessRight (AccessFlags newaccess) |
Adds flags to the AccessMask. More... | |
DLLEXPORT asIScriptModule * | GetModule (Lock &guard) |
Builds the script if applicable. More... | |
DLLEXPORT asIScriptModule * | GetModule () |
DLLEXPORT std::shared_ptr< ScriptScript > | GetScriptInstance () |
DLLEXPORT std::string | GetName () |
DLLEXPORT void | Release () |
Releases the internal resources. More... | |
DLLEXPORT const std::string & | GetModuleName () const |
Gets the name of the internal AngelScript module. More... | |
DLLEXPORT int | GetID () |
DLLEXPORT const std::string & | GetSource () const |
DLLEXPORT const std::string & | GetIncompleteSourceCode () |
DLLEXPORT void | DeleteThisModule () |
DLLEXPORT bool | DoesListenersContainSpecificListener (const std::string &listenername, const std::string *generictype=NULL) |
DLLEXPORT void | GetListOfListeners (std::vector< std::shared_ptr< ValidListenerData >> &receiver) |
DLLEXPORT std::string | GetListeningFunctionName (const std::string &listenername, const std::string *generictype=NULL) |
DLLEXPORT std::string | GetInfoString () |
DLLEXPORT void | SetBuildState (const SCRIPTBUILDSTATE &state) |
DLLEXPORT size_t | GetScriptSegmentCount () const |
Gets the number of code segments. More... | |
DLLEXPORT std::shared_ptr< ScriptSourceFileData > | GetScriptSegment (size_t index) const |
Gets the data associated with a code segment. More... | |
DLLEXPORT FORCE_INLINE bool | AddScriptSegment (const std::string &file, int line, const std::string &code) |
Adds a new script section. More... | |
DLLEXPORT bool | AddScriptSegment (std::shared_ptr< ScriptSourceFileData > data) |
The actual implementation of AddScriptSegment. More... | |
DLLEXPORT bool | AddScriptSegmentFromFile (const std::string &file) |
Adds an entire file as a script segment. More... | |
DLLEXPORT bool | ReLoadModuleCode () |
Rebuilds the module and tries to restore data. More... | |
DLLEXPORT void | SetAsInvalid () |
Sets the module as invalid to avoid usage. More... | |
DLLEXPORT void | PrintFunctionsInModule () |
DLLEXPORT bool | OnAddedToBridge (std::shared_ptr< ScriptArgumentsProviderBridge > bridge) |
Call when this module is added to a bridge. More... | |
![]() | |
DLLEXPORT | ThreadSafeGeneric () |
DLLEXPORT | ~ThreadSafeGeneric () |
FORCE_INLINE void | VerifyLock (RecursiveLock &guard) const |
FORCE_INLINE void | VerifyLock (Lock &lockit) const |
Static Public Member Functions | |
static DLLEXPORT int | ScriptModuleIncludeCallback (const char *include, const char *from, CScriptBuilder *builder, void *userParam) |
static DLLEXPORT std::string | ResolvePathToScriptFile (const std::string &inputfilename, const std::string &relativepath, bool checkworkdirrelative=true) |
Finds a path to source file or returns an empty string. More... | |
Static Public Attributes | |
static const std::map< std::string, int > | ListenerNameType |
Additional Inherited Members | |
![]() | |
MutexType | ObjectsLock |
Definition at line 87 of file ScriptModule.h.
ScriptModule::ScriptModule | ( | asIScriptEngine * | engine, |
const std::string & | name, | ||
int | id, | ||
const std::string & | source | ||
) |
Definition at line 15 of file ScriptModule.cpp.
ScriptModule::~ScriptModule | ( | ) |
Definition at line 38 of file ScriptModule.cpp.
|
inline |
|
inline |
Adds a new script section.
Definition at line 185 of file ScriptModule.h.
DLLEXPORT bool Leviathan::ScriptModule::AddScriptSegment | ( | std::shared_ptr< ScriptSourceFileData > | data | ) |
DLLEXPORT bool Leviathan::ScriptModule::AddScriptSegmentFromFile | ( | const std::string & | file | ) |
Adds an entire file as a script segment.
Definition at line 433 of file ScriptModule.cpp.
DLLEXPORT void Leviathan::ScriptModule::DeleteThisModule | ( | ) |
Definition at line 188 of file ScriptModule.cpp.
DLLEXPORT bool Leviathan::ScriptModule::DoesListenersContainSpecificListener | ( | const std::string & | listenername, |
const std::string * | generictype = NULL |
||
) |
Definition at line 131 of file ScriptModule.cpp.
|
inline |
Definition at line 137 of file ScriptModule.h.
|
inline |
Definition at line 147 of file ScriptModule.h.
DLLEXPORT std::string Leviathan::ScriptModule::GetInfoString | ( | ) |
Definition at line 182 of file ScriptModule.cpp.
DLLEXPORT std::string Leviathan::ScriptModule::GetListeningFunctionName | ( | const std::string & | listenername, |
const std::string * | generictype = NULL |
||
) |
Definition at line 164 of file ScriptModule.cpp.
DLLEXPORT void Leviathan::ScriptModule::GetListOfListeners | ( | std::vector< std::shared_ptr< ValidListenerData >> & | receiver | ) |
Definition at line 147 of file ScriptModule.cpp.
Builds the script if applicable.
Definition at line 79 of file ScriptModule.cpp.
|
inline |
Definition at line 115 of file ScriptModule.h.
DLLEXPORT const std::string & Leviathan::ScriptModule::GetModuleName | ( | ) | const |
Gets the name of the internal AngelScript module.
Definition at line 467 of file ScriptModule.cpp.
|
inline |
Definition at line 125 of file ScriptModule.h.
DLLEXPORT std::shared_ptr< ScriptScript > Leviathan::ScriptModule::GetScriptInstance | ( | ) |
Definition at line 125 of file ScriptModule.cpp.
DLLEXPORT std::shared_ptr< ScriptSourceFileData > Leviathan::ScriptModule::GetScriptSegment | ( | size_t | index | ) | const |
Gets the data associated with a code segment.
index | The index of the segment in the vector, use GetScriptSegmentCount to get max index |
Definition at line 403 of file ScriptModule.cpp.
DLLEXPORT size_t Leviathan::ScriptModule::GetScriptSegmentCount | ( | ) | const |
Gets the number of code segments.
Definition at line 398 of file ScriptModule.cpp.
|
inline |
Definition at line 142 of file ScriptModule.h.
DLLEXPORT bool Leviathan::ScriptModule::OnAddedToBridge | ( | std::shared_ptr< ScriptArgumentsProviderBridge > | bridge | ) |
Call when this module is added to a bridge.
Definition at line 766 of file ScriptModule.cpp.
DLLEXPORT void Leviathan::ScriptModule::PrintFunctionsInModule | ( | ) |
Definition at line 344 of file ScriptModule.cpp.
DLLEXPORT void Leviathan::ScriptModule::Release | ( | ) |
Releases the internal resources.
Definition at line 40 of file ScriptModule.cpp.
DLLEXPORT bool Leviathan::ScriptModule::ReLoadModuleCode | ( | ) |
Rebuilds the module and tries to restore data.
Not all data can be restored (things changing types, application owned handles etc...)
Definition at line 479 of file ScriptModule.cpp.
|
static |
Finds a path to source file or returns an empty string.
Definition at line 780 of file ScriptModule.cpp.
|
static |
Definition at line 367 of file ScriptModule.cpp.
|
inline |
Sets the access mask to be used for this script.
This only takes effect before building the module
Definition at line 99 of file ScriptModule.h.
DLLEXPORT void Leviathan::ScriptModule::SetAsInvalid | ( | ) |
|
inline |
Definition at line 166 of file ScriptModule.h.
|
static |
Definition at line 213 of file ScriptModule.h.