Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / log / doc / html / boost / log / sinks / unbounded_fifo_queue.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Class unbounded_fifo_queue</title>
5 <link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../index.html" title="Chapter&#160;1.&#160;Boost.Log v2">
8 <link rel="up" href="../../../sinks.html#header.boost.log.sinks.unbounded_fifo_queue_hpp" title="Header &lt;boost/log/sinks/unbounded_fifo_queue.hpp&gt;">
9 <link rel="prev" href="basic_text_ostream_backend.html" title="Class template basic_text_ostream_backend">
10 <link rel="next" href="unbounded_ordering_queue.html" title="Class template unbounded_ordering_queue">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td></tr></table>
14 <hr>
15 <div class="spirit-nav">
16 <a accesskey="p" href="basic_text_ostream_backend.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../sinks.html#header.boost.log.sinks.unbounded_fifo_queue_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="unbounded_ordering_queue.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
17 </div>
18 <div class="refentry">
19 <a name="boost.log.sinks.unbounded_fifo_queue"></a><div class="titlepage"></div>
20 <div class="refnamediv">
21 <h2><span class="refentrytitle">Class unbounded_fifo_queue</span></h2>
22 <p>boost::log::sinks::unbounded_fifo_queue &#8212; Unbounded FIFO log record queueing strategy. </p>
23 </div>
24 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
25 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../sinks.html#header.boost.log.sinks.unbounded_fifo_queue_hpp" title="Header &lt;boost/log/sinks/unbounded_fifo_queue.hpp&gt;">boost/log/sinks/unbounded_fifo_queue.hpp</a>&gt;
26
27 </span>
28 <span class="keyword">class</span> <a class="link" href="unbounded_fifo_queue.html" title="Class unbounded_fifo_queue">unbounded_fifo_queue</a> <span class="special">{</span>
29 <span class="keyword">public</span><span class="special">:</span>
30   <span class="comment">// <a class="link" href="unbounded_fifo_queue.html#boost.log.sinks.unbounded_fifo_queueconstruct-copy-destruct">construct/copy/destruct</a></span>
31   <a class="link" href="unbounded_fifo_queue.html#idm45711345443136-bb"><span class="identifier">unbounded_fifo_queue</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
32   <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> <span class="keyword">explicit</span> <a class="link" href="unbounded_fifo_queue.html#idm45711345442560-bb"><span class="identifier">unbounded_fifo_queue</span></a><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
33
34   <span class="comment">// <a class="link" href="unbounded_fifo_queue.html#idm45711345454848-bb">protected member functions</a></span>
35   <span class="keyword">void</span> <a class="link" href="unbounded_fifo_queue.html#idm45711345454272-bb"><span class="identifier">enqueue</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
36   <span class="keyword">bool</span> <a class="link" href="unbounded_fifo_queue.html#idm45711345452432-bb"><span class="identifier">try_enqueue</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
37   <span class="keyword">bool</span> <a class="link" href="unbounded_fifo_queue.html#idm45711345450576-bb"><span class="identifier">try_dequeue_ready</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
38   <span class="keyword">bool</span> <a class="link" href="unbounded_fifo_queue.html#idm45711345448656-bb"><span class="identifier">try_dequeue</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
39   <span class="keyword">bool</span> <a class="link" href="unbounded_fifo_queue.html#idm45711345446768-bb"><span class="identifier">dequeue_ready</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
40   <span class="keyword">void</span> <a class="link" href="unbounded_fifo_queue.html#idm45711345444896-bb"><span class="identifier">interrupt_dequeue</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
41 <span class="special">}</span><span class="special">;</span></pre></div>
42 <div class="refsect1">
43 <a name="idm45554730618608"></a><h2>Description</h2>
44 <p>The <code class="computeroutput"><a class="link" href="unbounded_fifo_queue.html" title="Class unbounded_fifo_queue">unbounded_fifo_queue</a></code> class is intended to be used with the <code class="computeroutput"><a class="link" href="asynchronous_sink.html" title="Class template asynchronous_sink">asynchronous_sink</a></code> frontend as a log record queueing strategy.</p>
45 <p>This strategy implements the simplest logic of log record buffering between threads: the queue has no limits and imposes no ordering over the queued elements aside from the order in which they are enqueued. Because of this the queue provides decent performance and scalability, however if sink backends can't consume log records fast enough the queue may grow uncontrollably. When this is an issue, it is recommended to use one of the bounded strategies. </p>
46 <div class="refsect2">
47 <a name="idm45554730614560"></a><h3>
48 <a name="boost.log.sinks.unbounded_fifo_queueconstruct-copy-destruct"></a><code class="computeroutput">unbounded_fifo_queue</code> 
49         public
50        construct/copy/destruct</h3>
51 <div class="orderedlist"><ol class="orderedlist" type="1">
52 <li class="listitem">
53 <pre class="literallayout"><a name="idm45711345443136-bb"></a><span class="identifier">unbounded_fifo_queue</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Default constructor. </li>
54 <li class="listitem">
55 <pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> ArgsT<span class="special">&gt;</span> <span class="keyword">explicit</span> <a name="idm45711345442560-bb"></a><span class="identifier">unbounded_fifo_queue</span><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>Initializing constructor. </li>
56 </ol></div>
57 </div>
58 <div class="refsect2">
59 <a name="idm45554730599584"></a><h3>
60 <a name="idm45711345454848-bb"></a><code class="computeroutput">unbounded_fifo_queue</code> protected member functions</h3>
61 <div class="orderedlist"><ol class="orderedlist" type="1">
62 <li class="listitem">
63 <pre class="literallayout"><span class="keyword">void</span> <a name="idm45711345454272-bb"></a><span class="identifier">enqueue</span><span class="special">(</span><span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span> rec<span class="special">)</span><span class="special">;</span></pre>Enqueues log record to the queue. </li>
64 <li class="listitem">
65 <pre class="literallayout"><span class="keyword">bool</span> <a name="idm45711345452432-bb"></a><span class="identifier">try_enqueue</span><span class="special">(</span><span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span> rec<span class="special">)</span><span class="special">;</span></pre>Attempts to enqueue log record to the queue. </li>
66 <li class="listitem">
67 <pre class="literallayout"><span class="keyword">bool</span> <a name="idm45711345450576-bb"></a><span class="identifier">try_dequeue_ready</span><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&amp;</span> rec<span class="special">)</span><span class="special">;</span></pre>Attempts to dequeue a log record ready for processing from the queue, does not block if the queue is empty. </li>
68 <li class="listitem">
69 <pre class="literallayout"><span class="keyword">bool</span> <a name="idm45711345448656-bb"></a><span class="identifier">try_dequeue</span><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&amp;</span> rec<span class="special">)</span><span class="special">;</span></pre>Attempts to dequeue log record from the queue, does not block if the queue is empty. </li>
70 <li class="listitem">
71 <pre class="literallayout"><span class="keyword">bool</span> <a name="idm45711345446768-bb"></a><span class="identifier">dequeue_ready</span><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&amp;</span> rec<span class="special">)</span><span class="special">;</span></pre>Dequeues log record from the queue, blocks if the queue is empty. </li>
72 <li class="listitem">
73 <pre class="literallayout"><span class="keyword">void</span> <a name="idm45711345444896-bb"></a><span class="identifier">interrupt_dequeue</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Wakes a thread possibly blocked in the <code class="computeroutput">dequeue</code> method. </li>
74 </ol></div>
75 </div>
76 </div>
77 </div>
78 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
79 <td align="left"></td>
80 <td align="right"><div class="copyright-footer">Copyright &#169; 2007-2016 Andrey Semashev<p>
81         Distributed under the Boost Software License, Version 1.0. (See accompanying
82         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
83       </p>
84 </div></td>
85 </tr></table>
86 <hr>
87 <div class="spirit-nav">
88 <a accesskey="p" href="basic_text_ostream_backend.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../sinks.html#header.boost.log.sinks.unbounded_fifo_queue_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="unbounded_ordering_queue.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
89 </div>
90 </body>
91 </html>