/doc/core/z_memo.html
https://code.google.com/p/zotonic/ · HTML · 78 lines · 65 code · 13 blank · 0 comment · 0 complexity · 3140cb6449cf5bae787390f3fbd336e5 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>Module z_memo</title>
- <link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
- </head>
- <body bgcolor="white">
- <div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
- <hr>
- <h1>Module z_memo</h1>
- <ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>Simple memo functions.
- <p>Copyright 2009 Marc Worrell
- Date: 2009-11-05
- </p>
- <p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
- <h2><a name="description">Description</a></h2>Simple memo functions. Stores much used values in the process dictionary. Especially useful for
- ACL lookups.
- <h2><a name="index">Function Index</a></h2>
- <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#disable-0">disable/0</a></td><td>Disable memoization for this process, also cleans up the possible depcache memoization.</td></tr>
- <tr><td valign="top"><a href="#enable-0">enable/0</a></td><td>Enable memoization for this process.</td></tr>
- <tr><td valign="top"><a href="#get-1">get/1</a></td><td>Check if the key is stored.</td></tr>
- <tr><td valign="top"><a href="#get-2">get/2</a></td><td></td></tr>
- <tr><td valign="top"><a href="#is_enabled-1">is_enabled/1</a></td><td>Check if memoization is enabled for the current user/process.</td></tr>
- <tr><td valign="top"><a href="#set-2">set/2</a></td><td>Store a key if memoization is set.</td></tr>
- <tr><td valign="top"><a href="#set-3">set/3</a></td><td></td></tr>
- <tr><td valign="top"><a href="#set_userid-1">set_userid/1</a></td><td>Set the user id for which we memo values.</td></tr>
- </table>
- <h2><a name="functions">Function Details</a></h2>
- <h3 class="function"><a name="disable-0">disable/0</a></h3>
- <div class="spec">
- <p><tt>disable() -> any()</tt></p>
- </div><p>Disable memoization for this process, also cleans up the possible depcache memoization.</p>
- <h3 class="function"><a name="enable-0">enable/0</a></h3>
- <div class="spec">
- <p><tt>enable() -> any()</tt></p>
- </div><p>Enable memoization for this process. You need to call set_userid/1 before memoization is effective.</p>
- <h3 class="function"><a name="get-1">get/1</a></h3>
- <div class="spec">
- <p><tt>get(Key) -> any()</tt></p>
- </div><p>Check if the key is stored.</p>
- <h3 class="function"><a name="get-2">get/2</a></h3>
- <div class="spec">
- <p><tt>get(Key, Context) -> any()</tt></p>
- </div>
- <h3 class="function"><a name="is_enabled-1">is_enabled/1</a></h3>
- <div class="spec">
- <p><tt>is_enabled(Context) -> any()</tt></p>
- </div><p>Check if memoization is enabled for the current user/process. Disabled when in a sudo action.</p>
- <h3 class="function"><a name="set-2">set/2</a></h3>
- <div class="spec">
- <p><tt>set(Key, Value) -> any()</tt></p>
- </div><p>Store a key if memoization is set.</p>
- <h3 class="function"><a name="set-3">set/3</a></h3>
- <div class="spec">
- <p><tt>set(Key, Value, Context) -> any()</tt></p>
- </div>
- <h3 class="function"><a name="set_userid-1">set_userid/1</a></h3>
- <div class="spec">
- <p><tt>set_userid(AuthUserId) -> any()</tt></p>
- </div><p>Set the user id for which we memo values. Called by z_auth on session initialization.</p>
- <hr>
- <div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
- <p><i>Generated by EDoc, Aug 12 2011, 20:01:39.</i></p>
- </body>
- </html>