Chris@16: /* Chris@101: * Copyright Andrey Semashev 2007 - 2015. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: /*! Chris@16: * \file support/exception.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 18.07.2009 Chris@16: * Chris@16: * This header enables Boost.Exception support for Boost.Log. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_ Chris@16: #define BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #ifdef BOOST_HAS_PRAGMA_ONCE Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: BOOST_LOG_OPEN_NAMESPACE Chris@16: Chris@16: /*! Chris@16: * Attribute name exception information Chris@16: */ Chris@16: typedef error_info< struct attribute_name_info_tag, attribute_name > attribute_name_info; Chris@16: Chris@16: /*! Chris@16: * Type info exception information Chris@16: */ Chris@16: typedef error_info< struct type_info_info_tag, type_info_wrapper > type_info_info; Chris@16: Chris@16: /*! Chris@16: * Parse position exception information Chris@16: */ Chris@16: typedef error_info< struct position_info_tag, unsigned int > position_info; Chris@16: Chris@16: /*! Chris@16: * Current scope exception information Chris@16: */ Chris@16: typedef error_info< struct current_scope_info_tag, attributes::named_scope_list > current_scope_info; Chris@16: Chris@16: /*! Chris@16: * The function returns an error information object that contains current stack of scopes. Chris@16: * This information can then be attached to an exception and extracted at the catch site. Chris@16: * The extracted scope list won't be affected by any scope changes that may happen during Chris@16: * the exception propagation. Chris@16: * Chris@16: * \note See the \c named_scope attribute documentation on how to maintain scope list. Chris@16: */ Chris@16: inline current_scope_info current_scope() Chris@16: { Chris@16: return current_scope_info(attributes::named_scope::get_scopes()); Chris@16: } Chris@16: Chris@16: BOOST_LOG_CLOSE_NAMESPACE // namespace log Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_