File indexing completed on 2025-11-03 09:27:21
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 #ifndef BOOST_LOG_DETAIL_ENQUEUED_RECORD_HPP_INCLUDED_
0018 #define BOOST_LOG_DETAIL_ENQUEUED_RECORD_HPP_INCLUDED_
0019 
0020 #include <chrono>
0021 #include <boost/move/core.hpp>
0022 #include <boost/move/utility_core.hpp>
0023 #include <boost/log/detail/config.hpp>
0024 #include <boost/log/core/record_view.hpp>
0025 #include <boost/log/detail/header.hpp>
0026 
0027 #ifdef BOOST_HAS_PRAGMA_ONCE
0028 #pragma once
0029 #endif
0030 
0031 namespace boost {
0032 
0033 BOOST_LOG_OPEN_NAMESPACE
0034 
0035 namespace sinks {
0036 
0037 namespace aux {
0038 
0039 
0040 class enqueued_record
0041 {
0042     BOOST_COPYABLE_AND_MOVABLE(enqueued_record)
0043 
0044 public:
0045     
0046     template< typename OrderT >
0047     struct order :
0048         public OrderT
0049     {
0050         typedef typename OrderT::result_type result_type;
0051 
0052         order() {}
0053         order(order const& that) : OrderT(static_cast< OrderT const& >(that)) {}
0054         order(OrderT const& that) : OrderT(that) {}
0055 
0056         result_type operator() (enqueued_record const& left, enqueued_record const& right) const
0057         {
0058             
0059             return OrderT::operator() (right.m_record, left.m_record);
0060         }
0061     };
0062 
0063     std::chrono::steady_clock::time_point m_timestamp;
0064     record_view m_record;
0065 
0066     enqueued_record(enqueued_record const& that) BOOST_NOEXCEPT : m_timestamp(that.m_timestamp), m_record(that.m_record)
0067     {
0068     }
0069     enqueued_record(BOOST_RV_REF(enqueued_record) that) BOOST_NOEXCEPT :
0070         m_timestamp(that.m_timestamp),
0071         m_record(boost::move(that.m_record))
0072     {
0073     }
0074     explicit enqueued_record(record_view const& rec) :
0075         m_timestamp(std::chrono::steady_clock::now()),
0076         m_record(rec)
0077     {
0078     }
0079     enqueued_record& operator= (BOOST_COPY_ASSIGN_REF(enqueued_record) that) BOOST_NOEXCEPT
0080     {
0081         m_timestamp = that.m_timestamp;
0082         m_record = that.m_record;
0083         return *this;
0084     }
0085     enqueued_record& operator= (BOOST_RV_REF(enqueued_record) that) BOOST_NOEXCEPT
0086     {
0087         m_timestamp = that.m_timestamp;
0088         m_record = boost::move(that.m_record);
0089         return *this;
0090     }
0091 };
0092 
0093 } 
0094 
0095 } 
0096 
0097 BOOST_LOG_CLOSE_NAMESPACE 
0098 
0099 } 
0100 
0101 #include <boost/log/detail/footer.hpp>
0102 
0103 #endif