Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT > Class Template Reference

Bounded FIFO log record queueing strategy. More...

#include <bounded_fifo_queue.hpp>

Inheritance diagram for boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >:
Collaboration diagram for boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >:

Protected Member Functions

 bounded_fifo_queue ()
 Default constructor. More...
 
template<typename ArgsT >
 bounded_fifo_queue (ArgsT const &)
 Initializing constructor. More...
 
void enqueue (record_view const &rec)
 Enqueues log record to the queue. More...
 
bool try_enqueue (record_view const &rec)
 Attempts to enqueue log record to the queue. More...
 
bool try_dequeue_ready (record_view &rec)
 Attempts to dequeue a log record ready for processing from the queue, does not block if the queue is empty. More...
 
bool try_dequeue (record_view &rec)
 Attempts to dequeue log record from the queue, does not block if the queue is empty. More...
 
bool dequeue_ready (record_view &rec)
 Dequeues log record from the queue, blocks if the queue is empty. More...
 
void interrupt_dequeue ()
 Wakes a thread possibly blocked in the dequeue method. More...
 

Detailed Description

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT>
class boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >

Bounded FIFO log record queueing strategy.

The bounded_fifo_queue class is intended to be used with the asynchronous_sink frontend as a log record queueing strategy.

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 OverflowStrategyT template parameter to handle the situation. The library provides overflow handling strategies for most common cases: drop_on_overflow will silently discard the log record, and block_on_overflow will put the enqueueing thread to wait until there is space in the queue.

The log record queue imposes no ordering over the queued elements aside from the order in which they are enqueued.

Constructor & Destructor Documentation

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT >
boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::bounded_fifo_queue ( )
inlineprotected

Default constructor.

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT >
template<typename ArgsT >
boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::bounded_fifo_queue ( ArgsT const &  )
inlineexplicitprotected

Initializing constructor.

Member Function Documentation

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT >
bool boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::dequeue_ready ( record_view rec)
inlineprotected

Dequeues log record from the queue, blocks if the queue is empty.

References boost::lock(), boost::size(), boost::record_view::swap(), and boost::condition_variable::wait().

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT >
void boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::enqueue ( record_view const &  rec)
inlineprotected

Enqueues log record to the queue.

References boost::lock(), boost::condition_variable::notify_one(), and boost::size().

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT >
void boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::interrupt_dequeue ( )
inlineprotected

Wakes a thread possibly blocked in the dequeue method.

References boost::lock(), and boost::condition_variable::notify_one().

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT >
bool boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::try_dequeue ( record_view rec)
inlineprotected

Attempts to dequeue log record from the queue, does not block if the queue is empty.

References boost::lock(), boost::size(), and boost::record_view::swap().

Referenced by boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::try_dequeue_ready().

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT >
bool boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::try_dequeue_ready ( record_view rec)
inlineprotected

Attempts to dequeue a log record ready for processing from the queue, does not block if the queue is empty.

References boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::try_dequeue().

template<std::size_t MaxQueueSizeV, typename OverflowStrategyT >
bool boost::sinks::bounded_fifo_queue< MaxQueueSizeV, OverflowStrategyT >::try_enqueue ( record_view const &  rec)
inlineprotected

The documentation for this class was generated from the following file: