1 {{+bindTo:partials.standard_nacl_api}}
2 <h1>pp::CompletionCallbackWithOutput< T > Class Template Reference</h1>
4 {{- dummy div to appease doxygen -}}
6 <!-- Generated by Doxygen 1.7.6.1 -->
12 <div class="contents">
13 <!-- doxytag: class="pp::CompletionCallbackWithOutput" --><!-- doxytag: inherits="pp::CompletionCallback" --><div class="dynheader">
14 Inheritance diagram for pp::CompletionCallbackWithOutput< T >:</div>
15 <div class="dyncontent">
16 <div class="center"><img src="classpp_1_1_completion_callback_with_output__inherit__graph.png" border="0" usemap="#pp_1_1_completion_callback_with_output_3_01_t_01_4_inherit__map" alt="Inheritance graph" /></div>
17 <map name="pp_1_1_completion_callback_with_output_3_01_t_01_4_inherit__map" id="pp_1_1_completion_callback_with_output_3_01_t_01_4_inherit__map">
18 <area shape="rect" id="node2" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl..." alt="" coords="59,5,231,32"></area></map>
19 <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
20 <p><a href="classpp_1_1_completion_callback_with_output-members.html">List of all members.</a></p>
22 Public Types</h2><table class="memberdecls">
24 <tr><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak" />
25 internal::CallbackOutputTraits<br class="typebreak" />
26 < T >::StorageType </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_completion_callback_with_output.html#a333f3b00a9f6549b3b70291787f31459">OutputStorageType</a></td></tr>
27 <tr><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak" />
28 internal::CallbackOutputTraits<br class="typebreak" />
29 < T >::<a class="el" href="classpp_1_1_completion_callback_with_output.html#aca381518bda2f9cb12c4ddc725da91ce">APIArgType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_completion_callback_with_output.html#aca381518bda2f9cb12c4ddc725da91ce">APIArgType</a></td></tr>
31 Public Member Functions</h2><table class="memberdecls">
32 <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_completion_callback_with_output.html#a29dd26e95218dce78e2475f29ea669cb">CompletionCallbackWithOutput</a> (<a class="el" href="classpp_1_1_completion_callback_with_output.html#a333f3b00a9f6549b3b70291787f31459">OutputStorageType</a> *<a class="el" href="classpp_1_1_completion_callback_with_output.html#a8fac51ce72828752c025ca888897f2ef">output</a>)</td></tr>
33 <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_completion_callback_with_output.html#a36bc9e5fd9e8d503020fe338b8b9802e">CompletionCallbackWithOutput</a> (PP_CompletionCallback_Func func, void *user_data, <a class="el" href="classpp_1_1_completion_callback_with_output.html#a333f3b00a9f6549b3b70291787f31459">OutputStorageType</a> *<a class="el" href="classpp_1_1_completion_callback_with_output.html#a8fac51ce72828752c025ca888897f2ef">output</a>)</td></tr>
34 <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_completion_callback_with_output.html#a311725af061d86e58cc89a588fa542f9">CompletionCallbackWithOutput</a> (PP_CompletionCallback_Func func, void *user_data, int32_t <a class="el" href="classpp_1_1_completion_callback.html#a60e466572fe7de362969dd41179c971f">flags</a>, <a class="el" href="classpp_1_1_completion_callback_with_output.html#a333f3b00a9f6549b3b70291787f31459">OutputStorageType</a> *<a class="el" href="classpp_1_1_completion_callback_with_output.html#a8fac51ce72828752c025ca888897f2ef">output</a>)</td></tr>
35 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_completion_callback_with_output.html#aca381518bda2f9cb12c4ddc725da91ce">APIArgType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_completion_callback_with_output.html#a8fac51ce72828752c025ca888897f2ef">output</a> () const </td></tr>
37 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
38 <div class="textblock"><h3>template<typename T><br />
39 class pp::CompletionCallbackWithOutput< T ></h3>
40 <p>A <a class="el" href="classpp_1_1_completion_callback_with_output.html" title="A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to so...">CompletionCallbackWithOutput</a> defines a completion callback that additionally stores a pointer to some output data. </p>
41 <p>Some C++ wrappers take a <a class="el" href="classpp_1_1_completion_callback_with_output.html" title="A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to so...">CompletionCallbackWithOutput</a> when the browser is returning a bit of data as part of the function call. The "output" parameter stored in the <a class="el" href="classpp_1_1_completion_callback_with_output.html" title="A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to so...">CompletionCallbackWithOutput</a> will receive the data from the browser.</p>
42 <p>You can create this yourself, but it is most common to use with the <a class="el" href="classpp_1_1_completion_callback_factory.html" title="CompletionCallbackFactory<T> may be used to create CompletionCallback objects that are bound to membe...">CompletionCallbackFactory</a>'s NewCallbackWithOutput, which manages the storage for the output parameter for you and passes it as an argument to your callback function.</p>
43 <p>Note that this class doesn't actually do anything with the output data, it just stores a pointer to it. C++ wrapper objects that accept a <a class="el" href="classpp_1_1_completion_callback_with_output.html" title="A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to so...">CompletionCallbackWithOutput</a> will retrieve this pointer and pass it to the browser as the output parameter. </p>
44 </div><hr /><h2>Member Typedef Documentation</h2>
45 <a class="anchor" id="aca381518bda2f9cb12c4ddc725da91ce"></a><!-- doxytag: member="pp::CompletionCallbackWithOutput::APIArgType" ref="aca381518bda2f9cb12c4ddc725da91ce" args="" -->
47 <div class="memproto">
48 <div class="memtemplate">
49 template<typename T > </div>
50 <table class="memname">
52 <td class="memname">typedef internal::CallbackOutputTraits<T>::<a class="el" href="classpp_1_1_completion_callback_with_output.html#aca381518bda2f9cb12c4ddc725da91ce">APIArgType</a> <a class="el" href="classpp_1_1_completion_callback_with_output.html">pp::CompletionCallbackWithOutput</a>< T >::<a class="el" href="classpp_1_1_completion_callback_with_output.html#aca381518bda2f9cb12c4ddc725da91ce">APIArgType</a></td>
59 <a class="anchor" id="a333f3b00a9f6549b3b70291787f31459"></a><!-- doxytag: member="pp::CompletionCallbackWithOutput::OutputStorageType" ref="a333f3b00a9f6549b3b70291787f31459" args="" -->
61 <div class="memproto">
62 <div class="memtemplate">
63 template<typename T > </div>
64 <table class="memname">
66 <td class="memname">typedef internal::CallbackOutputTraits<T>::StorageType <a class="el" href="classpp_1_1_completion_callback_with_output.html">pp::CompletionCallbackWithOutput</a>< T >::<a class="el" href="classpp_1_1_completion_callback_with_output.html#a333f3b00a9f6549b3b70291787f31459">OutputStorageType</a></td>
71 <p>The type that will actually be stored in the completion callback. </p>
72 <p>In the common case, this will be equal to the template parameter (for example, CompletionCallbackWithOutput<int> would obviously take an int*. However, resources are passed as PP_Resource, vars as PP_Var, and arrays as our special ArrayOutputAdapter object. The CallbackOutputTraits defines specializations for all of these cases. </p>
75 <hr /><h2>Constructor & Destructor Documentation</h2>
76 <a class="anchor" id="a29dd26e95218dce78e2475f29ea669cb"></a><!-- doxytag: member="pp::CompletionCallbackWithOutput::CompletionCallbackWithOutput" ref="a29dd26e95218dce78e2475f29ea669cb" args="(OutputStorageType *output)" -->
78 <div class="memproto">
79 <div class="memtemplate">
80 template<typename T > </div>
81 <table class="memname">
83 <td class="memname"><a class="el" href="classpp_1_1_completion_callback_with_output.html">pp::CompletionCallbackWithOutput</a>< T >::<a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a> </td>
85 <td class="paramtype"><a class="el" href="classpp_1_1_completion_callback_with_output.html#a333f3b00a9f6549b3b70291787f31459">OutputStorageType</a> * </td>
86 <td class="paramname"><em>output</em></td><td>)</td>
87 <td><code> [inline]</code></td>
92 <p>The default constructor will create a blocking <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> that references the given output data. </p>
93 <dl class="params"><dt><b>Parameters:</b></dt><dd>
94 <table class="params">
95 <tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>A pointer to the data associated with the callback. The caller must ensure that this pointer outlives the completion callback.</td></tr>
99 <p><b>Note:</b> Blocking completion callbacks are only allowed from from background threads. </p>
102 <a class="anchor" id="a36bc9e5fd9e8d503020fe338b8b9802e"></a><!-- doxytag: member="pp::CompletionCallbackWithOutput::CompletionCallbackWithOutput" ref="a36bc9e5fd9e8d503020fe338b8b9802e" args="(PP_CompletionCallback_Func func, void *user_data, OutputStorageType *output)" -->
103 <div class="memitem">
104 <div class="memproto">
105 <div class="memtemplate">
106 template<typename T > </div>
107 <table class="memname">
109 <td class="memname"><a class="el" href="classpp_1_1_completion_callback_with_output.html">pp::CompletionCallbackWithOutput</a>< T >::<a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a> </td>
111 <td class="paramtype">PP_CompletionCallback_Func </td>
112 <td class="paramname"><em>func</em>, </td>
115 <td class="paramkey"></td>
117 <td class="paramtype">void * </td>
118 <td class="paramname"><em>user_data</em>, </td>
121 <td class="paramkey"></td>
123 <td class="paramtype"><a class="el" href="classpp_1_1_completion_callback_with_output.html#a333f3b00a9f6549b3b70291787f31459">OutputStorageType</a> * </td>
124 <td class="paramname"><em>output</em> </td>
129 <td></td><td><code> [inline]</code></td>
134 <p>A constructor for creating a <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> that references the given output data. </p>
135 <dl class="params"><dt><b>Parameters:</b></dt><dd>
136 <table class="params">
137 <tr><td class="paramdir">[in]</td><td class="paramname">func</td><td>The function to be called on completion. </td></tr>
138 <tr><td class="paramdir">[in]</td><td class="paramname">user_data</td><td>The user data to be passed to the callback function. This is optional and is typically used to help track state in case of multiple pending callbacks. </td></tr>
139 <tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>A pointer to the data associated with the callback. The caller must ensure that this pointer outlives the completion callback. </td></tr>
145 <a class="anchor" id="a311725af061d86e58cc89a588fa542f9"></a><!-- doxytag: member="pp::CompletionCallbackWithOutput::CompletionCallbackWithOutput" ref="a311725af061d86e58cc89a588fa542f9" args="(PP_CompletionCallback_Func func, void *user_data, int32_t flags, OutputStorageType *output)" -->
146 <div class="memitem">
147 <div class="memproto">
148 <div class="memtemplate">
149 template<typename T > </div>
150 <table class="memname">
152 <td class="memname"><a class="el" href="classpp_1_1_completion_callback_with_output.html">pp::CompletionCallbackWithOutput</a>< T >::<a class="el" href="classpp_1_1_completion_callback_with_output.html">CompletionCallbackWithOutput</a> </td>
154 <td class="paramtype">PP_CompletionCallback_Func </td>
155 <td class="paramname"><em>func</em>, </td>
158 <td class="paramkey"></td>
160 <td class="paramtype">void * </td>
161 <td class="paramname"><em>user_data</em>, </td>
164 <td class="paramkey"></td>
166 <td class="paramtype">int32_t </td>
167 <td class="paramname"><em>flags</em>, </td>
170 <td class="paramkey"></td>
172 <td class="paramtype"><a class="el" href="classpp_1_1_completion_callback_with_output.html#a333f3b00a9f6549b3b70291787f31459">OutputStorageType</a> * </td>
173 <td class="paramname"><em>output</em> </td>
178 <td></td><td><code> [inline]</code></td>
183 <p>A constructor for creating a <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> that references the given output data. </p>
184 <dl class="params"><dt><b>Parameters:</b></dt><dd>
185 <table class="params">
186 <tr><td class="paramdir">[in]</td><td class="paramname">func</td><td>The function to be called on completion.</td></tr>
187 <tr><td class="paramdir">[in]</td><td class="paramname">user_data</td><td>The user data to be passed to the callback function. This is optional and is typically used to help track state in case of multiple pending callbacks.</td></tr>
188 <tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>Bit field combination of <code>PP_CompletionCallback_Flag</code> flags used to control how non-NULL callbacks are scheduled by asynchronous methods.</td></tr>
189 <tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>A pointer to the data associated with the callback. The caller must ensure that this pointer outlives the completion callback. </td></tr>
195 <hr /><h2>Member Function Documentation</h2>
196 <a class="anchor" id="a8fac51ce72828752c025ca888897f2ef"></a><!-- doxytag: member="pp::CompletionCallbackWithOutput::output" ref="a8fac51ce72828752c025ca888897f2ef" args="() const " -->
197 <div class="memitem">
198 <div class="memproto">
199 <div class="memtemplate">
200 template<typename T > </div>
201 <table class="memname">
203 <td class="memname"><a class="el" href="classpp_1_1_completion_callback_with_output.html#aca381518bda2f9cb12c4ddc725da91ce">APIArgType</a> <a class="el" href="classpp_1_1_completion_callback_with_output.html">pp::CompletionCallbackWithOutput</a>< T >::<a class="el" href="classpp_1_1_completion_callback_with_output.html#a8fac51ce72828752c025ca888897f2ef">output</a> </td>
205 <td class="paramname"></td><td>)</td>
206 <td> const<code> [inline]</code></td>
213 <hr />The documentation for this class was generated from the following file:<ul>
214 <li><a class="el" href="completion__callback_8h.html">completion_callback.h</a></li>
216 </div><!-- contents -->
218 {{/partials.standard_nacl_api}}