PageRenderTime 29ms CodeModel.GetById 18ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 2<html>
 3<head>
 4<title>Module z_memo</title>
 5<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
 6</head>
 7<body bgcolor="white">
 8<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>
 9<hr>
10
11<h1>Module z_memo</h1>
12<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.
13<p>Copyright Š 2009 Marc Worrell
14  Date: 2009-11-05
15 </p>
16
17<p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
18
19<h2><a name="description">Description</a></h2>Simple memo functions.  Stores much used values in the process dictionary. Especially useful for
20  ACL lookups.
21<h2><a name="index">Function Index</a></h2>
22<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>
23<tr><td valign="top"><a href="#enable-0">enable/0</a></td><td>Enable memoization for this process.</td></tr>
24<tr><td valign="top"><a href="#get-1">get/1</a></td><td>Check if the key is stored.</td></tr>
25<tr><td valign="top"><a href="#get-2">get/2</a></td><td></td></tr>
26<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>
27<tr><td valign="top"><a href="#set-2">set/2</a></td><td>Store a key if memoization is set.</td></tr>
28<tr><td valign="top"><a href="#set-3">set/3</a></td><td></td></tr>
29<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>
30</table>
31
32<h2><a name="functions">Function Details</a></h2>
33
34<h3 class="function"><a name="disable-0">disable/0</a></h3>
35<div class="spec">
36<p><tt>disable() -&gt; any()</tt></p>
37</div><p>Disable memoization for this process, also cleans up the possible depcache memoization.</p>
38
39<h3 class="function"><a name="enable-0">enable/0</a></h3>
40<div class="spec">
41<p><tt>enable() -&gt; any()</tt></p>
42</div><p>Enable memoization for this process. You need to call set_userid/1 before memoization is effective.</p>
43
44<h3 class="function"><a name="get-1">get/1</a></h3>
45<div class="spec">
46<p><tt>get(Key) -&gt; any()</tt></p>
47</div><p>Check if the key is stored.</p>
48
49<h3 class="function"><a name="get-2">get/2</a></h3>
50<div class="spec">
51<p><tt>get(Key, Context) -&gt; any()</tt></p>
52</div>
53
54<h3 class="function"><a name="is_enabled-1">is_enabled/1</a></h3>
55<div class="spec">
56<p><tt>is_enabled(Context) -&gt; any()</tt></p>
57</div><p>Check if memoization is enabled for the current user/process.  Disabled when in a sudo action.</p>
58
59<h3 class="function"><a name="set-2">set/2</a></h3>
60<div class="spec">
61<p><tt>set(Key, Value) -&gt; any()</tt></p>
62</div><p>Store a key if memoization is set.</p>
63
64<h3 class="function"><a name="set-3">set/3</a></h3>
65<div class="spec">
66<p><tt>set(Key, Value, Context) -&gt; any()</tt></p>
67</div>
68
69<h3 class="function"><a name="set_userid-1">set_userid/1</a></h3>
70<div class="spec">
71<p><tt>set_userid(AuthUserId) -&gt; any()</tt></p>
72</div><p>Set the user id for which we memo values.  Called by z_auth on session initialization.</p>
73<hr>
74
75<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>
76<p><i>Generated by EDoc, Aug 12 2011, 20:01:39.</i></p>
77</body>
78</html>