Angelscript/docs/manual/classas_i_script_module.html

2023 lines
112 KiB
HTML
Raw Permalink Normal View History

2021-04-12 18:25:02 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AngelScript: asIScriptModule Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="aslogo_small.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">AngelScript
</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classas_i_script_module.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="classas_i_script_module-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">asIScriptModule Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group__api__principal__interfaces.html">Principal interfaces</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>The interface to the script modules.
<a href="classas_i_script_module.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Miscellaneous</div></td></tr>
<tr class="memitem:aef861826f4d09fd411aee7792854bfb8"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_script_engine.html">asIScriptEngine</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#aef861826f4d09fd411aee7792854bfb8">GetEngine</a> () const =0</td></tr>
<tr class="memdesc:aef861826f4d09fd411aee7792854bfb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the engine. <a href="classas_i_script_module.html#aef861826f4d09fd411aee7792854bfb8">More...</a><br /></td></tr>
<tr class="separator:aef861826f4d09fd411aee7792854bfb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a7534bace9eefdc3175a1999f9cbf4a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a1a7534bace9eefdc3175a1999f9cbf4a">SetName</a> (const char *name)=0</td></tr>
<tr class="memdesc:a1a7534bace9eefdc3175a1999f9cbf4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the name of the module. <a href="classas_i_script_module.html#a1a7534bace9eefdc3175a1999f9cbf4a">More...</a><br /></td></tr>
<tr class="separator:a1a7534bace9eefdc3175a1999f9cbf4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4967db3ed89836ac2f3b529c499d473d"><td class="memItemLeft" align="right" valign="top">virtual const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a4967db3ed89836ac2f3b529c499d473d">GetName</a> () const =0</td></tr>
<tr class="memdesc:a4967db3ed89836ac2f3b529c499d473d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the name of the module. <a href="classas_i_script_module.html#a4967db3ed89836ac2f3b529c499d473d">More...</a><br /></td></tr>
<tr class="separator:a4967db3ed89836ac2f3b529c499d473d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e6a69be59f16c8b51d1e21d3905d95c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a0e6a69be59f16c8b51d1e21d3905d95c">Discard</a> ()=0</td></tr>
<tr class="memdesc:a0e6a69be59f16c8b51d1e21d3905d95c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Discards the module. <a href="classas_i_script_module.html#a0e6a69be59f16c8b51d1e21d3905d95c">More...</a><br /></td></tr>
<tr class="separator:a0e6a69be59f16c8b51d1e21d3905d95c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Compilation</div></td></tr>
<tr class="memitem:a330835919b565c76c25e9425536f50b7"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a330835919b565c76c25e9425536f50b7">AddScriptSection</a> (const char *name, const char *code, size_t codeLength=0, int lineOffset=0)=0</td></tr>
<tr class="memdesc:a330835919b565c76c25e9425536f50b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a script section for the next build. <a href="classas_i_script_module.html#a330835919b565c76c25e9425536f50b7">More...</a><br /></td></tr>
<tr class="separator:a330835919b565c76c25e9425536f50b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8acf107194c5f079d7f7507309ebe613"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a8acf107194c5f079d7f7507309ebe613">Build</a> ()=0</td></tr>
<tr class="memdesc:a8acf107194c5f079d7f7507309ebe613"><td class="mdescLeft">&#160;</td><td class="mdescRight">Build the previously added script sections. <a href="classas_i_script_module.html#a8acf107194c5f079d7f7507309ebe613">More...</a><br /></td></tr>
<tr class="separator:a8acf107194c5f079d7f7507309ebe613"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1258d7cfeed965f36ba312beeb49e81c"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a1258d7cfeed965f36ba312beeb49e81c">CompileFunction</a> (const char *sectionName, const char *code, int lineOffset, <a class="el" href="angelscript_8h.html#a5428f0c940201e5f3bbb28304aeb81bc">asDWORD</a> compileFlags, <a class="el" href="classas_i_script_function.html">asIScriptFunction</a> **outFunc)=0</td></tr>
<tr class="memdesc:a1258d7cfeed965f36ba312beeb49e81c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compile a single function. <a href="classas_i_script_module.html#a1258d7cfeed965f36ba312beeb49e81c">More...</a><br /></td></tr>
<tr class="separator:a1258d7cfeed965f36ba312beeb49e81c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34850e152dcdcb58c53a2b6929cebf77"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a34850e152dcdcb58c53a2b6929cebf77">CompileGlobalVar</a> (const char *sectionName, const char *code, int lineOffset)=0</td></tr>
<tr class="memdesc:a34850e152dcdcb58c53a2b6929cebf77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compile a single global variable and add it to the scope of the module. <a href="classas_i_script_module.html#a34850e152dcdcb58c53a2b6929cebf77">More...</a><br /></td></tr>
<tr class="separator:a34850e152dcdcb58c53a2b6929cebf77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76733de5a86875c4a0f021f7f92a6d12"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="angelscript_8h.html#a5428f0c940201e5f3bbb28304aeb81bc">asDWORD</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a76733de5a86875c4a0f021f7f92a6d12">SetAccessMask</a> (<a class="el" href="angelscript_8h.html#a5428f0c940201e5f3bbb28304aeb81bc">asDWORD</a> accessMask)=0</td></tr>
<tr class="memdesc:a76733de5a86875c4a0f021f7f92a6d12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the access mask that should be used during the compilation. <a href="classas_i_script_module.html#a76733de5a86875c4a0f021f7f92a6d12">More...</a><br /></td></tr>
<tr class="separator:a76733de5a86875c4a0f021f7f92a6d12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8629af79cee8212d0d244314d36f42a"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#ab8629af79cee8212d0d244314d36f42a">SetDefaultNamespace</a> (const char *nameSpace)=0</td></tr>
<tr class="memdesc:ab8629af79cee8212d0d244314d36f42a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the default namespace that should be used in the following calls. <a href="classas_i_script_module.html#ab8629af79cee8212d0d244314d36f42a">More...</a><br /></td></tr>
<tr class="separator:ab8629af79cee8212d0d244314d36f42a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1aa775a81fc2bbf84ff2b07fd9561e3"><td class="memItemLeft" align="right" valign="top">virtual const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#aa1aa775a81fc2bbf84ff2b07fd9561e3">GetDefaultNamespace</a> () const =0</td></tr>
<tr class="memdesc:aa1aa775a81fc2bbf84ff2b07fd9561e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current default namespace. <a href="classas_i_script_module.html#aa1aa775a81fc2bbf84ff2b07fd9561e3">More...</a><br /></td></tr>
<tr class="separator:aa1aa775a81fc2bbf84ff2b07fd9561e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Functions</div></td></tr>
<tr class="memitem:a373d102f109ae0fa20584f243ead4035"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a373d102f109ae0fa20584f243ead4035">GetFunctionCount</a> () const =0</td></tr>
<tr class="memdesc:a373d102f109ae0fa20584f243ead4035"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of global functions in the module. <a href="classas_i_script_module.html#a373d102f109ae0fa20584f243ead4035">More...</a><br /></td></tr>
<tr class="separator:a373d102f109ae0fa20584f243ead4035"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd4d9951ee006caa8ec1bab3d3d206fc"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_script_function.html">asIScriptFunction</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#afd4d9951ee006caa8ec1bab3d3d206fc">GetFunctionByIndex</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> index) const =0</td></tr>
<tr class="memdesc:afd4d9951ee006caa8ec1bab3d3d206fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the function by index. <a href="classas_i_script_module.html#afd4d9951ee006caa8ec1bab3d3d206fc">More...</a><br /></td></tr>
<tr class="separator:afd4d9951ee006caa8ec1bab3d3d206fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4754d55d8667aefbed135b4794d461b"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_script_function.html">asIScriptFunction</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#ab4754d55d8667aefbed135b4794d461b">GetFunctionByDecl</a> (const char *decl) const =0</td></tr>
<tr class="memdesc:ab4754d55d8667aefbed135b4794d461b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the function by its declaration. <a href="classas_i_script_module.html#ab4754d55d8667aefbed135b4794d461b">More...</a><br /></td></tr>
<tr class="separator:ab4754d55d8667aefbed135b4794d461b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81d727c9677b683942b6087df4ce95ad"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_script_function.html">asIScriptFunction</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a81d727c9677b683942b6087df4ce95ad">GetFunctionByName</a> (const char *name) const =0</td></tr>
<tr class="memdesc:a81d727c9677b683942b6087df4ce95ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the function by its name. <a href="classas_i_script_module.html#a81d727c9677b683942b6087df4ce95ad">More...</a><br /></td></tr>
<tr class="separator:a81d727c9677b683942b6087df4ce95ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54b6f8e09787ad20880f73bc97a8ef10"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a54b6f8e09787ad20880f73bc97a8ef10">RemoveFunction</a> (<a class="el" href="classas_i_script_function.html">asIScriptFunction</a> *func)=0</td></tr>
<tr class="memdesc:a54b6f8e09787ad20880f73bc97a8ef10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove a single function from the scope of the module. <a href="classas_i_script_module.html#a54b6f8e09787ad20880f73bc97a8ef10">More...</a><br /></td></tr>
<tr class="separator:a54b6f8e09787ad20880f73bc97a8ef10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Global variables</div></td></tr>
<tr class="memitem:a7b084b6693a05616097d7059e54d983b"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a7b084b6693a05616097d7059e54d983b">ResetGlobalVars</a> (<a class="el" href="classas_i_script_context.html">asIScriptContext</a> *ctx=0)=0</td></tr>
<tr class="memdesc:a7b084b6693a05616097d7059e54d983b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the global variables of the module. <a href="classas_i_script_module.html#a7b084b6693a05616097d7059e54d983b">More...</a><br /></td></tr>
<tr class="separator:a7b084b6693a05616097d7059e54d983b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87e29773f7e6f2980d75288faaa74d02"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a87e29773f7e6f2980d75288faaa74d02">GetGlobalVarCount</a> () const =0</td></tr>
<tr class="memdesc:a87e29773f7e6f2980d75288faaa74d02"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of global variables in the module. <a href="classas_i_script_module.html#a87e29773f7e6f2980d75288faaa74d02">More...</a><br /></td></tr>
<tr class="separator:a87e29773f7e6f2980d75288faaa74d02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00cff95b43c256cc6b9062e135a473a2"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a00cff95b43c256cc6b9062e135a473a2">GetGlobalVarIndexByName</a> (const char *name) const =0</td></tr>
<tr class="memdesc:a00cff95b43c256cc6b9062e135a473a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the global variable index by name. <a href="classas_i_script_module.html#a00cff95b43c256cc6b9062e135a473a2">More...</a><br /></td></tr>
<tr class="separator:a00cff95b43c256cc6b9062e135a473a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3d5dafe8ca92bf618f438dc79ef2906"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#ac3d5dafe8ca92bf618f438dc79ef2906">GetGlobalVarIndexByDecl</a> (const char *decl) const =0</td></tr>
<tr class="memdesc:ac3d5dafe8ca92bf618f438dc79ef2906"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the global variable index by declaration. <a href="classas_i_script_module.html#ac3d5dafe8ca92bf618f438dc79ef2906">More...</a><br /></td></tr>
<tr class="separator:ac3d5dafe8ca92bf618f438dc79ef2906"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebe27735e0ce4c06bf79b2b4282192cd"><td class="memItemLeft" align="right" valign="top">virtual const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#aebe27735e0ce4c06bf79b2b4282192cd">GetGlobalVarDeclaration</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> index, bool includeNamespace=false) const =0</td></tr>
<tr class="memdesc:aebe27735e0ce4c06bf79b2b4282192cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the global variable declaration. <a href="classas_i_script_module.html#aebe27735e0ce4c06bf79b2b4282192cd">More...</a><br /></td></tr>
<tr class="separator:aebe27735e0ce4c06bf79b2b4282192cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a939e6caf004c6fdae78fe89bb244d962"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a939e6caf004c6fdae78fe89bb244d962">GetGlobalVar</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> index, const char **name, const char **nameSpace=0, int *typeId=0, bool *isConst=0) const =0</td></tr>
<tr class="memdesc:a939e6caf004c6fdae78fe89bb244d962"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the global variable properties. <a href="classas_i_script_module.html#a939e6caf004c6fdae78fe89bb244d962">More...</a><br /></td></tr>
<tr class="separator:a939e6caf004c6fdae78fe89bb244d962"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0998d375ca1de02bc72f4544806da58c"><td class="memItemLeft" align="right" valign="top">virtual void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a0998d375ca1de02bc72f4544806da58c">GetAddressOfGlobalVar</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> index)=0</td></tr>
<tr class="memdesc:a0998d375ca1de02bc72f4544806da58c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pointer to the global variable. <a href="classas_i_script_module.html#a0998d375ca1de02bc72f4544806da58c">More...</a><br /></td></tr>
<tr class="separator:a0998d375ca1de02bc72f4544806da58c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac10878c3d16f18ace4db881f7a1bb11"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#aac10878c3d16f18ace4db881f7a1bb11">RemoveGlobalVar</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> index)=0</td></tr>
<tr class="memdesc:aac10878c3d16f18ace4db881f7a1bb11"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove the global variable from the scope of the module. <a href="classas_i_script_module.html#aac10878c3d16f18ace4db881f7a1bb11">More...</a><br /></td></tr>
<tr class="separator:aac10878c3d16f18ace4db881f7a1bb11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Type identification</div></td></tr>
<tr class="memitem:a931d0c00cba2df1b4e368e59bac1a207"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a931d0c00cba2df1b4e368e59bac1a207">GetObjectTypeCount</a> () const =0</td></tr>
<tr class="memdesc:a931d0c00cba2df1b4e368e59bac1a207"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of object types. <a href="classas_i_script_module.html#a931d0c00cba2df1b4e368e59bac1a207">More...</a><br /></td></tr>
<tr class="separator:a931d0c00cba2df1b4e368e59bac1a207"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49ebfdd345f18d88e489edebd4888af7"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a49ebfdd345f18d88e489edebd4888af7">GetObjectTypeByIndex</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> index) const =0</td></tr>
<tr class="memdesc:a49ebfdd345f18d88e489edebd4888af7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the object type interface by index. <a href="classas_i_script_module.html#a49ebfdd345f18d88e489edebd4888af7">More...</a><br /></td></tr>
<tr class="separator:a49ebfdd345f18d88e489edebd4888af7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fbc2bd888b248d2c2ee2d953b49eefc"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a7fbc2bd888b248d2c2ee2d953b49eefc">GetTypeIdByDecl</a> (const char *decl) const =0</td></tr>
<tr class="memdesc:a7fbc2bd888b248d2c2ee2d953b49eefc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a type id by declaration. <a href="classas_i_script_module.html#a7fbc2bd888b248d2c2ee2d953b49eefc">More...</a><br /></td></tr>
<tr class="separator:a7fbc2bd888b248d2c2ee2d953b49eefc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8460fa05f441072e14f984ccf507396"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#ae8460fa05f441072e14f984ccf507396">GetTypeInfoByName</a> (const char *name) const =0</td></tr>
<tr class="memdesc:ae8460fa05f441072e14f984ccf507396"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the type interface by name. <a href="classas_i_script_module.html#ae8460fa05f441072e14f984ccf507396">More...</a><br /></td></tr>
<tr class="separator:ae8460fa05f441072e14f984ccf507396"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c61bf81a0a88c0017a0e33aecc417ba"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a3c61bf81a0a88c0017a0e33aecc417ba">GetTypeInfoByDecl</a> (const char *decl) const =0</td></tr>
<tr class="memdesc:a3c61bf81a0a88c0017a0e33aecc417ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a type by declaration. <a href="classas_i_script_module.html#a3c61bf81a0a88c0017a0e33aecc417ba">More...</a><br /></td></tr>
<tr class="separator:a3c61bf81a0a88c0017a0e33aecc417ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Enums</div></td></tr>
<tr class="memitem:a1a241b3dfd47f7ab5bb475c757e38df9"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a1a241b3dfd47f7ab5bb475c757e38df9">GetEnumCount</a> () const =0</td></tr>
<tr class="memdesc:a1a241b3dfd47f7ab5bb475c757e38df9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of enum types declared in the module. <a href="classas_i_script_module.html#a1a241b3dfd47f7ab5bb475c757e38df9">More...</a><br /></td></tr>
<tr class="separator:a1a241b3dfd47f7ab5bb475c757e38df9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ec42bef3874f0fc0e6b929068ae927c"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a0ec42bef3874f0fc0e6b929068ae927c">GetEnumByIndex</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> index) const =0</td></tr>
<tr class="memdesc:a0ec42bef3874f0fc0e6b929068ae927c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the enum type. <a href="classas_i_script_module.html#a0ec42bef3874f0fc0e6b929068ae927c">More...</a><br /></td></tr>
<tr class="separator:a0ec42bef3874f0fc0e6b929068ae927c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Typedefs</div></td></tr>
<tr class="memitem:ad30b22539655df3135f29ce28b89c820"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#ad30b22539655df3135f29ce28b89c820">GetTypedefCount</a> () const =0</td></tr>
<tr class="memdesc:ad30b22539655df3135f29ce28b89c820"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of typedefs in the module. <a href="classas_i_script_module.html#ad30b22539655df3135f29ce28b89c820">More...</a><br /></td></tr>
<tr class="separator:ad30b22539655df3135f29ce28b89c820"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a31f0767b01cc4203212fd531576de4"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a6a31f0767b01cc4203212fd531576de4">GetTypedefByIndex</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> index) const =0</td></tr>
<tr class="memdesc:a6a31f0767b01cc4203212fd531576de4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the typedef. <a href="classas_i_script_module.html#a6a31f0767b01cc4203212fd531576de4">More...</a><br /></td></tr>
<tr class="separator:a6a31f0767b01cc4203212fd531576de4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Dynamic binding between modules</div></td></tr>
<tr class="memitem:a12273a6a6dd9bd39ca9675bcd84b0cc7"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a12273a6a6dd9bd39ca9675bcd84b0cc7">GetImportedFunctionCount</a> () const =0</td></tr>
<tr class="memdesc:a12273a6a6dd9bd39ca9675bcd84b0cc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of functions declared for import. <a href="classas_i_script_module.html#a12273a6a6dd9bd39ca9675bcd84b0cc7">More...</a><br /></td></tr>
<tr class="separator:a12273a6a6dd9bd39ca9675bcd84b0cc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6de1053c8317e7134e7e59e4527339f6"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a6de1053c8317e7134e7e59e4527339f6">GetImportedFunctionIndexByDecl</a> (const char *decl) const =0</td></tr>
<tr class="memdesc:a6de1053c8317e7134e7e59e4527339f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the imported function index by declaration. <a href="classas_i_script_module.html#a6de1053c8317e7134e7e59e4527339f6">More...</a><br /></td></tr>
<tr class="separator:a6de1053c8317e7134e7e59e4527339f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20e46ad7ea467f98bbf35ee052b86868"><td class="memItemLeft" align="right" valign="top">virtual const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a20e46ad7ea467f98bbf35ee052b86868">GetImportedFunctionDeclaration</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> importIndex) const =0</td></tr>
<tr class="memdesc:a20e46ad7ea467f98bbf35ee052b86868"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the imported function declaration. <a href="classas_i_script_module.html#a20e46ad7ea467f98bbf35ee052b86868">More...</a><br /></td></tr>
<tr class="separator:a20e46ad7ea467f98bbf35ee052b86868"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc01b24a82ad14356f2edc082af4c146"><td class="memItemLeft" align="right" valign="top">virtual const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#adc01b24a82ad14356f2edc082af4c146">GetImportedFunctionSourceModule</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> importIndex) const =0</td></tr>
<tr class="memdesc:adc01b24a82ad14356f2edc082af4c146"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the declared imported function source module. <a href="classas_i_script_module.html#adc01b24a82ad14356f2edc082af4c146">More...</a><br /></td></tr>
<tr class="separator:adc01b24a82ad14356f2edc082af4c146"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab24a8b95ce887c3f731eb906e3b518e5"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#ab24a8b95ce887c3f731eb906e3b518e5">BindImportedFunction</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> importIndex, <a class="el" href="classas_i_script_function.html">asIScriptFunction</a> *func)=0</td></tr>
<tr class="memdesc:ab24a8b95ce887c3f731eb906e3b518e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Binds an imported function to the function from another module. <a href="classas_i_script_module.html#ab24a8b95ce887c3f731eb906e3b518e5">More...</a><br /></td></tr>
<tr class="separator:ab24a8b95ce887c3f731eb906e3b518e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d59b4e833bf139f6b7256d6b6bd40b6"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a4d59b4e833bf139f6b7256d6b6bd40b6">UnbindImportedFunction</a> (<a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> importIndex)=0</td></tr>
<tr class="memdesc:a4d59b4e833bf139f6b7256d6b6bd40b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unbinds an imported function. <a href="classas_i_script_module.html#a4d59b4e833bf139f6b7256d6b6bd40b6">More...</a><br /></td></tr>
<tr class="separator:a4d59b4e833bf139f6b7256d6b6bd40b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f0c215576adefd922c2cc95d16b55d8"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a3f0c215576adefd922c2cc95d16b55d8">BindAllImportedFunctions</a> ()=0</td></tr>
<tr class="memdesc:a3f0c215576adefd922c2cc95d16b55d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Binds all imported functions in a module, by searching their equivalents in the declared source modules. <a href="classas_i_script_module.html#a3f0c215576adefd922c2cc95d16b55d8">More...</a><br /></td></tr>
<tr class="separator:a3f0c215576adefd922c2cc95d16b55d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7b4c4b94190779028776fd1057a658f"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#ab7b4c4b94190779028776fd1057a658f">UnbindAllImportedFunctions</a> ()=0</td></tr>
<tr class="memdesc:ab7b4c4b94190779028776fd1057a658f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unbinds all imported functions. <a href="classas_i_script_module.html#ab7b4c4b94190779028776fd1057a658f">More...</a><br /></td></tr>
<tr class="separator:ab7b4c4b94190779028776fd1057a658f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Byte code saving and loading</div></td></tr>
<tr class="memitem:ac6cd95dd97cc6abf28ab4d82257f5aeb"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#ac6cd95dd97cc6abf28ab4d82257f5aeb">SaveByteCode</a> (<a class="el" href="classas_i_binary_stream.html">asIBinaryStream</a> *out, bool stripDebugInfo=false) const =0</td></tr>
<tr class="memdesc:ac6cd95dd97cc6abf28ab4d82257f5aeb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save compiled byte code to a binary stream. <a href="classas_i_script_module.html#ac6cd95dd97cc6abf28ab4d82257f5aeb">More...</a><br /></td></tr>
<tr class="separator:ac6cd95dd97cc6abf28ab4d82257f5aeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b4a222e5309c6b367f136b6d2f664ba"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a8b4a222e5309c6b367f136b6d2f664ba">LoadByteCode</a> (<a class="el" href="classas_i_binary_stream.html">asIBinaryStream</a> *in, bool *wasDebugInfoStripped=0)=0</td></tr>
<tr class="memdesc:a8b4a222e5309c6b367f136b6d2f664ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load pre-compiled byte code from a binary stream. <a href="classas_i_script_module.html#a8b4a222e5309c6b367f136b6d2f664ba">More...</a><br /></td></tr>
<tr class="separator:a8b4a222e5309c6b367f136b6d2f664ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">User data</div></td></tr>
<tr class="memitem:a06582e57e7101df4157ee36c81867c13"><td class="memItemLeft" align="right" valign="top">virtual void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#a06582e57e7101df4157ee36c81867c13">SetUserData</a> (void *data, <a class="el" href="angelscript_8h.html#a76fc6994aba7ff6c685a62c273c057e3">asPWORD</a> type=0)=0</td></tr>
<tr class="memdesc:a06582e57e7101df4157ee36c81867c13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register the memory address of some user data. <a href="classas_i_script_module.html#a06582e57e7101df4157ee36c81867c13">More...</a><br /></td></tr>
<tr class="separator:a06582e57e7101df4157ee36c81867c13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af292f99799d8358277298f749efedaaa"><td class="memItemLeft" align="right" valign="top">virtual void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classas_i_script_module.html#af292f99799d8358277298f749efedaaa">GetUserData</a> (<a class="el" href="angelscript_8h.html#a76fc6994aba7ff6c685a62c273c057e3">asPWORD</a> type=0) const =0</td></tr>
<tr class="memdesc:af292f99799d8358277298f749efedaaa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the address of the previously registered user data. <a href="classas_i_script_module.html#af292f99799d8358277298f749efedaaa">More...</a><br /></td></tr>
<tr class="separator:af292f99799d8358277298f749efedaaa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A script module can be thought of a library of script functions, classes, and global variables.</p>
<p>A pointer to the module interface is obtained by calling <a class="el" href="classas_i_script_engine.html#a9f7cdc52b59034e6e55eb8a56b427aa4" title="Return an interface pointer to the module.">asIScriptEngine::GetModule</a>. The module can then be <a class="el" href="classas_i_script_module.html#a8acf107194c5f079d7f7507309ebe613">built</a> from a single or multiple script files, also known as script sections. Alternatively pre-built bytecode can be <a class="el" href="classas_i_script_module.html#a8b4a222e5309c6b367f136b6d2f664ba">loaded</a>, if it has been saved from a previous build.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="doc_module.html">Script modules</a> </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a330835919b565c76c25e9425536f50b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a330835919b565c76c25e9425536f50b7">&#9670;&nbsp;</a></span>AddScriptSection()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::AddScriptSection </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>code</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>codeLength</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>lineOffset</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The name of the script section </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">code</td><td>The script code buffer </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">codeLength</td><td>The length of the script code </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">lineOffset</td><td>An offset that will be added to compiler message line numbers </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>The <em>code</em> argument is null. </td></tr>
<tr><td class="paramname">asNOT_SUPPORTED</td><td>Compiler support is disabled in the engine. </td></tr>
<tr><td class="paramname">asOUT_OF_MEMORY</td><td>The necessary memory to hold the script code couldn't be allocated.</td></tr>
</table>
</dd>
</dl>
<p>This adds a script section to the module. The script section isn't processed with this call. Only when <a class="el" href="classas_i_script_module.html#a8acf107194c5f079d7f7507309ebe613">Build</a> is called will the script be parsed and compiled into executable byte code.</p>
<p>Error messages from the compiler will refer to the name of the script section and the position within it. Normally each section is the content of a source file, so it is recommended to name the script sections as the name of the source file.</p>
<p>The code added is copied by the engine, so there is no need to keep the original buffer after the call. Note that this can be changed by setting the engine property <a class="el" href="angelscript_8h.html#a53c2e8a74ade77c928316396394ebe0fabf1577418b716c92f0a85be3e2617243">asEP_COPY_SCRIPT_SECTIONS</a> with <a class="el" href="classas_i_script_engine.html#a1bce4e5f573a2ca0ff55163e28f761dd">asIScriptEngine::SetEngineProperty</a>. </p>
</div>
</div>
<a id="a3f0c215576adefd922c2cc95d16b55d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3f0c215576adefd922c2cc95d16b55d8">&#9670;&nbsp;</a></span>BindAllImportedFunctions()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::BindAllImportedFunctions </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asERROR</td><td>An error occurred. </td></tr>
<tr><td class="paramname">asCANT_BIND_ALL_FUNCTIONS</td><td>Not all functions where bound.</td></tr>
</table>
</dd>
</dl>
<p>This functions tries to bind all imported functions in the module by searching for matching functions in the suggested modules. If a function cannot be bound the function will give an error <a class="el" href="angelscript_8h.html#a6e2a1647f02f2c5da931bab09e860f54a412d2352693e848f46ccdd93c8d047e4">asCANT_BIND_ALL_FUNCTIONS</a>, but it will continue binding the rest of the functions. </p>
</div>
</div>
<a id="ab24a8b95ce887c3f731eb906e3b518e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab24a8b95ce887c3f731eb906e3b518e5">&#9670;&nbsp;</a></span>BindImportedFunction()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::BindImportedFunction </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>importIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classas_i_script_function.html">asIScriptFunction</a> *&#160;</td>
<td class="paramname"><em>func</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">importIndex</td><td>The index of the imported function. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">func</td><td>The true function that will be bound to the imported function. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asNO_FUNCTION</td><td><em>importIndex</em> or <em>func</em> is incorrect. </td></tr>
<tr><td class="paramname">asINVALID_INTERFACE</td><td>The signature of function doesn't match the import statement.</td></tr>
</table>
</dd>
</dl>
<p>The imported function is only bound if the functions have the exact same signature, i.e the same return type, and parameters. </p>
</div>
</div>
<a id="a8acf107194c5f079d7f7507309ebe613"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8acf107194c5f079d7f7507309ebe613">&#9670;&nbsp;</a></span>Build()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::Build </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A negative value on error </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_CONFIGURATION</td><td>The engine configuration is invalid. </td></tr>
<tr><td class="paramname">asERROR</td><td>The script failed to build. </td></tr>
<tr><td class="paramname">asBUILD_IN_PROGRESS</td><td>Another thread is currently building. </td></tr>
<tr><td class="paramname">asINIT_GLOBAL_VARS_FAILED</td><td>It was not possible to initialize at least one of the global variables. </td></tr>
<tr><td class="paramname">asNOT_SUPPORTED</td><td>Compiler support is disabled in the engine. </td></tr>
<tr><td class="paramname">asMODULE_IS_IN_USE</td><td>The code in the module is still being used and and cannot be removed.</td></tr>
</table>
</dd>
</dl>
<p>Builds the script based on the previously <a class="el" href="classas_i_script_module.html#a330835919b565c76c25e9425536f50b7">added sections</a>, <a class="el" href="doc_register_api.html">registered types and functions</a>. After the build is complete the script sections are removed to free memory.</p>
<p>Before starting the build the <a class="el" href="classas_i_script_module.html#a8acf107194c5f079d7f7507309ebe613">Build</a> method removes any previously compiled script content, including the dynamically added content from <a class="el" href="classas_i_script_module.html#a1258d7cfeed965f36ba312beeb49e81c">CompileFunction</a> and <a class="el" href="classas_i_script_module.html#a34850e152dcdcb58c53a2b6929cebf77">CompileGlobalVar</a>. If the script module needs to be rebuilt all of the script sections needs to be added again.</p>
<p>Compiler messages are sent to the message callback function set with <a class="el" href="classas_i_script_engine.html#a74192fe950808eb72a64e3e371f0ea02">asIScriptEngine::SetMessageCallback</a>. If there are no errors or warnings, no messages will be sent to the callback function.</p>
<p>Any global variables found in the script will be initialized by the compiler if the engine property <a class="el" href="angelscript_8h.html#a53c2e8a74ade77c928316396394ebe0facac241d97facce4eaf9e5b0ca40dfcf1">asEP_INIT_GLOBAL_VARS_AFTER_BUILD</a> is set. If you get the error <a class="el" href="angelscript_8h.html#a6e2a1647f02f2c5da931bab09e860f54a539a1fcf3f48feaaf7c0776c88123430">asINIT_GLOBAL_VARS_FAILED</a>, then it is probable that one of the global variables during the initialization is trying to access another global variable before it has been initialized.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="doc_compile_script.html">Compiling scripts</a> </dd></dl>
</div>
</div>
<a id="a1258d7cfeed965f36ba312beeb49e81c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1258d7cfeed965f36ba312beeb49e81c">&#9670;&nbsp;</a></span>CompileFunction()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::CompileFunction </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>sectionName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>code</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>lineOffset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#a5428f0c940201e5f3bbb28304aeb81bc">asDWORD</a>&#160;</td>
<td class="paramname"><em>compileFlags</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classas_i_script_function.html">asIScriptFunction</a> **&#160;</td>
<td class="paramname"><em>outFunc</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">sectionName</td><td>The name of the script section </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">code</td><td>The script code buffer </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">lineOffset</td><td>An offset that will be added to compiler message line numbers </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">compileFlags</td><td>One of <a class="el" href="angelscript_8h.html#a2bf48c41455371788805269376ca5e41">asECompileFlags</a> values </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">outFunc</td><td>Optional parameter to receive the compiled function descriptor </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>One or more arguments have invalid values. </td></tr>
<tr><td class="paramname">asINVALID_CONFIGURATION</td><td>The engine configuration is invalid. </td></tr>
<tr><td class="paramname">asBUILD_IN_PROGRESS</td><td>Another build is in progress. </td></tr>
<tr><td class="paramname">asERROR</td><td>The compilation failed. </td></tr>
<tr><td class="paramname">asNOT_SUPPORTED</td><td>Compiler support is disabled in the engine.</td></tr>
</table>
</dd>
</dl>
<p>Use this to compile a single function. Any existing compiled code in the module can be used by the function.</p>
<p>The newly compiled function can be optionally added to the scope of the module where it can later be referred to by the application or used in subsequent compilations. If not added to the module the function can still be returned in the output parameter, which will allow the application to execute it and then discard it when it is no longer needed.</p>
<p>If the output function parameter is set, remember to release the function object when you're done with it. </p>
</div>
</div>
<a id="a34850e152dcdcb58c53a2b6929cebf77"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34850e152dcdcb58c53a2b6929cebf77">&#9670;&nbsp;</a></span>CompileGlobalVar()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::CompileGlobalVar </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>sectionName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>code</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>lineOffset</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">sectionName</td><td>The name of the script section </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">code</td><td>The script code buffer </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">lineOffset</td><td>An offset that will be added to compiler message line numbers </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>One or more arguments have invalid values. </td></tr>
<tr><td class="paramname">asINVALID_CONFIGURATION</td><td>The engine configuration is invalid. </td></tr>
<tr><td class="paramname">asBUILD_IN_PROGRESS</td><td>Another build is in progress. </td></tr>
<tr><td class="paramname">asERROR</td><td>The compilation failed. </td></tr>
<tr><td class="paramname">asNOT_SUPPORTED</td><td>Compiler support is disabled in the engine.</td></tr>
</table>
</dd>
</dl>
<p>Use this to add a single global variable to the scope of a module. The variable can then be referred to by the application and subsequent compilations.</p>
<p>The script code may contain an initialization expression, which will be executed by the compiler if the engine property <a class="el" href="angelscript_8h.html#a53c2e8a74ade77c928316396394ebe0facac241d97facce4eaf9e5b0ca40dfcf1">asEP_INIT_GLOBAL_VARS_AFTER_BUILD</a> is set.</p>
<p>Any existing compiled code in the module can be used in the initialization expression. </p>
</div>
</div>
<a id="a0e6a69be59f16c8b51d1e21d3905d95c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e6a69be59f16c8b51d1e21d3905d95c">&#9670;&nbsp;</a></span>Discard()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void asIScriptModule::Discard </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This method is used to discard the module and any compiled bytecode it has. After calling this method the module pointer is no longer valid and shouldn't be used by the application. </p>
</div>
</div>
<a id="a0998d375ca1de02bc72f4544806da58c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0998d375ca1de02bc72f4544806da58c">&#9670;&nbsp;</a></span>GetAddressOfGlobalVar()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void* asIScriptModule::GetAddressOfGlobalVar </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>index</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The index of the global variable. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the global variable, or null if not found.</dd></dl>
<p>This method should be used to retrieve the pointer of a variable that you wish to access. </p>
</div>
</div>
<a id="aa1aa775a81fc2bbf84ff2b07fd9561e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa1aa775a81fc2bbf84ff2b07fd9561e3">&#9670;&nbsp;</a></span>GetDefaultNamespace()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual const char* asIScriptModule::GetDefaultNamespace </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The current default namespace </dd></dl>
</div>
</div>
<a id="aef861826f4d09fd411aee7792854bfb8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef861826f4d09fd411aee7792854bfb8">&#9670;&nbsp;</a></span>GetEngine()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_script_engine.html">asIScriptEngine</a>* asIScriptModule::GetEngine </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A pointer to the engine. </dd></dl>
</div>
</div>
<a id="a0ec42bef3874f0fc0e6b929068ae927c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ec42bef3874f0fc0e6b929068ae927c">&#9670;&nbsp;</a></span>GetEnumByIndex()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a>* asIScriptModule::GetEnumByIndex </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>index</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The index of the enum type. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The type info of the enum type, or null on error. </dd></dl>
</div>
</div>
<a id="a1a241b3dfd47f7ab5bb475c757e38df9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a241b3dfd47f7ab5bb475c757e38df9">&#9670;&nbsp;</a></span>GetEnumCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> asIScriptModule::GetEnumCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The number of enum types in the module. </dd></dl>
</div>
</div>
<a id="ab4754d55d8667aefbed135b4794d461b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab4754d55d8667aefbed135b4794d461b">&#9670;&nbsp;</a></span>GetFunctionByDecl()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_script_function.html">asIScriptFunction</a>* asIScriptModule::GetFunctionByDecl </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>decl</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">decl</td><td>The function declaration. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The function or null in case of error. </dd></dl>
</div>
</div>
<a id="afd4d9951ee006caa8ec1bab3d3d206fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd4d9951ee006caa8ec1bab3d3d206fc">&#9670;&nbsp;</a></span>GetFunctionByIndex()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_script_function.html">asIScriptFunction</a>* asIScriptModule::GetFunctionByIndex </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>index</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The index of the function </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The function or null in case of error. </dd></dl>
</div>
</div>
<a id="a81d727c9677b683942b6087df4ce95ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81d727c9677b683942b6087df4ce95ad">&#9670;&nbsp;</a></span>GetFunctionByName()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_script_function.html">asIScriptFunction</a>* asIScriptModule::GetFunctionByName </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The function name </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The function or null if not found or there are multiple matches.</dd></dl>
<p>The search for functions will be performed in the default namespace as given by <a class="el" href="classas_i_script_module.html#ab8629af79cee8212d0d244314d36f42a">SetDefaultNamespace</a> unless the name is prefixed with a scope, using the scoping operator ::. If the scope starts with :: it will be used as the absolute scope, otherwise it will be relative to the default namespace. </p>
</div>
</div>
<a id="a373d102f109ae0fa20584f243ead4035"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a373d102f109ae0fa20584f243ead4035">&#9670;&nbsp;</a></span>GetFunctionCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> asIScriptModule::GetFunctionCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The number of global functions in this module.</dd></dl>
<p>This method retrieves the number of compiled script functions. </p>
</div>
</div>
<a id="a939e6caf004c6fdae78fe89bb244d962"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a939e6caf004c6fdae78fe89bb244d962">&#9670;&nbsp;</a></span>GetGlobalVar()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::GetGlobalVar </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>index</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char **&#160;</td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char **&#160;</td>
<td class="paramname"><em>nameSpace</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&#160;</td>
<td class="paramname"><em>typeId</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool *&#160;</td>
<td class="paramname"><em>isConst</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The index of the global variable. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">name</td><td>The name of the variable. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">nameSpace</td><td>The namespace of the variable. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">typeId</td><td>The type of the variable. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">isConst</td><td>Whether or not the variable is const. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>The index is out of range. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a87e29773f7e6f2980d75288faaa74d02"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87e29773f7e6f2980d75288faaa74d02">&#9670;&nbsp;</a></span>GetGlobalVarCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> asIScriptModule::GetGlobalVarCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The number of global variables in the module. </dd></dl>
</div>
</div>
<a id="aebe27735e0ce4c06bf79b2b4282192cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebe27735e0ce4c06bf79b2b4282192cd">&#9670;&nbsp;</a></span>GetGlobalVarDeclaration()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual const char* asIScriptModule::GetGlobalVarDeclaration </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>index</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>includeNamespace</em> = <code>false</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The index of the global variable. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">includeNamespace</td><td>Set to true if the namespace should be included in the declaration. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A null terminated string with the variable declaration, or null if not found.</dd></dl>
<p>This method can be used to retrieve the variable declaration of the script variables that the host application will access. Verifying the declaration is important because, even though the script may compile correctly the user may not have used the variable types as intended. </p>
</div>
</div>
<a id="ac3d5dafe8ca92bf618f438dc79ef2906"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac3d5dafe8ca92bf618f438dc79ef2906">&#9670;&nbsp;</a></span>GetGlobalVarIndexByDecl()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::GetGlobalVarIndexByDecl </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>decl</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">decl</td><td>The global variable declaration. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error, or the global variable index. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asERROR</td><td>The module was not built successfully. </td></tr>
<tr><td class="paramname">asNO_GLOBAL_VAR</td><td>No matching global variable was found. </td></tr>
<tr><td class="paramname">asINVALID_DECLARATION</td><td>The given declaration is invalid.</td></tr>
</table>
</dd>
</dl>
<p>This method should be used to retrieve the index of the script variable that you wish to access.</p>
<p>The method will find the script variable with the exact same declaration.</p>
<p>If the variable is declared in a namespace first call <a class="el" href="classas_i_script_module.html#ab8629af79cee8212d0d244314d36f42a">SetDefaultNamespace</a> to set the namespace that should be searched first for the variable. </p>
</div>
</div>
<a id="a00cff95b43c256cc6b9062e135a473a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00cff95b43c256cc6b9062e135a473a2">&#9670;&nbsp;</a></span>GetGlobalVarIndexByName()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::GetGlobalVarIndexByName </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The name of the global variable. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error, or the global variable index. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>The name and scope for search cannot be determined </td></tr>
<tr><td class="paramname">asNO_GLOBAL_VAR</td><td>The matching global variable was found.</td></tr>
</table>
</dd>
</dl>
<p>This method should be used to retrieve the index of the script variable that you wish to access.</p>
<p>The search for global variables will be performed in the default namespace as given by <a class="el" href="classas_i_script_module.html#ab8629af79cee8212d0d244314d36f42a">SetDefaultNamespace</a> unless the name is prefixed with a scope, using the scoping operator ::. If the scope starts with :: it will be used as the absolute scope, otherwise it will be relative to the default namespace. </p>
</div>
</div>
<a id="a12273a6a6dd9bd39ca9675bcd84b0cc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a12273a6a6dd9bd39ca9675bcd84b0cc7">&#9670;&nbsp;</a></span>GetImportedFunctionCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> asIScriptModule::GetImportedFunctionCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The number of imported functions.</dd></dl>
<p>This function returns the number of functions that are imported in a module. These functions need to be bound before they can be used, or a script exception will be thrown. </p>
</div>
</div>
<a id="a20e46ad7ea467f98bbf35ee052b86868"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20e46ad7ea467f98bbf35ee052b86868">&#9670;&nbsp;</a></span>GetImportedFunctionDeclaration()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual const char* asIScriptModule::GetImportedFunctionDeclaration </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>importIndex</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">importIndex</td><td>The index of the imported function. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A null terminated string with the function declaration, or null if not found.</dd></dl>
<p>Use this function to get the declaration of the imported function. The returned declaration can be used to find a matching function in another module that can be bound to the imported function. <br />
</p>
</div>
</div>
<a id="a6de1053c8317e7134e7e59e4527339f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6de1053c8317e7134e7e59e4527339f6">&#9670;&nbsp;</a></span>GetImportedFunctionIndexByDecl()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::GetImportedFunctionIndexByDecl </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>decl</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">decl</td><td>The function declaration of the imported function. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error, or the index of the imported function. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asERROR</td><td>The module was not built successfully. </td></tr>
<tr><td class="paramname">asMULTIPLE_FUNCTIONS</td><td>Found multiple matching functions. </td></tr>
<tr><td class="paramname">asNO_FUNCTION</td><td>Didn't find any matching function.</td></tr>
</table>
</dd>
</dl>
<p>This function is used to find a specific imported function by its declaration. </p>
</div>
</div>
<a id="adc01b24a82ad14356f2edc082af4c146"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adc01b24a82ad14356f2edc082af4c146">&#9670;&nbsp;</a></span>GetImportedFunctionSourceModule()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual const char* asIScriptModule::GetImportedFunctionSourceModule </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>importIndex</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">importIndex</td><td>The index of the imported function. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A null terminated string with the name of the source module, or null if not found.</dd></dl>
<p>Use this function to get the name of the suggested module to import the function from. </p>
</div>
</div>
<a id="a4967db3ed89836ac2f3b529c499d473d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4967db3ed89836ac2f3b529c499d473d">&#9670;&nbsp;</a></span>GetName()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual const char* asIScriptModule::GetName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The name of the module. </dd></dl>
</div>
</div>
<a id="a49ebfdd345f18d88e489edebd4888af7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a49ebfdd345f18d88e489edebd4888af7">&#9670;&nbsp;</a></span>GetObjectTypeByIndex()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a>* asIScriptModule::GetObjectTypeByIndex </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>index</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The index of the type. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The object type interface for the type, or null if not found.</dd></dl>
<p>This does not increase the reference count of the returned object. </p>
</div>
</div>
<a id="a931d0c00cba2df1b4e368e59bac1a207"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a931d0c00cba2df1b4e368e59bac1a207">&#9670;&nbsp;</a></span>GetObjectTypeCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> asIScriptModule::GetObjectTypeCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The number of object types declared in the module. </dd></dl>
</div>
</div>
<a id="a6a31f0767b01cc4203212fd531576de4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6a31f0767b01cc4203212fd531576de4">&#9670;&nbsp;</a></span>GetTypedefByIndex()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a>* asIScriptModule::GetTypedefByIndex </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>index</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The index of the typedef. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The type info of the typedef, or null on error. </dd></dl>
</div>
</div>
<a id="ad30b22539655df3135f29ce28b89c820"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad30b22539655df3135f29ce28b89c820">&#9670;&nbsp;</a></span>GetTypedefCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a> asIScriptModule::GetTypedefCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The number of typedefs in the module. </dd></dl>
</div>
</div>
<a id="a7fbc2bd888b248d2c2ee2d953b49eefc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7fbc2bd888b248d2c2ee2d953b49eefc">&#9670;&nbsp;</a></span>GetTypeIdByDecl()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::GetTypeIdByDecl </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>decl</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">decl</td><td>The declaration of the type. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error, or the type id of the type. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_TYPE</td><td><em>decl</em> is not a valid type.</td></tr>
</table>
</dd>
</dl>
<p>Translates a type declaration into a type id. The returned type id is valid for as long as the type is valid, so you can safely store it for later use to avoid potential overhead from calling this function each time. Just remember to update the type id, any time the type is changed within the engine, e.g. when recompiling script declared classes, or changing the engine configuration.</p>
<p>The type id is based on a sequence number and depends on the order in which the type ids are queried, thus is not guaranteed to always be the same for each execution of the application. The <a class="el" href="angelscript_8h.html#ae8c3a67a97321be53181e9ed396ad83a">asETypeIdFlags</a> can be used to obtain some information about the type directly from the id.</p>
<p>A base type yields the same type id whether the declaration is const or not, however if the const is for the subtype then the type id is different, e.g. string@ isn't the same as const string@ but string is the same as const string. <br />
</p>
</div>
</div>
<a id="a3c61bf81a0a88c0017a0e33aecc417ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c61bf81a0a88c0017a0e33aecc417ba">&#9670;&nbsp;</a></span>GetTypeInfoByDecl()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a>* asIScriptModule::GetTypeInfoByDecl </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>decl</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">decl</td><td>The declaration of the type. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The type or null on error.</dd></dl>
<p>Translates a type declaration into the type info. The returned type is valid for as long as the type is valid, so you can safely store it for later use to avoid potential overhead from calling this function each time. Just remember to update the type info pointer any time the type is changed within the engine, e.g. when recompiling script declared classes, or changing the engine configuration. </p>
</div>
</div>
<a id="ae8460fa05f441072e14f984ccf507396"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae8460fa05f441072e14f984ccf507396">&#9670;&nbsp;</a></span>GetTypeInfoByName()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classas_i_type_info.html">asITypeInfo</a>* asIScriptModule::GetTypeInfoByName </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The name of the type. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The type interface for the type, or null if not found.</dd></dl>
<p>The search for types will be performed in the default namespace as given by <a class="el" href="classas_i_script_module.html#ab8629af79cee8212d0d244314d36f42a">SetDefaultNamespace</a> unless the name is prefixed with a scope, using the scoping operator ::. If the scope starts with :: it will be used as the absolute scope, otherwise it will be relative to the default namespace. </p>
</div>
</div>
<a id="af292f99799d8358277298f749efedaaa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af292f99799d8358277298f749efedaaa">&#9670;&nbsp;</a></span>GetUserData()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void* asIScriptModule::GetUserData </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#a76fc6994aba7ff6c685a62c273c057e3">asPWORD</a>&#160;</td>
<td class="paramname"><em>type</em> = <code>0</code></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>An identifier specifying the user data to set. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The pointer to the user data. </dd></dl>
</div>
</div>
<a id="a8b4a222e5309c6b367f136b6d2f664ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8b4a222e5309c6b367f136b6d2f664ba">&#9670;&nbsp;</a></span>LoadByteCode()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::LoadByteCode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classas_i_binary_stream.html">asIBinaryStream</a> *&#160;</td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool *&#160;</td>
<td class="paramname"><em>wasDebugInfoStripped</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>The input stream. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">wasDebugInfoStripped</td><td>Set to true if the byte code was saved without debug information. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>The stream object wasn't specified. </td></tr>
<tr><td class="paramname">asBUILD_IN_PROGRESS</td><td>Another thread is currently building. </td></tr>
<tr><td class="paramname">asOUT_OF_MEMORY</td><td>The engine ran out of memory while loading the byte code. </td></tr>
<tr><td class="paramname">asMODULE_IS_IN_USE</td><td>The code in the module is still being used and and cannot be removed. </td></tr>
<tr><td class="paramname">asERROR</td><td>It was not possible to load the byte code.</td></tr>
</table>
</dd>
</dl>
<p>This method is used to load pre-compiled byte code from disk or memory. The application must implement an object that inherits from <a class="el" href="classas_i_binary_stream.html">asIBinaryStream</a> to provide the necessary stream operations.</p>
<p>It is expected that the application performs the necessary validations to make sure the pre-compiled byte code is from a trusted source. The application should also make sure the pre-compiled byte code is compatible with the current engine configuration, i.e. that the engine has been configured in the same way as when the byte code was first compiled.</p>
<p>If the method returns asERROR it is either because the byte code is incorrect, e.g. corrupted due to disk failure, or it has been compiled with a different engine configuration. If possible the engine provides information about the type of error that caused the failure while loading the byte code to the <a class="el" href="classas_i_script_engine.html#a74192fe950808eb72a64e3e371f0ea02">message stream</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="doc_adv_precompile.html">Pre-compiled byte code</a> </dd></dl>
</div>
</div>
<a id="a54b6f8e09787ad20880f73bc97a8ef10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54b6f8e09787ad20880f73bc97a8ef10">&#9670;&nbsp;</a></span>RemoveFunction()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::RemoveFunction </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classas_i_script_function.html">asIScriptFunction</a> *&#160;</td>
<td class="paramname"><em>func</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">func</td><td>The pointer to the function that should be removed. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asNO_FUNCTION</td><td>The function is not part of the scope.</td></tr>
</table>
</dd>
</dl>
<p>This method allows the application to remove a single function from the scope of the module. The function is not destroyed immediately though, only when no more references point to it. </p>
</div>
</div>
<a id="aac10878c3d16f18ace4db881f7a1bb11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aac10878c3d16f18ace4db881f7a1bb11">&#9670;&nbsp;</a></span>RemoveGlobalVar()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::RemoveGlobalVar </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>index</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The index of the global variable. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>The index is out of range.</td></tr>
</table>
</dd>
</dl>
<p>The global variable is removed from the scope of the module, but it is not destroyed until all functions that access it are freed. </p>
</div>
</div>
<a id="a7b084b6693a05616097d7059e54d983b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b084b6693a05616097d7059e54d983b">&#9670;&nbsp;</a></span>ResetGlobalVars()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::ResetGlobalVars </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classas_i_script_context.html">asIScriptContext</a> *&#160;</td>
<td class="paramname"><em>ctx</em> = <code>0</code></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>Optional script context. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asERROR</td><td>The module was not compiled successfully. </td></tr>
<tr><td class="paramname">asINIT_GLOBAL_VARS_FAILED</td><td>The initialization of the global variables failed.</td></tr>
</table>
</dd>
</dl>
<p>Resets the global variables declared in this module to their initial value. The context should be informed if the application needs to have extra control over how the initialization is done, for example for debugging, or for catching exceptions. </p>
</div>
</div>
<a id="ac6cd95dd97cc6abf28ab4d82257f5aeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac6cd95dd97cc6abf28ab4d82257f5aeb">&#9670;&nbsp;</a></span>SaveByteCode()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::SaveByteCode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classas_i_binary_stream.html">asIBinaryStream</a> *&#160;</td>
<td class="paramname"><em>out</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>stripDebugInfo</em> = <code>false</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">out</td><td>The output stream. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">stripDebugInfo</td><td>Set to true to skip saving the debug information. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>The stream object wasn't specified. </td></tr>
<tr><td class="paramname">asNOT_SUPPORTED</td><td>Compiler support is disabled in the engine. </td></tr>
<tr><td class="paramname">asERROR</td><td>Nothing has been compiled in the module.</td></tr>
</table>
</dd>
</dl>
<p>This method is used to save pre-compiled byte code to disk or memory, for a later restoral. The application must implement an object that inherits from <a class="el" href="classas_i_binary_stream.html">asIBinaryStream</a> to provide the necessary stream operations.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="doc_adv_precompile.html">Pre-compiled byte code</a> </dd></dl>
</div>
</div>
<a id="a76733de5a86875c4a0f021f7f92a6d12"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a76733de5a86875c4a0f021f7f92a6d12">&#9670;&nbsp;</a></span>SetAccessMask()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="angelscript_8h.html#a5428f0c940201e5f3bbb28304aeb81bc">asDWORD</a> asIScriptModule::SetAccessMask </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#a5428f0c940201e5f3bbb28304aeb81bc">asDWORD</a>&#160;</td>
<td class="paramname"><em>accessMask</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">accessMask</td><td>The access bit mask </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The previous access mask.</dd></dl>
<p>The module's access mask with be bitwise and-ed with the registered entity's access mask in order to determine if the module is allowed to access the entity. If the result is zero then the script in the module will not be able to use the entity.</p>
<p>This can be used to provide different interfaces to scripts that serve different purposes in the application.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="doc_adv_access_mask.html">Access masks and exposing different interfaces</a> </dd></dl>
</div>
</div>
<a id="ab8629af79cee8212d0d244314d36f42a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8629af79cee8212d0d244314d36f42a">&#9670;&nbsp;</a></span>SetDefaultNamespace()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::SetDefaultNamespace </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>nameSpace</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">nameSpace</td><td>The namespace that should be used. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>The namespace is null. </td></tr>
<tr><td class="paramname">asINVALID_DECLARATION</td><td>The namespace is invalid.</td></tr>
</table>
</dd>
</dl>
<p>Set the default namespace that should be used in the following calls for searching for declared entities, or when compiling new individual entities. </p>
</div>
</div>
<a id="a1a7534bace9eefdc3175a1999f9cbf4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a7534bace9eefdc3175a1999f9cbf4a">&#9670;&nbsp;</a></span>SetName()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void asIScriptModule::SetName </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>The new name.</td></tr>
</table>
</dd>
</dl>
<p>Sets the name of the script module. </p>
</div>
</div>
<a id="a06582e57e7101df4157ee36c81867c13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06582e57e7101df4157ee36c81867c13">&#9670;&nbsp;</a></span>SetUserData()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void* asIScriptModule::SetUserData </td>
<td>(</td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#a76fc6994aba7ff6c685a62c273c057e3">asPWORD</a>&#160;</td>
<td class="paramname"><em>type</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>A pointer to the user data. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>An identifier specifying the user data to set. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The previous pointer stored in the module</dd></dl>
<p>This method allows the application to associate a value, e.g. a pointer, with the module instance.</p>
<p>The type values 1000 through 1999 are reserved for use by the official add-ons.</p>
<p>Optionally, a callback function can be <a class="el" href="classas_i_script_engine.html#a7523853b9a9bf7dab603fa6a06393d51">registered</a> to clean up the user data when the module is destroyed. </p>
</div>
</div>
<a id="ab7b4c4b94190779028776fd1057a658f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab7b4c4b94190779028776fd1057a658f">&#9670;&nbsp;</a></span>UnbindAllImportedFunctions()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::UnbindAllImportedFunctions </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A negative value on error.</dd></dl>
<p>Unbinds all imported functions in the module. </p>
</div>
</div>
<a id="a4d59b4e833bf139f6b7256d6b6bd40b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4d59b4e833bf139f6b7256d6b6bd40b6">&#9670;&nbsp;</a></span>UnbindImportedFunction()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual int asIScriptModule::UnbindImportedFunction </td>
<td>(</td>
<td class="paramtype"><a class="el" href="angelscript_8h.html#ac8186f029686800b7ce36bde4a55c815">asUINT</a>&#160;</td>
<td class="paramname"><em>importIndex</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">importIndex</td><td>The index of the imported function. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>The index is not valid.</td></tr>
</table>
</dd>
</dl>
<p>Unbinds the imported function. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="angelscript_8h.html">angelscript.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="classas_i_script_module.html">asIScriptModule</a></li>
<li class="footer">Generated on Sat Dec 5 2020 23:20:25 for AngelScript by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.18 </li>
</ul>
</div>
</body>
</html>