Files
rippled/Event_8h_source.html
2021-09-14 16:34:03 +00:00

160 lines
18 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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- 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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_df9c78dcf3f59a33b12284f95992a64b.html">ripple</a></li><li class="navelem"><a class="el" href="dir_875063d0bf0fe9cb23dcbe977d2f1b80.html">beast</a></li><li class="navelem"><a class="el" href="dir_65cf560b897cf61f85b9c588d7c7ee6d.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 name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">//------------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> This file is part of Beast: https://github.com/vinniefalco/Beast</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> Copyright 2013, Vinnie Falco &lt;vinnie.falco@gmail.com&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> Permission to use, copy, modify, and/or distribute this software for any</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> purpose with or without fee is hereby granted, provided that the above</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> copyright notice and this permission notice appear in all copies.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> THE SOFTWARE IS PROVIDED &quot;AS IS&quot; AND THE AUTHOR DISCLAIMS ALL WARRANTIES</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">//==============================================================================</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#ifndef BEAST_INSIGHT_EVENT_H_INCLUDED</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#define BEAST_INSIGHT_EVENT_H_INCLUDED</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;ripple/beast/insight/EventImpl.h&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<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 name="l00026"></a><span class="lineno"> 26</span>&#160;<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 name="l00027"></a><span class="lineno"> 27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacebeast.html">beast</a> {</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="keyword">namespace </span>insight {</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html"> 40</a></span>&#160;<span class="keyword">class </span><a class="code" href="classbeast_1_1insight_1_1Event.html">Event</a> final</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;{</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#a3a053c8de8739b30eb7dae79a6f810c1"> 43</a></span>&#160; <span class="keyword">using</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">value_type</a> = <a class="code" href="classbeast_1_1insight_1_1EventImpl.html#abb840f537602809ff28d7fda1cea1152">EventImpl::value_type</a>;</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#abd3ec6423ccafcc82ceffcd8e84c689d"> 48</a></span>&#160; <a class="code" href="classbeast_1_1insight_1_1Event.html#abd3ec6423ccafcc82ceffcd8e84c689d">Event</a>()</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; {</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; }</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#aaf309ac1b40d3090c9c3ccaf6cd93fc7"> 57</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="classbeast_1_1insight_1_1Event.html#aaf309ac1b40d3090c9c3ccaf6cd93fc7">Event</a>(<a class="codeRef" 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" href="classbeast_1_1insight_1_1Event.html#a3a37cfe6776b7e238bf63ea7981e0ec0">impl</a>) : <a class="code" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>(<a class="code" href="classbeast_1_1insight_1_1Event.html#a3a37cfe6776b7e238bf63ea7981e0ec0">impl</a>)</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; {</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; }</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class</span> Rep, <span class="keyword">class</span> Period&gt;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordtype">void</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#af25d64d42a95d26832e7354f07059245"> 64</a></span>&#160; <a class="code" href="classbeast_1_1insight_1_1Event.html#af25d64d42a95d26832e7354f07059245">notify</a>(<a class="codeRef" 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 name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">using namespace </span><a class="codeRef" href="http://en.cppreference.com/w/namespacestd_1_1chrono.html">std::chrono</a>;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>)</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <a class="code" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>-&gt;notify(ceil&lt;value_type&gt;(value));</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; }</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <a class="codeRef" 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="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#a3a37cfe6776b7e238bf63ea7981e0ec0"> 72</a></span>&#160; <a class="code" href="classbeast_1_1insight_1_1Event.html#a3a37cfe6776b7e238bf63ea7981e0ec0">impl</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="keyword"> </span>{</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b"> 78</a></span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr&lt;EventImpl&gt;</a> <a class="code" href="classbeast_1_1insight_1_1Event.html#a64fcf2f4779e99bbe5753531cefb736b">m_impl</a>;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;};</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;} <span class="comment">// namespace insight</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;} <span class="comment">// namespace beast</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<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 class="ttdoc">STL class.</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="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#l00034">EventImpl.h:34</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#l00078">Event.h:78</a></div></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_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#l00048">Event.h:48</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#l00040">Event.h:40</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="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#l00057">Event.h:57</a></div></div>
<div class="ttc" id="aclassbeast_1_1insight_1_1Event_html_a3a37cfe6776b7e238bf63ea7981e0ec0"><div class="ttname"><a href="classbeast_1_1insight_1_1Event.html#a3a37cfe6776b7e238bf63ea7981e0ec0">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#l00072">Event.h:72</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#l00064">Event.h:64</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#l00657">base_uint.h:657</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>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>