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

Unbounded ordering log record queueing strategy. More...

#include <unbounded_ordering_queue.hpp>

Public Member Functions

posix_time::time_duration get_ordering_window () const
 Returns ordering window size specified during initialization. More...
 

Static Public Member Functions

static posix_time::time_duration get_default_ordering_window ()
 Returns default ordering window size. More...
 

Protected Member Functions

template<typename ArgsT >
 unbounded_ordering_queue (ArgsT const &args)
 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 no log records are ready to be processed. More...
 
bool try_dequeue (record_view &rec)
 Attempts to dequeue log record from the queue, does not block. More...
 
bool dequeue_ready (record_view &rec)
 Dequeues log record from the queue, blocks if no log records are ready to be processed. More...
 
void interrupt_dequeue ()
 Wakes a thread possibly blocked in the dequeue method. More...
 

Detailed Description

template<typename OrderT>
class boost::sinks::unbounded_ordering_queue< OrderT >

Unbounded ordering log record queueing strategy.

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

This strategy provides the following properties to the record queueing mechanism:

  • The queue has no size limits.
  • The queue has a fixed latency window. This means that each log record put into the queue will normally not be dequeued for a certain period of time.
  • The queue performs stable record ordering within the latency window. The ordering predicate can be specified in the OrderT template parameter.

Since this queue has no size limits, it may grow uncontrollably if sink backends dequeue log records not fast enough. When this is an issue, it is recommended to use one of the bounded strategies.

Constructor & Destructor Documentation

template<typename OrderT >
template<typename ArgsT >
boost::sinks::unbounded_ordering_queue< OrderT >::unbounded_ordering_queue ( ArgsT const &  args)
inlineexplicitprotected

Initializing constructor.

Member Function Documentation

template<typename OrderT >
bool boost::sinks::unbounded_ordering_queue< OrderT >::dequeue_ready ( record_view rec)
inlineprotected

Dequeues log record from the queue, blocks if no log records are ready to be processed.

References boost::geometry::difference(), boost::lock(), and boost::condition_variable::wait().

template<typename OrderT >
void boost::sinks::unbounded_ordering_queue< OrderT >::enqueue ( record_view const &  rec)
inlineprotected

Enqueues log record to the queue.

References boost::lock().

template<typename OrderT >
static posix_time::time_duration boost::sinks::unbounded_ordering_queue< OrderT >::get_default_ordering_window ( )
inlinestatic

Returns default ordering window size.

The default window size is specific to the operating system thread scheduling mechanism.

template<typename OrderT >
posix_time::time_duration boost::sinks::unbounded_ordering_queue< OrderT >::get_ordering_window ( ) const
inline

Returns ordering window size specified during initialization.

template<typename OrderT >
void boost::sinks::unbounded_ordering_queue< OrderT >::interrupt_dequeue ( )
inlineprotected

Wakes a thread possibly blocked in the dequeue method.

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

template<typename OrderT >
bool boost::sinks::unbounded_ordering_queue< OrderT >::try_dequeue ( record_view rec)
inlineprotected

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

References boost::lock().

template<typename OrderT >
bool boost::sinks::unbounded_ordering_queue< OrderT >::try_dequeue_ready ( record_view rec)
inlineprotected

Attempts to dequeue a log record ready for processing from the queue, does not block if no log records are ready to be processed.

References boost::lock().

template<typename OrderT >
bool boost::sinks::unbounded_ordering_queue< OrderT >::try_enqueue ( record_view const &  rec)
inlineprotected

Attempts to enqueue log record to the queue.

References boost::lock(), boost::unique_lock< Mutex >::owns_lock(), and boost::try_to_lock.


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