Files
rippled/Event_8h_source.html
2025-11-04 00:36:48 -08:00

161 lines
16 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: Event.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_0103a8ad82dcc2c51f5cde661b4b5cb7.html">xrpl</a></li><li class="navelem"><a class="el" href="dir_31b47b71b675f5c4d1b67be42516b2a9.html">beast</a></li><li class="navelem"><a class="el" href="dir_0dad4d78849cdcdb13e90cb1a6a8840d.html">insight</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">Event.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef BEAST_INSIGHT_EVENT_H_INCLUDED</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define BEAST_INSIGHT_EVENT_H_INCLUDED</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include &lt;xrpl/beast/insight/EventImpl.h&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span> </div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/chrono.html">chrono</a>&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/memory.html">memory</a>&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacebeast.html">beast</a> {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keyword">namespace </span>insight {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="foldopen" id="foldopen00021" data-start="{" data-end="};">
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html"> 21</a></span><span class="keyword">class </span><a class="code hl_class" href="classbeast_1_1insight_1_1Event.html">Event</a> final</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span>{</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#a3a053c8de8739b30eb7dae79a6f810c1"> 24</a></span> <span class="keyword">using </span><a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">value_type</a> = <a class="code hl_typedef" href="classbeast_1_1insight_1_1EventImpl.html#abb840f537602809ff28d7fda1cea1152">EventImpl::value_type</a>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#abd3ec6423ccafcc82ceffcd8e84c689d"> 29</a></span> <a class="code hl_function" href="classbeast_1_1insight_1_1Event.html#abd3ec6423ccafcc82ceffcd8e84c689d">Event</a>()</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> }</div>
</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="foldopen" id="foldopen00038" data-start="{" data-end="}">
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#aaf309ac1b40d3090c9c3ccaf6cd93fc7"> 38</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="classbeast_1_1insight_1_1Event.html#aaf309ac1b40d3090c9c3ccaf6cd93fc7">Event</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;EventImpl&gt;</a> <span class="keyword">const</span>&amp; <a class="code hl_function" href="classbeast_1_1insight_1_1Event.html#a9335298def8a60f86b5835ce2873eb99">impl</a>) : <a class="code hl_variable" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>(<a class="code hl_function" href="classbeast_1_1insight_1_1Event.html#a9335298def8a60f86b5835ce2873eb99">impl</a>)</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">template</span> &lt;<span class="keyword">class</span> Rep, <span class="keyword">class</span> Period&gt;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00045" data-start="{" data-end="}">
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#af25d64d42a95d26832e7354f07059245"> 45</a></span> <a class="code hl_function" href="classbeast_1_1insight_1_1Event.html#af25d64d42a95d26832e7354f07059245">notify</a>(<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::duration&lt;Rep, Period&gt;</a> <span class="keyword">const</span>&amp; value)<span class="keyword"> const</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">using namespace </span><a class="code hl_namespaceRef" href="http://en.cppreference.com/w/namespacestd_1_1chrono.html">std::chrono</a>;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>)</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <a class="code hl_variable" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>-&gt;notify(ceil&lt;value_type&gt;(value));</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;EventImpl&gt;</a> <span class="keyword">const</span>&amp;</div>
<div class="foldopen" id="foldopen00053" data-start="{" data-end="}">
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#a9335298def8a60f86b5835ce2873eb99"> 53</a></span> <a class="code hl_function" href="classbeast_1_1insight_1_1Event.html#a9335298def8a60f86b5835ce2873eb99">impl</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="keyword"> </span>{</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> }</div>
</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b"> 59</a></span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;EventImpl&gt;</a> <a class="code hl_variable" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span>};</div>
</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>} <span class="comment">// namespace insight</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span>} <span class="comment">// namespace beast</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="achrono_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/chrono.html">chrono</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1EventImpl_html_abb840f537602809ff28d7fda1cea1152"><div class="ttname"><a href="classbeast_1_1insight_1_1EventImpl.html#abb840f537602809ff28d7fda1cea1152">beast::insight::EventImpl::value_type</a></div><div class="ttdeci">std::chrono::milliseconds value_type</div><div class="ttdef"><b>Definition</b> <a href="EventImpl_8h_source.html#l00015">EventImpl.h:15</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1Event_html"><div class="ttname"><a href="classbeast_1_1insight_1_1Event.html">beast::insight::Event</a></div><div class="ttdoc">A metric for reporting event timing.</div><div class="ttdef"><b>Definition</b> <a href="Event_8h_source.html#l00021">Event.h:22</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1Event_html_a64fcf2f4779e99bbe5753531cefb736b"><div class="ttname"><a href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">beast::insight::Event::m_impl</a></div><div class="ttdeci">std::shared_ptr&lt; EventImpl &gt; m_impl</div><div class="ttdef"><b>Definition</b> <a href="Event_8h_source.html#l00059">Event.h:59</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1Event_html_a9335298def8a60f86b5835ce2873eb99"><div class="ttname"><a href="classbeast_1_1insight_1_1Event.html#a9335298def8a60f86b5835ce2873eb99">beast::insight::Event::impl</a></div><div class="ttdeci">std::shared_ptr&lt; EventImpl &gt; const &amp; impl() const</div><div class="ttdef"><b>Definition</b> <a href="Event_8h_source.html#l00053">Event.h:53</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1Event_html_aaf309ac1b40d3090c9c3ccaf6cd93fc7"><div class="ttname"><a href="classbeast_1_1insight_1_1Event.html#aaf309ac1b40d3090c9c3ccaf6cd93fc7">beast::insight::Event::Event</a></div><div class="ttdeci">Event(std::shared_ptr&lt; EventImpl &gt; const &amp;impl)</div><div class="ttdoc">Create the metric reference the specified implementation.</div><div class="ttdef"><b>Definition</b> <a href="Event_8h_source.html#l00038">Event.h:38</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1Event_html_abd3ec6423ccafcc82ceffcd8e84c689d"><div class="ttname"><a href="classbeast_1_1insight_1_1Event.html#abd3ec6423ccafcc82ceffcd8e84c689d">beast::insight::Event::Event</a></div><div class="ttdeci">Event()</div><div class="ttdoc">Create a null metric.</div><div class="ttdef"><b>Definition</b> <a href="Event_8h_source.html#l00029">Event.h:29</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1Event_html_af25d64d42a95d26832e7354f07059245"><div class="ttname"><a href="classbeast_1_1insight_1_1Event.html#af25d64d42a95d26832e7354f07059245">beast::insight::Event::notify</a></div><div class="ttdeci">void notify(std::chrono::duration&lt; Rep, Period &gt; const &amp;value) const</div><div class="ttdoc">Push an event notification.</div><div class="ttdef"><b>Definition</b> <a href="Event_8h_source.html#l00045">Event.h:45</a></div></div>
<div class="ttc" id="aduration_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::milliseconds</a></div></div>
<div class="ttc" id="amemory_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/memory.html">memory</a></div></div>
<div class="ttc" id="anamespacebeast_html"><div class="ttname"><a href="namespacebeast.html">beast</a></div><div class="ttdef"><b>Definition</b> <a href="base__uint_8h_source.html#l00653">base_uint.h:653</a></div></div>
<div class="ttc" id="anamespacestd_1_1chrono_html"><div class="ttname"><a href="http://en.cppreference.com/w/namespacestd_1_1chrono.html">std::chrono</a></div></div>
<div class="ttc" id="ashared_ptr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>