Chris@16
|
1 /*
|
Chris@101
|
2 * Copyright Andrey Semashev 2007 - 2015.
|
Chris@16
|
3 * Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
4 * (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
5 * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 */
|
Chris@16
|
7 /*!
|
Chris@16
|
8 * \file support/exception.hpp
|
Chris@16
|
9 * \author Andrey Semashev
|
Chris@16
|
10 * \date 18.07.2009
|
Chris@16
|
11 *
|
Chris@16
|
12 * This header enables Boost.Exception support for Boost.Log.
|
Chris@16
|
13 */
|
Chris@16
|
14
|
Chris@16
|
15 #ifndef BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_
|
Chris@16
|
16 #define BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/exception/info.hpp>
|
Chris@16
|
19 #include <boost/log/detail/config.hpp>
|
Chris@16
|
20 #include <boost/log/attributes/attribute_name.hpp>
|
Chris@16
|
21 #include <boost/log/attributes/named_scope.hpp>
|
Chris@16
|
22 #include <boost/log/utility/type_info_wrapper.hpp>
|
Chris@16
|
23 #include <boost/log/detail/header.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 #ifdef BOOST_HAS_PRAGMA_ONCE
|
Chris@16
|
26 #pragma once
|
Chris@16
|
27 #endif
|
Chris@16
|
28
|
Chris@16
|
29 namespace boost {
|
Chris@16
|
30
|
Chris@16
|
31 BOOST_LOG_OPEN_NAMESPACE
|
Chris@16
|
32
|
Chris@16
|
33 /*!
|
Chris@16
|
34 * Attribute name exception information
|
Chris@16
|
35 */
|
Chris@16
|
36 typedef error_info< struct attribute_name_info_tag, attribute_name > attribute_name_info;
|
Chris@16
|
37
|
Chris@16
|
38 /*!
|
Chris@16
|
39 * Type info exception information
|
Chris@16
|
40 */
|
Chris@16
|
41 typedef error_info< struct type_info_info_tag, type_info_wrapper > type_info_info;
|
Chris@16
|
42
|
Chris@16
|
43 /*!
|
Chris@16
|
44 * Parse position exception information
|
Chris@16
|
45 */
|
Chris@16
|
46 typedef error_info< struct position_info_tag, unsigned int > position_info;
|
Chris@16
|
47
|
Chris@16
|
48 /*!
|
Chris@16
|
49 * Current scope exception information
|
Chris@16
|
50 */
|
Chris@16
|
51 typedef error_info< struct current_scope_info_tag, attributes::named_scope_list > current_scope_info;
|
Chris@16
|
52
|
Chris@16
|
53 /*!
|
Chris@16
|
54 * The function returns an error information object that contains current stack of scopes.
|
Chris@16
|
55 * This information can then be attached to an exception and extracted at the catch site.
|
Chris@16
|
56 * The extracted scope list won't be affected by any scope changes that may happen during
|
Chris@16
|
57 * the exception propagation.
|
Chris@16
|
58 *
|
Chris@16
|
59 * \note See the \c named_scope attribute documentation on how to maintain scope list.
|
Chris@16
|
60 */
|
Chris@16
|
61 inline current_scope_info current_scope()
|
Chris@16
|
62 {
|
Chris@16
|
63 return current_scope_info(attributes::named_scope::get_scopes());
|
Chris@16
|
64 }
|
Chris@16
|
65
|
Chris@16
|
66 BOOST_LOG_CLOSE_NAMESPACE // namespace log
|
Chris@16
|
67
|
Chris@16
|
68 } // namespace boost
|
Chris@16
|
69
|
Chris@16
|
70 #include <boost/log/detail/footer.hpp>
|
Chris@16
|
71
|
Chris@16
|
72 #endif // BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_
|