update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -23,11 +23,10 @@
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/core/addressof.hpp>
#include <boost/type_traits/is_nothrow_swappable.hpp>
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/facilities/identity.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/parameter_tools.hpp>
@@ -92,7 +91,7 @@ public:
#if !defined(BOOST_LOG_NO_THREADS)
//! Lock requirement for the swap_unlocked method
typedef boost::log::aux::exclusive_lock_guard< threading_model > swap_lock;
typedef boost::log::aux::multiple_unique_lock2< threading_model, threading_model > swap_lock;
//! Lock requirement for the add_attribute_unlocked method
typedef boost::log::aux::exclusive_lock_guard< threading_model > add_attribute_lock;
//! Lock requirement for the remove_attribute_unlocked method
@@ -144,7 +143,7 @@ public:
*/
basic_logger(basic_logger const& that) :
threading_model(static_cast< threading_model const& >(that)),
m_pCore(core::get()),
m_pCore(that.m_pCore),
m_Attributes(that.m_Attributes)
{
}
@@ -155,11 +154,13 @@ public:
*
* \param that Source logger
*/
basic_logger(BOOST_RV_REF(basic_logger) that) :
threading_model(boost::move(static_cast< threading_model& >(that)))
basic_logger(BOOST_RV_REF(basic_logger) that) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< threading_model >::value &&
boost::is_nothrow_move_constructible< core_ptr >::value &&
boost::is_nothrow_move_constructible< attribute_set >::value) :
threading_model(boost::move(static_cast< threading_model& >(that))),
m_pCore(boost::move(that.m_pCore)),
m_Attributes(boost::move(that.m_Attributes))
{
m_pCore.swap(that.m_pCore);
m_Attributes.swap(that.m_Attributes);
}
/*!
* Constructor with named arguments. The constructor ignores all arguments. The result of
@@ -188,15 +189,15 @@ protected:
/*!
* An accessor to the threading model base
*/
threading_model& get_threading_model() { return *this; }
threading_model& get_threading_model() BOOST_NOEXCEPT { return *this; }
/*!
* An accessor to the threading model base
*/
threading_model const& get_threading_model() const { return *this; }
threading_model const& get_threading_model() const BOOST_NOEXCEPT { return *this; }
/*!
* An accessor to the final logger
*/
final_type* final_this()
final_type* final_this() BOOST_NOEXCEPT
{
BOOST_LOG_ASSUME(this != NULL);
return static_cast< final_type* >(this);
@@ -204,7 +205,7 @@ protected:
/*!
* An accessor to the final logger
*/
final_type const* final_this() const
final_type const* final_this() const BOOST_NOEXCEPT
{
BOOST_LOG_ASSUME(this != NULL);
return static_cast< final_type const* >(this);
@@ -293,7 +294,7 @@ protected:
template< typename CharT, typename FinalT, typename ThreadingModelT >
inline void swap(
basic_logger< CharT, FinalT, ThreadingModelT >& left,
basic_logger< CharT, FinalT, ThreadingModelT >& right)
basic_logger< CharT, FinalT, ThreadingModelT >& right) BOOST_NOEXCEPT_IF(boost::is_nothrow_swappable< FinalT >::value)
{
static_cast< FinalT& >(left).swap(static_cast< FinalT& >(right));
}
@@ -332,6 +333,9 @@ public:
//! Threading model being used
typedef typename base_type::threading_model threading_model;
//! Lock requirement for the swap_unlocked method
typedef typename base_type::swap_lock swap_lock;
#if !defined(BOOST_LOG_NO_THREADS)
public:
@@ -353,7 +357,7 @@ public:
/*!
* Move constructor
*/
basic_composite_logger(BOOST_RV_REF(logger_base) that) :
basic_composite_logger(BOOST_RV_REF(logger_base) that) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< base_type >::value) :
base_type(boost::move(static_cast< base_type& >(that)))
{
}
@@ -476,11 +480,8 @@ public:
*/
void swap(basic_composite_logger& that)
{
boost::log::aux::multiple_unique_lock2<
threading_model,
threading_model
> lock(base_type::get_threading_model(), that.get_threading_model());
base_type::swap_unlocked(that);
swap_lock lock(base_type::get_threading_model(), that.get_threading_model());
base_type::swap_unlocked(static_cast< base_type& >(that));
}
protected:
@@ -530,7 +531,7 @@ public:
base_type(static_cast< base_type const& >(that))
{
}
basic_composite_logger(BOOST_RV_REF(logger_base) that) :
basic_composite_logger(BOOST_RV_REF(logger_base) that) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< base_type >::value) :
base_type(boost::move(static_cast< base_type& >(that)))
{
}
@@ -582,7 +583,7 @@ public:
}
void swap(basic_composite_logger& that)
{
base_type::swap_unlocked(that);
base_type::swap_unlocked(static_cast< base_type& >(that));
}
protected:
@@ -601,7 +602,7 @@ protected:
BOOST_DEFAULTED_FUNCTION(class_type(), {})\
class_type(class_type const& that) : class_type::logger_base(\
static_cast< typename_keyword() class_type::logger_base const& >(that)) {}\
class_type(BOOST_RV_REF(class_type) that) : class_type::logger_base(\
class_type(BOOST_RV_REF(class_type) that) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< typename_keyword() class_type::logger_base >::value) : class_type::logger_base(\
::boost::move(static_cast< typename_keyword() class_type::logger_base& >(that))) {}\
BOOST_LOG_PARAMETRIZED_CONSTRUCTORS_FORWARD(class_type, class_type::logger_base)\

View File

@@ -18,6 +18,7 @@
#include <string>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/locks.hpp>
#include <boost/log/detail/default_attribute_names.hpp>
@@ -76,7 +77,7 @@ public:
typedef typename strictest_lock<
typename base_type::swap_lock,
#ifndef BOOST_LOG_NO_THREADS
boost::log::aux::exclusive_lock_guard< threading_model >
boost::log::aux::multiple_unique_lock2< threading_model, threading_model >
#else
no_lock< threading_model >
#endif // !defined(BOOST_LOG_NO_THREADS)
@@ -107,18 +108,18 @@ public:
*/
basic_channel_logger(basic_channel_logger const& that) :
base_type(static_cast< base_type const& >(that)),
m_ChannelAttr(that.m_ChannelAttr)
m_ChannelAttr(that.m_ChannelAttr.get())
{
// Our attributes must refer to our channel attribute
base_type::attributes()[boost::log::aux::default_attribute_names::channel()] = m_ChannelAttr;
}
/*!
* Move constructor
*/
basic_channel_logger(BOOST_RV_REF(basic_channel_logger) that) :
basic_channel_logger(BOOST_RV_REF(basic_channel_logger) that) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< base_type >::value && boost::is_nothrow_move_constructible< channel_attribute >::value) :
base_type(boost::move(static_cast< base_type& >(that))),
m_ChannelAttr(boost::move(that.m_ChannelAttr))
{
base_type::attributes()[boost::log::aux::default_attribute_names::channel()] = m_ChannelAttr;
}
/*!
* Constructor with arguments. Allows to register a channel name attribute on construction.

View File

@@ -15,10 +15,11 @@
#ifndef BOOST_LOG_SOURCES_EXCEPTION_HANDLER_FEATURE_HPP_INCLUDED_
#define BOOST_LOG_SOURCES_EXCEPTION_HANDLER_FEATURE_HPP_INCLUDED_
#include <boost/mpl/if.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
#include <boost/type_traits/conditional.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/light_function.hpp>
#include <boost/log/detail/locks.hpp>
@@ -77,7 +78,7 @@ public:
typedef typename strictest_lock<
typename base_type::swap_lock,
#ifndef BOOST_LOG_NO_THREADS
boost::log::aux::exclusive_lock_guard< threading_model >
boost::log::aux::multiple_unique_lock2< threading_model, threading_model >
#else
no_lock< threading_model >
#endif // !defined(BOOST_LOG_NO_THREADS)
@@ -105,7 +106,7 @@ public:
/*!
* Move constructor
*/
basic_exception_handler_logger(BOOST_RV_REF(basic_exception_handler_logger) that) :
basic_exception_handler_logger(BOOST_RV_REF(basic_exception_handler_logger) that) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< base_type >::value && boost::is_nothrow_move_constructible< exception_handler_type >::value) :
base_type(boost::move(static_cast< base_type& >(that))),
m_ExceptionHandler(boost::move(that.m_ExceptionHandler))
{
@@ -210,8 +211,8 @@ private:
// we shall acquire a read lock here, when an exception is caught.
// If other features do require locking, the thread model is
// already locked by now, and we don't do locking at all.
typedef typename mpl::if_<
is_same< no_lock< threading_model >, typename final_type::push_record_lock >,
typedef typename boost::conditional<
is_same< no_lock< threading_model >, typename final_type::push_record_lock >::value,
boost::log::aux::shared_lock_guard< threading_model >,
no_lock< threading_model >
>::type lock_type;

View File

@@ -51,17 +51,25 @@ namespace aux {
template< typename StreamT, typename T, bool ByValueV, typename R >
struct enable_record_ostream_generic_operator {};
template< typename CharT, typename T, typename R >
struct enable_record_ostream_generic_operator< basic_record_ostream< CharT >, T, false, R > :
public boost::disable_if_c< boost::is_scalar< typename boost::remove_cv< T >::type >::value, R >
{
};
template< typename CharT, typename T, typename R >
struct enable_record_ostream_generic_operator< basic_record_ostream< CharT >, T, true, R > :
public boost::enable_if_c< boost::is_enum< typename boost::remove_cv< T >::type >::value, R >
{
};
template< typename CharT, typename T, typename R >
struct enable_record_ostream_generic_operator< basic_record_ostream< CharT >, T*, true, R > :
public disable_if_streamable_char_type< typename boost::remove_cv< T >::type, R >
{
};
} // namespace aux
/*!
@@ -326,12 +334,6 @@ public:
return *this;
}
basic_record_ostream& operator<< (const void* value)
{
static_cast< base_type& >(*this) << value;
return *this;
}
basic_record_ostream& operator<< (std::basic_streambuf< char_type, traits_type >* buf)
{
static_cast< base_type& >(*this) << buf;

View File

@@ -17,9 +17,11 @@
#include <boost/cstdint.hpp>
#include <boost/static_assert.hpp>
#include <boost/core/swap.hpp>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/locks.hpp>
#include <boost/log/detail/default_attribute_names.hpp>
@@ -67,7 +69,7 @@ namespace aux {
{
public:
//! The method dispatches the value to the given object
bool dispatch(type_dispatcher& dispatcher)
bool dispatch(type_dispatcher& dispatcher) BOOST_OVERRIDE
{
type_dispatcher::callback< value_type > callback = dispatcher.get_callback< value_type >();
if (callback)
@@ -80,7 +82,7 @@ namespace aux {
}
//! The method is called when the attribute value is passed to another thread
intrusive_ptr< attribute_value::impl > detach_from_thread()
intrusive_ptr< attribute_value::impl > detach_from_thread() BOOST_OVERRIDE
{
#if !defined(BOOST_LOG_NO_THREADS)
return new attributes::attribute_value_impl< value_type >(
@@ -98,11 +100,11 @@ namespace aux {
{
}
//! Copy constructor
severity_level(severity_level const& that) : attribute(static_cast< attribute const& >(that))
severity_level(severity_level const& that) BOOST_NOEXCEPT : attribute(static_cast< attribute const& >(that))
{
}
//! Move constructor
severity_level(BOOST_RV_REF(severity_level) that) : attribute(boost::move(static_cast< attribute& >(that)))
severity_level(BOOST_RV_REF(severity_level) that) BOOST_NOEXCEPT : attribute(boost::move(static_cast< attribute& >(that)))
{
}
//! Constructor for casting support
@@ -114,16 +116,16 @@ namespace aux {
/*!
* Copy assignment
*/
severity_level& operator= (BOOST_COPY_ASSIGN_REF(severity_level) that)
severity_level& operator= (BOOST_COPY_ASSIGN_REF(severity_level) that) BOOST_NOEXCEPT
{
attribute::operator= (that);
attribute::operator= (static_cast< attribute const& >(that));
return *this;
}
/*!
* Move assignment
*/
severity_level& operator= (BOOST_RV_REF(severity_level) that)
severity_level& operator= (BOOST_RV_REF(severity_level) that) BOOST_NOEXCEPT
{
this->swap(that);
return *this;
@@ -175,7 +177,7 @@ public:
typedef typename strictest_lock<
typename base_type::swap_lock,
#ifndef BOOST_LOG_NO_THREADS
boost::log::aux::exclusive_lock_guard< threading_model >
boost::log::aux::multiple_unique_lock2< threading_model, threading_model >
#else
no_lock< threading_model >
#endif // !defined(BOOST_LOG_NO_THREADS)
@@ -206,17 +208,19 @@ public:
m_DefaultSeverity(that.m_DefaultSeverity),
m_SeverityAttr(that.m_SeverityAttr)
{
// Our attributes must refer to our severity attribute
base_type::attributes()[boost::log::aux::default_attribute_names::severity()] = m_SeverityAttr;
}
/*!
* Move constructor
*/
basic_severity_logger(BOOST_RV_REF(basic_severity_logger) that) :
basic_severity_logger(BOOST_RV_REF(basic_severity_logger) that) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< base_type >::value &&
boost::is_nothrow_move_constructible< severity_level >::value &&
boost::is_nothrow_move_constructible< severity_attribute >::value) :
base_type(boost::move(static_cast< base_type& >(that))),
m_DefaultSeverity(boost::move(that.m_DefaultSeverity)),
m_SeverityAttr(boost::move(that.m_SeverityAttr))
{
base_type::attributes()[boost::log::aux::default_attribute_names::severity()] = m_SeverityAttr;
}
/*!
* Constructor with named arguments. Allows to setup the default level for log records.
@@ -257,9 +261,7 @@ protected:
void swap_unlocked(basic_severity_logger& that)
{
base_type::swap_unlocked(static_cast< base_type& >(that));
severity_level t = m_DefaultSeverity;
m_DefaultSeverity = that.m_DefaultSeverity;
that.m_DefaultSeverity = t;
boost::swap(m_DefaultSeverity, that.m_DefaultSeverity);
m_SeverityAttr.swap(that.m_SeverityAttr);
}
};

View File

@@ -17,10 +17,11 @@
#ifndef BOOST_LOG_SOURCES_THREADING_MODELS_HPP_INCLUDED_
#define BOOST_LOG_SOURCES_THREADING_MODELS_HPP_INCLUDED_
#include <boost/type_traits/has_nothrow_constructor.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/locks.hpp> // is_mutex_type
#if !defined(BOOST_LOG_NO_THREADS)
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/integral_constant.hpp>
#endif
#include <boost/log/detail/header.hpp>
@@ -38,66 +39,79 @@ namespace sources {
struct single_thread_model
{
// We provide methods for the most advanced locking concept: UpgradeLockable
void lock_shared() const {}
bool try_lock_shared() const { return true; }
void lock_shared() const BOOST_NOEXCEPT {}
bool try_lock_shared() const BOOST_NOEXCEPT { return true; }
template< typename TimeT >
bool timed_lock_shared(TimeT const&) const { return true; }
void unlock_shared() const {}
void lock() const {}
bool try_lock() const { return true; }
bool timed_lock_shared(TimeT const&) const BOOST_NOEXCEPT { return true; }
void unlock_shared() const BOOST_NOEXCEPT {}
void lock() const BOOST_NOEXCEPT {}
bool try_lock() const BOOST_NOEXCEPT { return true; }
template< typename TimeT >
bool timed_lock(TimeT const&) const { return true; }
void unlock() const {}
void lock_upgrade() const {}
bool try_lock_upgrade() const { return true; }
bool timed_lock(TimeT const&) const BOOST_NOEXCEPT { return true; }
void unlock() const BOOST_NOEXCEPT {}
void lock_upgrade() const BOOST_NOEXCEPT {}
bool try_lock_upgrade() const BOOST_NOEXCEPT { return true; }
template< typename TimeT >
bool timed_lock_upgrade(TimeT const&) const { return true; }
void unlock_upgrade() const {}
void unlock_upgrade_and_lock() const {}
void unlock_and_lock_upgrade() const {}
void unlock_and_lock_shared() const {}
void unlock_upgrade_and_lock_shared() const {}
bool timed_lock_upgrade(TimeT const&) const BOOST_NOEXCEPT { return true; }
void unlock_upgrade() const BOOST_NOEXCEPT {}
void unlock_upgrade_and_lock() const BOOST_NOEXCEPT {}
void unlock_and_lock_upgrade() const BOOST_NOEXCEPT {}
void unlock_and_lock_shared() const BOOST_NOEXCEPT {}
void unlock_upgrade_and_lock_shared() const BOOST_NOEXCEPT {}
void swap(single_thread_model&) {}
void swap(single_thread_model&) BOOST_NOEXCEPT {}
};
inline void swap(single_thread_model&, single_thread_model&) BOOST_NOEXCEPT
{
}
#if !defined(BOOST_LOG_NO_THREADS)
//! Multi-thread locking model with maximum locking capabilities
template< typename MutexT >
struct multi_thread_model
{
multi_thread_model() {}
multi_thread_model(multi_thread_model const&) {}
multi_thread_model& operator= (multi_thread_model const&) { return *this; }
multi_thread_model() BOOST_NOEXCEPT_IF(boost::has_nothrow_constructor< MutexT >::value) {}
multi_thread_model(multi_thread_model const&) BOOST_NOEXCEPT_IF(boost::has_nothrow_constructor< MutexT >::value) {}
multi_thread_model& operator= (multi_thread_model const&) BOOST_NOEXCEPT { return *this; }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
multi_thread_model(multi_thread_model&&) BOOST_NOEXCEPT_IF(boost::has_nothrow_constructor< MutexT >::value) {}
multi_thread_model& operator= (multi_thread_model&&) BOOST_NOEXCEPT { return *this; }
#endif
void lock_shared() const { m_Mutex.lock_shared(); }
bool try_lock_shared() const { return m_Mutex.try_lock_shared(); }
template< typename TimeT >
bool timed_lock_shared(TimeT const& t) const { return m_Mutex.timed_lock_shared(t); }
void unlock_shared() const { m_Mutex.unlock_shared(); }
void unlock_shared() const BOOST_NOEXCEPT { m_Mutex.unlock_shared(); }
void lock() const { m_Mutex.lock(); }
bool try_lock() const { return m_Mutex.try_lock(); }
template< typename TimeT >
bool timed_lock(TimeT const& t) const { return m_Mutex.timed_lock(t); }
void unlock() const { m_Mutex.unlock(); }
void unlock() const BOOST_NOEXCEPT { m_Mutex.unlock(); }
void lock_upgrade() const { m_Mutex.lock_upgrade(); }
bool try_lock_upgrade() const { return m_Mutex.try_lock_upgrade(); }
template< typename TimeT >
bool timed_lock_upgrade(TimeT const& t) const { return m_Mutex.timed_lock_upgrade(t); }
void unlock_upgrade() const { m_Mutex.unlock_upgrade(); }
void unlock_upgrade() const BOOST_NOEXCEPT { m_Mutex.unlock_upgrade(); }
void unlock_upgrade_and_lock() const { m_Mutex.unlock_upgrade_and_lock(); }
void unlock_and_lock_upgrade() const { m_Mutex.unlock_and_lock_upgrade(); }
void unlock_and_lock_shared() const { m_Mutex.unlock_and_lock_shared(); }
void unlock_upgrade_and_lock_shared() const { m_Mutex.unlock_upgrade_and_lock_shared(); }
void swap(multi_thread_model&) {}
void swap(multi_thread_model&) BOOST_NOEXCEPT {}
private:
//! Synchronization primitive
mutable MutexT m_Mutex;
};
template< typename MutexT >
inline void swap(multi_thread_model< MutexT >&, multi_thread_model< MutexT >&) BOOST_NOEXCEPT
{
}
#endif // !defined(BOOST_LOG_NO_THREADS)
} // namespace sources
@@ -107,12 +121,12 @@ BOOST_LOG_CLOSE_NAMESPACE // namespace log
#if !defined(BOOST_LOG_NO_THREADS) && !defined(BOOST_LOG_DOXYGEN_PASS)
template< >
struct is_mutex_type< boost::log::sources::single_thread_model > : mpl::true_
struct is_mutex_type< boost::log::sources::single_thread_model > : boost::true_type
{
};
template< typename T >
struct is_mutex_type< boost::log::sources::multi_thread_model< T > > : mpl::true_
struct is_mutex_type< boost::log::sources::multi_thread_model< T > > : boost::true_type
{
};