diff DEPENDENCIES/generic/include/boost/log/sinks/bounded_ordering_queue.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/log/sinks/bounded_ordering_queue.hpp	Fri Sep 04 12:01:02 2015 +0100
+++ b/DEPENDENCIES/generic/include/boost/log/sinks/bounded_ordering_queue.hpp	Mon Sep 07 11:12:49 2015 +0100
@@ -1,5 +1,5 @@
 /*
- *          Copyright Andrey Semashev 2007 - 2013.
+ *          Copyright Andrey Semashev 2007 - 2015.
  * Distributed under the Boost Software License, Version 1.0.
  *    (See accompanying file LICENSE_1_0.txt or copy at
  *          http://www.boost.org/LICENSE_1_0.txt)
@@ -30,14 +30,13 @@
 #include <queue>
 #include <vector>
 #include <boost/cstdint.hpp>
-#include <boost/move/core.hpp>
-#include <boost/move/utility.hpp>
 #include <boost/thread/locks.hpp>
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/condition_variable.hpp>
 #include <boost/thread/thread_time.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 #include <boost/log/detail/timestamp.hpp>
+#include <boost/log/detail/enqueued_record.hpp>
 #include <boost/log/keywords/order.hpp>
 #include <boost/log/keywords/ordering_window.hpp>
 #include <boost/log/core/record_view.hpp>
@@ -75,64 +74,12 @@
 private:
     typedef OverflowStrategyT overflow_strategy;
     typedef boost::mutex mutex_type;
-
-    //! Log record with enqueueing timestamp
-    class enqueued_record
-    {
-        BOOST_COPYABLE_AND_MOVABLE(enqueued_record)
-
-    public:
-        //! Ordering predicate
-        struct order :
-            public OrderT
-        {
-            typedef typename OrderT::result_type result_type;
-
-            order() {}
-            order(order const& that) : OrderT(static_cast< OrderT const& >(that)) {}
-            order(OrderT const& that) : OrderT(that) {}
-
-            result_type operator() (enqueued_record const& left, enqueued_record const& right) const
-            {
-                // std::priority_queue requires ordering with semantics of std::greater, so we swap arguments
-                return OrderT::operator() (right.m_record, left.m_record);
-            }
-        };
-
-        boost::log::aux::timestamp m_timestamp;
-        record_view m_record;
-
-        enqueued_record(enqueued_record const& that) : m_timestamp(that.m_timestamp), m_record(that.m_record)
-        {
-        }
-        enqueued_record(BOOST_RV_REF(enqueued_record) that) :
-            m_timestamp(that.m_timestamp),
-            m_record(boost::move(that.m_record))
-        {
-        }
-        explicit enqueued_record(record_view const& rec) :
-            m_timestamp(boost::log::aux::get_timestamp()),
-            m_record(rec)
-        {
-        }
-        enqueued_record& operator= (BOOST_COPY_ASSIGN_REF(enqueued_record) that)
-        {
-            m_timestamp = that.m_timestamp;
-            m_record = that.m_record;
-            return *this;
-        }
-        enqueued_record& operator= (BOOST_RV_REF(enqueued_record) that)
-        {
-            m_timestamp = that.m_timestamp;
-            m_record = boost::move(that.m_record);
-            return *this;
-        }
-    };
+    typedef sinks::aux::enqueued_record enqueued_record;
 
     typedef std::priority_queue<
         enqueued_record,
         std::vector< enqueued_record >,
-        typename enqueued_record::order
+        enqueued_record::order< OrderT >
     > queue_type;
 
 private:
@@ -233,8 +180,7 @@
                 // We got a new element
                 rec = elem.m_record;
                 m_queue.pop();
-                if (size == MaxQueueSizeV)
-                    overflow_strategy::on_queue_space_available();
+                overflow_strategy::on_queue_space_available();
                 return true;
             }
         }
@@ -252,8 +198,7 @@
             enqueued_record const& elem = m_queue.top();
             rec = elem.m_record;
             m_queue.pop();
-            if (size == MaxQueueSizeV)
-                overflow_strategy::on_queue_space_available();
+            overflow_strategy::on_queue_space_available();
             return true;
         }
 
@@ -277,8 +222,7 @@
                 {
                     rec = elem.m_record;
                     m_queue.pop();
-                    if (size == MaxQueueSizeV)
-                        overflow_strategy::on_queue_space_available();
+                    overflow_strategy::on_queue_space_available();
                     return true;
                 }
                 else