classpp_1_1_var_1_1_out_exception.html revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
1{{+bindTo:partials.standard_nacl_article}} 2<h1>pp::Var::OutException Class Reference</h1> 3<div id="doxygen-ref"> 4{{- dummy div to appease doxygen -}} 5 <div> 6<!-- Generated by Doxygen 1.7.6.1 --> 7 8 9 10</div> 11<!--header--> 12<div class="contents"> 13<!-- doxytag: class="pp::Var::OutException" --> 14<p><a href="classpp_1_1_var_1_1_out_exception-members.html">List of all members.</a></p> 15<h2> 16Public Member Functions</h2><table class="memberdecls"> 17 18<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_1_1_out_exception.html#afa4be8888c046a7b4f54be2cec82e4e7">OutException</a> (<a class="el" href="classpp_1_1_var.html">Var</a> *v)</td></tr> 19<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_1_1_out_exception.html#af2300053414367146b49f6f71c2eb513">~OutException</a> ()</td></tr> 20<tr><td class="memItemLeft" align="right" valign="top">PP_Var * </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_1_1_out_exception.html#ae27bafd88243e3b2fffc3038a1f31971">get</a> ()</td></tr> 21</table> 22<hr /><a name="details" id="details"></a><h2>Detailed Description</h2> 23<div class="textblock"><p>This class is used when calling the raw C PPAPI when using the C++ <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> as a possible NULL exception. </p> 24<p>This class will handle getting the address of the internal value out if it's non-NULL and fixing up the reference count.</p> 25<p><b>Warning:</b> this will only work for things with exception semantics, i.e. that the value will not be changed if it's a non-undefined exception. Otherwise, this class will mess up the refcounting.</p> 26<p>This is a bit subtle:</p> 27<ul> 28<li>If NULL is passed, we return NULL from <a class="el" href="classpp_1_1_var_1_1_out_exception.html#ae27bafd88243e3b2fffc3038a1f31971">get()</a> and do nothing.</li> 29</ul> 30<ul> 31<li>If a undefined value is passed, we return the address of a undefined var from get and have the output value take ownership of that var.</li> 32</ul> 33<ul> 34<li>If a non-undefined value is passed, we return the address of that var from get, and nothing else should change.</li> 35</ul> 36<p>Example: void FooBar(a, b, Var* exception = NULL) { foo_interface->Bar(a, b, Var::OutException(exception).<a class="el" href="classpp_1_1_var_1_1_out_exception.html#ae27bafd88243e3b2fffc3038a1f31971">get()</a>); } </p> 37</div><hr /><h2>Constructor & Destructor Documentation</h2> 38<a class="anchor" id="afa4be8888c046a7b4f54be2cec82e4e7"></a><!-- doxytag: member="pp::Var::OutException::OutException" ref="afa4be8888c046a7b4f54be2cec82e4e7" args="(Var *v)" --> 39<div class="memitem"> 40<div class="memproto"> 41<table class="memname"> 42<tr> 43<td class="memname"><a class="el" href="classpp_1_1_var_1_1_out_exception.html#afa4be8888c046a7b4f54be2cec82e4e7">pp::Var::OutException::OutException</a> </td> 44<td>(</td> 45<td class="paramtype"><a class="el" href="classpp_1_1_var.html">Var</a> * </td> 46<td class="paramname"><em>v</em></td><td>)</td> 47<td><code> [inline]</code></td> 48</tr> 49</table> 50</div> 51<div class="memdoc"> 52<p>A constructor. </p> 53</div> 54</div> 55<a class="anchor" id="af2300053414367146b49f6f71c2eb513"></a><!-- doxytag: member="pp::Var::OutException::~OutException" ref="af2300053414367146b49f6f71c2eb513" args="()" --> 56<div class="memitem"> 57<div class="memproto"> 58<table class="memname"> 59<tr> 60<td class="memname"><a class="el" href="classpp_1_1_var_1_1_out_exception.html#af2300053414367146b49f6f71c2eb513">pp::Var::OutException::~OutException</a> </td> 61<td>(</td> 62<td class="paramname"></td><td>)</td> 63<td><code> [inline]</code></td> 64</tr> 65</table> 66</div> 67<div class="memdoc"> 68<p>Destructor. </p> 69</div> 70</div> 71<hr /><h2>Member Function Documentation</h2> 72<a class="anchor" id="ae27bafd88243e3b2fffc3038a1f31971"></a><!-- doxytag: member="pp::Var::OutException::get" ref="ae27bafd88243e3b2fffc3038a1f31971" args="()" --> 73<div class="memitem"> 74<div class="memproto"> 75<table class="memname"> 76<tr> 77<td class="memname">PP_Var* <a class="el" href="classpp_1_1_var_1_1_out_exception.html#ae27bafd88243e3b2fffc3038a1f31971">pp::Var::OutException::get</a> </td> 78<td>(</td> 79<td class="paramname"></td><td>)</td> 80<td><code> [inline]</code></td> 81</tr> 82</table> 83</div> 84<div class="memdoc"> 85</div> 86</div> 87<hr />The documentation for this class was generated from the following file:<ul> 88<li><a class="el" href="var_8h.html">var.h</a></li> 89</ul> 90</div><!-- contents --> 91</div> 92{{/partials.standard_nacl_article}} 93