| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> |
| <title>Class template bounded_fifo_queue</title> |
| <link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> |
| <link rel="home" href="../../../index.html" title="Chapter 1. Boost.Log v2"> |
| <link rel="up" href="../../../sinks.html#header.boost.log.sinks.bounded_fifo_queue_hpp" title="Header <boost/log/sinks/bounded_fifo_queue.hpp>"> |
| <link rel="prev" href="block_on_overflow.html" title="Class block_on_overflow"> |
| <link rel="next" href="bounded_ordering_queue.html" title="Class template bounded_ordering_queue"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td></tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <a accesskey="p" href="block_on_overflow.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../sinks.html#header.boost.log.sinks.bounded_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="bounded_ordering_queue.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> |
| </div> |
| <div class="refentry"> |
| <a name="boost.log.sinks.bounded_fifo_queue"></a><div class="titlepage"></div> |
| <div class="refnamediv"> |
| <h2><span class="refentrytitle">Class template bounded_fifo_queue</span></h2> |
| <p>boost::log::sinks::bounded_fifo_queue — Bounded FIFO log record queueing strategy. </p> |
| </div> |
| <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> |
| <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../../sinks.html#header.boost.log.sinks.bounded_fifo_queue_hpp" title="Header <boost/log/sinks/bounded_fifo_queue.hpp>">boost/log/sinks/bounded_fifo_queue.hpp</a>> |
| |
| </span><span class="keyword">template</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> MaxQueueSizeV<span class="special">,</span> <span class="keyword">typename</span> OverflowStrategyT<span class="special">></span> |
| <span class="keyword">class</span> <a class="link" href="bounded_fifo_queue.html" title="Class template bounded_fifo_queue">bounded_fifo_queue</a> <span class="special">:</span> <span class="keyword">private</span> <span class="identifier">OverflowStrategyT</span> <span class="special">{</span> |
| <span class="keyword">public</span><span class="special">:</span> |
| <span class="comment">// <a class="link" href="bounded_fifo_queue.html#boost.log.sinks.bounded_fifo_queueconstruct-copy-destruct">construct/copy/destruct</a></span> |
| <a class="link" href="bounded_fifo_queue.html#idp44355232-bb"><span class="identifier">bounded_fifo_queue</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> |
| <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> ArgsT<span class="special">></span> <span class="keyword">explicit</span> <a class="link" href="bounded_fifo_queue.html#idp44355808-bb"><span class="identifier">bounded_fifo_queue</span></a><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span> |
| |
| <span class="comment">// <a class="link" href="bounded_fifo_queue.html#idp44343520-bb">protected member functions</a></span> |
| <span class="keyword">void</span> <a class="link" href="bounded_fifo_queue.html#idp44344096-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">&</span><span class="special">)</span><span class="special">;</span> |
| <span class="keyword">bool</span> <a class="link" href="bounded_fifo_queue.html#idp44345936-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">&</span><span class="special">)</span><span class="special">;</span> |
| <span class="keyword">bool</span> <a class="link" href="bounded_fifo_queue.html#idp44347792-bb"><span class="identifier">try_dequeue_ready</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span> |
| <span class="keyword">bool</span> <a class="link" href="bounded_fifo_queue.html#idp44349712-bb"><span class="identifier">try_dequeue</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span> |
| <span class="keyword">bool</span> <a class="link" href="bounded_fifo_queue.html#idp44351600-bb"><span class="identifier">dequeue_ready</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span> |
| <span class="keyword">void</span> <a class="link" href="bounded_fifo_queue.html#idp44353472-bb"><span class="identifier">interrupt_dequeue</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> |
| <span class="special">}</span><span class="special">;</span></pre></div> |
| <div class="refsect1"> |
| <a name="idp123824288"></a><h2>Description</h2> |
| <p>The <code class="computeroutput"><a class="link" href="bounded_fifo_queue.html" title="Class template bounded_fifo_queue">bounded_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> |
| <p>This strategy describes log record queueing logic. The queue has a limited capacity, upon reaching which the enqueue operation will invoke the overflow handling strategy specified in the <code class="computeroutput">OverflowStrategyT</code> template parameter to handle the situation. The library provides overflow handling strategies for most common cases: <code class="computeroutput"><a class="link" href="drop_on_overflow.html" title="Class drop_on_overflow">drop_on_overflow</a></code> will silently discard the log record, and <code class="computeroutput"><a class="link" href="block_on_overflow.html" title="Class block_on_overflow">block_on_overflow</a></code> will put the enqueueing thread to wait until there is space in the queue.</p> |
| <p>The log record queue imposes no ordering over the queued elements aside from the order in which they are enqueued. </p> |
| <div class="refsect2"> |
| <a name="idp123831904"></a><h3> |
| <a name="boost.log.sinks.bounded_fifo_queueconstruct-copy-destruct"></a><code class="computeroutput">bounded_fifo_queue</code> |
| public |
| construct/copy/destruct</h3> |
| <div class="orderedlist"><ol class="orderedlist" type="1"> |
| <li class="listitem"> |
| <pre class="literallayout"><a name="idp44355232-bb"></a><span class="identifier">bounded_fifo_queue</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Default constructor. </li> |
| <li class="listitem"> |
| <pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> ArgsT<span class="special">></span> <span class="keyword">explicit</span> <a name="idp44355808-bb"></a><span class="identifier">bounded_fifo_queue</span><span class="special">(</span><span class="identifier">ArgsT</span> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span></pre>Initializing constructor. </li> |
| </ol></div> |
| </div> |
| <div class="refsect2"> |
| <a name="idp123846896"></a><h3> |
| <a name="idp44343520-bb"></a><code class="computeroutput">bounded_fifo_queue</code> protected member functions</h3> |
| <div class="orderedlist"><ol class="orderedlist" type="1"> |
| <li class="listitem"> |
| <pre class="literallayout"><span class="keyword">void</span> <a name="idp44344096-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">&</span> rec<span class="special">)</span><span class="special">;</span></pre>Enqueues log record to the queue. </li> |
| <li class="listitem"> |
| <pre class="literallayout"><span class="keyword">bool</span> <a name="idp44345936-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">&</span> rec<span class="special">)</span><span class="special">;</span></pre>Attempts to enqueue log record to the queue. </li> |
| <li class="listitem"> |
| <pre class="literallayout"><span class="keyword">bool</span> <a name="idp44347792-bb"></a><span class="identifier">try_dequeue_ready</span><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&</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> |
| <li class="listitem"> |
| <pre class="literallayout"><span class="keyword">bool</span> <a name="idp44349712-bb"></a><span class="identifier">try_dequeue</span><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&</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> |
| <li class="listitem"> |
| <pre class="literallayout"><span class="keyword">bool</span> <a name="idp44351600-bb"></a><span class="identifier">dequeue_ready</span><span class="special">(</span><span class="identifier">record_view</span> <span class="special">&</span> rec<span class="special">)</span><span class="special">;</span></pre>Dequeues log record from the queue, blocks if the queue is empty. </li> |
| <li class="listitem"> |
| <pre class="literallayout"><span class="keyword">void</span> <a name="idp44353472-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> |
| </ol></div> |
| </div> |
| </div> |
| </div> |
| <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> |
| <td align="left"></td> |
| <td align="right"><div class="copyright-footer">Copyright © 2007-2015 Andrey |
| Semashev<p> |
| Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 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>). |
| </p> |
| </div></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <a accesskey="p" href="block_on_overflow.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../sinks.html#header.boost.log.sinks.bounded_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="bounded_ordering_queue.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> |
| </div> |
| </body> |
| </html> |