<trclass="memitem:a734ee64cd20afdb78acb8656ed867d34"><tdclass="memItemLeft"align="right"valign="top">enum  </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classcrashpad_1_1Annotation.html#a734ee64cd20afdb78acb8656ed867d34">Type</a> : uint16_t <trclass="memdesc:a734ee64cd20afdb78acb8656ed867d34"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The type of data stored in the annotation. <ahref="classcrashpad_1_1Annotation.html#a734ee64cd20afdb78acb8656ed867d34">More...</a><br/></td></tr>
<trclass="memdesc:afe8c08cb46e337e355c0f32c6f2e1851"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The type used for <em><aclass="el"href="classcrashpad_1_1Annotation.html#a4c742340370959ebbda4f395bb0eb303"title="Specifies the number of bytes in value_ptr_ to include when generating a crash report. ">SetSize()</a></em>. <br/></td></tr>
<trclass="memdesc:a2eca2863d47336e481595957ad06083e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs a new annotation. <ahref="#a2eca2863d47336e481595957ad06083e">More...</a><br/></td></tr>
<trclass="memdesc:a4c742340370959ebbda4f395bb0eb303"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Specifies the number of bytes in <em>value_ptr_</em> to include when generating a crash report. <ahref="#a4c742340370959ebbda4f395bb0eb303">More...</a><br/></td></tr>
<trclass="memdesc:a32b1655d880454b6d222f820fbf64289"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Marks the annotation as cleared, indicating the <em>value_ptr_</em> should not be included in a crash report. <ahref="#a32b1655d880454b6d222f820fbf64289">More...</a><br/></td></tr>
<trclass="memdesc:a666f8d98d638a98ce2636d0997a3e0e3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Tests whether the annotation has been set. <br/></td></tr>
<trclass="memdesc:ab56b76fed6c08cf0d1bb5fd9a92ea1be"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates a user-defined <aclass="el"href="classcrashpad_1_1Annotation.html#a734ee64cd20afdb78acb8656ed867d34"title="The type of data stored in the annotation. ">Annotation::Type</a>. <ahref="#ab56b76fed6c08cf0d1bb5fd9a92ea1be">More...</a><br/></td></tr>
<trclass="memdesc:a159abc1f99211ba3d3be0e68789af327"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The maximum length of an annotation’s name, in bytes. <br/></td></tr>
<trclass="memdesc:a9e776193af79d77a2b45138aa42fa92f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The maximum size of an annotation’s value, in bytes. <br/></td></tr>
<divclass="textblock"><p>Base class for an annotation, which records a name-value pair of arbitrary data when set. </p>
<p>After an annotation is declared, its <code>value_ptr_</code> will not be captured in a crash report until a call to <em><aclass="el"href="classcrashpad_1_1Annotation.html#a4c742340370959ebbda4f395bb0eb303"title="Specifies the number of bytes in value_ptr_ to include when generating a crash report. ">SetSize()</a></em> specifies how much data from the value should be recorded.</p>
<p>Annotations should be declared with static storage duration.</p>
<p>An example declaration and usage:</p>
<divclass="fragment"><divclass="line"><spanclass="comment">// foo.cc:</span></div><divclass="line"></div><divclass="line"><spanclass="keyword">namespace </span>{</div><divclass="line"><spanclass="keywordtype">char</span> g_buffer[1024];</div><divclass="line"><aclass="code"href="classcrashpad_1_1Annotation.html">crashpad::Annotation</a> g_buffer_annotation(</div><divclass="line"><aclass="code"href="classcrashpad_1_1Annotation.html#a734ee64cd20afdb78acb8656ed867d34a302e56d566a2561033b27c13680ea4b2">crashpad::Annotation::Type::kString</a>, <spanclass="stringliteral">"buffer_head"</span>, g_buffer);</div><divclass="line">} <spanclass="comment">// namespace</span></div><divclass="line"></div><divclass="line"><spanclass="keywordtype">void</span> OnBufferProduced(<spanclass="keywordtype">size_t</span> n) {</div><divclass="line"><spanclass="comment">// Capture the head of the buffer, in case we crash when parsing it.</span></div><divclass="line"> g_buffer_annotation.SetSize(std::min(64, n));</div><divclass="line"></div><divclass="line"><spanclass="comment">// Start parsing the header.</span></div><divclass="line"> Frobinate(g_buffer, n);</div><divclass="line">}</div></div><!-- fragment --><p><aclass="el"href="classcrashpad_1_1Annotation.html"title="Base class for an annotation, which records a name-value pair of arbitrary data when set...">Annotation</a> objects are not inherently thread-safe. To manipulate them from multiple threads, external synchronization must be used.</p>
<p><aclass="el"href="classcrashpad_1_1Annotation.html"title="Base class for an annotation, which records a name-value pair of arbitrary data when set...">Annotation</a> objects should never be destroyed. Once they are Set(), they are permanently referenced by a global object. </p>
<tr><tdclass="fieldname"><aid="a734ee64cd20afdb78acb8656ed867d34ae3b452587aa197cda501adb165e5cdf1"></a>kUserDefinedStart </td><tdclass="fielddoc"><p>Clients may declare their own custom types by using values greater than this. </p>
</td></tr>
</table>
</div>
</div>
<h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>Upon construction, the annotation will not be included in any crash reports until </p><dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classcrashpad_1_1Annotation.html#a4c742340370959ebbda4f395bb0eb303"title="Specifies the number of bytes in value_ptr_ to include when generating a crash report. ">SetSize()</a> is called with a value greater than <code>0</code>.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">type</td><td>The data type of the value of the annotation. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">name</td><td>A <code>NUL</code>-terminated C-string name for the annotation. Names do not have to be unique, though not all crash processors may handle Annotations with the same name. Names should be constexpr data with static storage duration. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">value_ptr</td><td>A pointer to the value for the annotation. The pointer may not be changed once associated with an annotation, but the data may be mutated. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Specifies the number of bytes in <em>value_ptr_</em> to include when generating a crash report. </p>
<p>A size of <code>0</code> indicates that no value should be recorded and is the equivalent of calling </p><dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classcrashpad_1_1Annotation.html#a32b1655d880454b6d222f820fbf64289"title="Marks the annotation as cleared, indicating the value_ptr_ should not be included in a crash report...">Clear()</a>.</dd></dl>
<p>This method does not mutate the data referenced by the annotation, it merely updates the annotation system's bookkeeping.</p>
<p>Subclasses of this base class that provide additional Set methods to mutate the value of the annotation must call always call this method.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">size</td><td>The number of bytes. </td></tr>
<p>Creates a user-defined <aclass="el"href="classcrashpad_1_1Annotation.html#a734ee64cd20afdb78acb8656ed867d34"title="The type of data stored in the annotation. ">Annotation::Type</a>. </p>
<p>This exists to remove the casting overhead of <code>enum class</code>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">value</td><td>A value used to create a user-defined type.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The value added to <aclass="el"href="classcrashpad_1_1Annotation.html#a734ee64cd20afdb78acb8656ed867d34ae3b452587aa197cda501adb165e5cdf1"title="Clients may declare their own custom types by using values greater than this. ">Type::kUserDefinedStart</a> and casted. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>client/annotation.h</li>
<li>client/annotation.cc</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hrclass="footer"/><addressclass="footer"><small>
Generated by  <ahref="http://www.doxygen.org/index.html">