<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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"/> <title>Lutok: anonymous_namespace{state.cpp} Namespace 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="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </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 style="padding-left: 0.5em;"> <div id="projectname">Lutok  <span id="projectnumber">0.4</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <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> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="namespaces.html"><span>Namespace List</span></a></li> <li><a href="namespacemembers.html"><span>Namespace Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Macros</a></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><!-- top --> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">anonymous_namespace{state.cpp} Namespace Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ac895a6a4aab5ec5597bdfb62adf0f85c"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00033.html#ac895a6a4aab5ec5597bdfb62adf0f85c">protected_getglobal</a> (lua_State *state)</td></tr> <tr class="memdesc:ac895a6a4aab5ec5597bdfb62adf0f85c"><td class="mdescLeft"> </td><td class="mdescRight">Wrapper around lua_getglobal to run in a protected environment. <a href="#ac895a6a4aab5ec5597bdfb62adf0f85c"></a><br/></td></tr> <tr class="memitem:a901e28feef6c6a7c94edf906139464a4"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00033.html#a901e28feef6c6a7c94edf906139464a4">protected_gettable</a> (lua_State *state)</td></tr> <tr class="memdesc:a901e28feef6c6a7c94edf906139464a4"><td class="mdescLeft"> </td><td class="mdescRight">Wrapper around lua_gettable to run in a protected environment. <a href="#a901e28feef6c6a7c94edf906139464a4"></a><br/></td></tr> <tr class="memitem:a8163cc0f7d5dfba820e335e02769bd91"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00033.html#a8163cc0f7d5dfba820e335e02769bd91">protected_next</a> (lua_State *state)</td></tr> <tr class="memdesc:a8163cc0f7d5dfba820e335e02769bd91"><td class="mdescLeft"> </td><td class="mdescRight">Wrapper around lua_next to run in a protected environment. <a href="#a8163cc0f7d5dfba820e335e02769bd91"></a><br/></td></tr> <tr class="memitem:a931ec64a97c5b8ff24bd12b1318c4bf5"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00033.html#a931ec64a97c5b8ff24bd12b1318c4bf5">protected_setglobal</a> (lua_State *state)</td></tr> <tr class="memdesc:a931ec64a97c5b8ff24bd12b1318c4bf5"><td class="mdescLeft"> </td><td class="mdescRight">Wrapper around lua_setglobal to run in a protected environment. <a href="#a931ec64a97c5b8ff24bd12b1318c4bf5"></a><br/></td></tr> <tr class="memitem:a42654c15fd147850ad03cd891d1d7193"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00033.html#a42654c15fd147850ad03cd891d1d7193">protected_settable</a> (lua_State *state)</td></tr> <tr class="memdesc:a42654c15fd147850ad03cd891d1d7193"><td class="mdescLeft"> </td><td class="mdescRight">Wrapper around lua_settable to run in a protected environment. <a href="#a42654c15fd147850ad03cd891d1d7193"></a><br/></td></tr> <tr class="memitem:ac12be03daffcd5d46ac51da378577e51"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00033.html#ac12be03daffcd5d46ac51da378577e51">call_cxx_function_from_c</a> (lutok::cxx_function function, lua_State *raw_state) throw ()</td></tr> <tr class="memdesc:ac12be03daffcd5d46ac51da378577e51"><td class="mdescLeft"> </td><td class="mdescRight">Calls a C++ Lua function from a C calling environment. <a href="#ac12be03daffcd5d46ac51da378577e51"></a><br/></td></tr> <tr class="memitem:a86e6a7c405a8feea00907b99c4d084ca"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00033.html#a86e6a7c405a8feea00907b99c4d084ca">cxx_closure_trampoline</a> (lua_State *raw_state)</td></tr> <tr class="memdesc:a86e6a7c405a8feea00907b99c4d084ca"><td class="mdescLeft"> </td><td class="mdescRight">Lua glue to call a C++ closure. <a href="#a86e6a7c405a8feea00907b99c4d084ca"></a><br/></td></tr> <tr class="memitem:af3c459196ed8b373a8376b5abeedd472"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00033.html#af3c459196ed8b373a8376b5abeedd472">cxx_function_trampoline</a> (lua_State *raw_state)</td></tr> <tr class="memdesc:af3c459196ed8b373a8376b5abeedd472"><td class="mdescLeft"> </td><td class="mdescRight">Lua glue to call a C++ function. <a href="#af3c459196ed8b373a8376b5abeedd472"></a><br/></td></tr> </table> <hr/><h2>Function Documentation</h2> <a class="anchor" id="ac12be03daffcd5d46ac51da378577e51"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static int anonymous_namespace{state.cpp}::call_cxx_function_from_c </td> <td>(</td> <td class="paramtype">lutok::cxx_function </td> <td class="paramname"><em>function</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">lua_State * </td> <td class="paramname"><em>raw_state</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> throw ()</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Calls a C++ Lua function from a C calling environment. </p> <p>Any errors reported by the C++ function are caught and reported to the caller as Lua errors.</p> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">function</td><td>The C++ function to call. </td></tr> <tr><td class="paramname">raw_state</td><td>The raw Lua state.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns:</dt><dd>The number of return values pushed onto the Lua stack by the function. </dd></dl> </div> </div> <a class="anchor" id="a86e6a7c405a8feea00907b99c4d084ca"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static int anonymous_namespace{state.cpp}::cxx_closure_trampoline </td> <td>(</td> <td class="paramtype">lua_State * </td> <td class="paramname"><em>raw_state</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Lua glue to call a C++ closure. </p> <p>This Lua binding is actually a closure that we have constructed from the state.push_cxx_closure() method. The closure contains the same upvalues provided by the user plus an extra upvalue that contains the address of the C++ function we have to call. All we do here is safely delegate the execution to the wrapped C++ closure.</p> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">raw_state</td><td>The Lua C API state.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns:</dt><dd>The number of return values of the called closure. </dd></dl> </div> </div> <a class="anchor" id="af3c459196ed8b373a8376b5abeedd472"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static int anonymous_namespace{state.cpp}::cxx_function_trampoline </td> <td>(</td> <td class="paramtype">lua_State * </td> <td class="paramname"><em>raw_state</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Lua glue to call a C++ function. </p> <p>This Lua binding is actually a closure that we have constructed from the state.push_cxx_function() method. The closure has a single upvalue that contains the address of the C++ function we have to call. All we do here is safely delegate the execution to the wrapped C++ function.</p> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">raw_state</td><td>The Lua C API state.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns:</dt><dd>The number of return values of the called function. </dd></dl> </div> </div> <a class="anchor" id="ac895a6a4aab5ec5597bdfb62adf0f85c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static int anonymous_namespace{state.cpp}::protected_getglobal </td> <td>(</td> <td class="paramtype">lua_State * </td> <td class="paramname"><em>state</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Wrapper around lua_getglobal to run in a protected environment. </p> <dl class="section pre"><dt>Precondition:</dt><dd>stack(-1) is the name of the global to get. </dd></dl> <dl class="section post"><dt>Postcondition:</dt><dd>stack(-1) is the value of the global.</dd></dl> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">state</td><td>The Lua C API state.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns:</dt><dd>The number of return values pushed onto the stack. </dd></dl> </div> </div> <a class="anchor" id="a901e28feef6c6a7c94edf906139464a4"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static int anonymous_namespace{state.cpp}::protected_gettable </td> <td>(</td> <td class="paramtype">lua_State * </td> <td class="paramname"><em>state</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Wrapper around lua_gettable to run in a protected environment. </p> <dl class="section pre"><dt>Precondition:</dt><dd>stack(-2) is the table to get the element from. </dd> <dd> stack(-1) is the table index. </dd></dl> <dl class="section post"><dt>Postcondition:</dt><dd>stack(-1) is the value of stack(-2)[stack(-1)].</dd></dl> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">state</td><td>The Lua C API state.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns:</dt><dd>The number of return values pushed onto the stack. </dd></dl> </div> </div> <a class="anchor" id="a8163cc0f7d5dfba820e335e02769bd91"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static int anonymous_namespace{state.cpp}::protected_next </td> <td>(</td> <td class="paramtype">lua_State * </td> <td class="paramname"><em>state</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Wrapper around lua_next to run in a protected environment. </p> <dl class="section pre"><dt>Precondition:</dt><dd>stack(-2) is the table to get the next element from. </dd> <dd> stack(-1) is the last processed key. </dd></dl> <dl class="section post"><dt>Postcondition:</dt><dd>stack(-1) is the value of next(stack(-2), stack(-1)).</dd></dl> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">state</td><td>The Lua C API state.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns:</dt><dd>The number of return values pushed onto the stack. </dd></dl> </div> </div> <a class="anchor" id="a931ec64a97c5b8ff24bd12b1318c4bf5"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static int anonymous_namespace{state.cpp}::protected_setglobal </td> <td>(</td> <td class="paramtype">lua_State * </td> <td class="paramname"><em>state</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Wrapper around lua_setglobal to run in a protected environment. </p> <dl class="section pre"><dt>Precondition:</dt><dd>stack(-2) is the name of the global to set. </dd> <dd> stack(-1) is the value to set the global to.</dd></dl> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">state</td><td>The Lua C API state.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns:</dt><dd>The number of return values pushed onto the stack. </dd></dl> </div> </div> <a class="anchor" id="a42654c15fd147850ad03cd891d1d7193"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static int anonymous_namespace{state.cpp}::protected_settable </td> <td>(</td> <td class="paramtype">lua_State * </td> <td class="paramname"><em>state</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Wrapper around lua_settable to run in a protected environment. </p> <dl class="section pre"><dt>Precondition:</dt><dd>stack(-3) is the table to set the element into. </dd> <dd> stack(-2) is the table index. </dd> <dd> stack(-1) is the value to set.</dd></dl> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">state</td><td>The Lua C API state.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns:</dt><dd>The number of return values pushed onto the stack. </dd></dl> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sat Dec 7 2013 19:02:36 for Lutok by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1.1 </small></address> </body> </html>