...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::sources::basic_exception_handler_logger — Exception handler feature implementation.
// In header: <boost/log/sources/exception_handler_feature.hpp> template<typename BaseT> class basic_exception_handler_logger : public BaseT { public: // types typedef base_type::threading_model threading_model; // Threading model being used. typedef base_type::final_type final_type; // Final logger type. typedef unspecified exception_handler_type; // Exception handler function type. typedef strictest_lock< typename base_type::open_record_lock, no_lock< threading_model > >::type open_record_lock; // Lock requirement for the open_record_unlocked method. typedef strictest_lock< typename base_type::push_record_lock, no_lock< threading_model > >::type push_record_lock; // Lock requirement for the push_record_unlocked method. typedef unspecified swap_lock; // Lock requirement for the swap_unlocked method. // construct/copy/destruct basic_exception_handler_logger(); basic_exception_handler_logger(basic_exception_handler_logger const &); basic_exception_handler_logger(basic_exception_handler_logger &&) noexcept(boost::is_nothrow_move_constructible< base_type >::value &&boost::is_nothrow_move_constructible< exception_handler_type >::value)); template<typename ArgsT> explicit basic_exception_handler_logger(ArgsT const &); // public member functions template<typename HandlerT> void set_exception_handler(HandlerT const &); // protected member functions template<typename ArgsT> record open_record_unlocked(ArgsT const &); void push_record_unlocked(record &&); void swap_unlocked(basic_exception_handler_logger &); };
basic_exception_handler_logger
public
construct/copy/destructbasic_exception_handler_logger();
Default constructor. The constructed logger does not have an exception handler.
basic_exception_handler_logger(basic_exception_handler_logger const & that);
Copy constructor
basic_exception_handler_logger(basic_exception_handler_logger && that) noexcept(boost::is_nothrow_move_constructible< base_type >::value &&boost::is_nothrow_move_constructible< exception_handler_type >::value));
Move constructor
template<typename ArgsT> explicit basic_exception_handler_logger(ArgsT const & args);
Constructor with arguments. Passes arguments to other features.
basic_exception_handler_logger
public member functionstemplate<typename HandlerT> void set_exception_handler(HandlerT const & handler);
The method sets exception handler function. The function will be called with no arguments in case if an exception occurs during either open_record
or push_record
method execution. Since exception handler is called from a catch
statement, the exception can be rethrown in order to determine its type.
By default no handler is installed, thus any exception is propagated as usual.
See Also:
utility/exception_handler.hpp
Note | |
---|---|
The exception handler can be invoked in several threads concurrently. |
Note | |
---|---|
Thread interruptions are not affected by exception handlers. |
Parameters: |
|
basic_exception_handler_logger
protected member functionstemplate<typename ArgsT> record open_record_unlocked(ArgsT const & args);
Unlocked open_record
void push_record_unlocked(record && rec);
Unlocked push_record
void swap_unlocked(basic_exception_handler_logger & that);
Unlocked swap