2 * Copyright Andrey Semashev 2007 - 2015.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
9 * \author Andrey Semashev
12 * The header contains log message keyword declaration.
15 #ifndef BOOST_LOG_EXPRESSIONS_MESSAGE_HPP_INCLUDED_
16 #define BOOST_LOG_EXPRESSIONS_MESSAGE_HPP_INCLUDED_
19 #include <boost/mpl/vector.hpp>
20 #include <boost/log/detail/config.hpp>
21 #include <boost/log/detail/default_attribute_names.hpp>
22 #include <boost/log/expressions/keyword.hpp>
23 #include <boost/log/expressions/is_keyword_descriptor.hpp>
24 #include <boost/log/attributes/attribute_name.hpp>
25 #include <boost/log/detail/header.hpp>
27 #ifdef BOOST_HAS_PRAGMA_ONCE
33 BOOST_LOG_OPEN_NAMESPACE
35 namespace expressions {
40 * Generic log message attribute descriptor.
43 public keyword_descriptor
45 // The attribute value type here is not essential since message attributes are not intended to be created via the keyword
46 typedef void attribute_type;
48 #if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T)
49 typedef mpl::vector2< std::string, std::wstring > value_type;
50 #elif defined(BOOST_LOG_USE_CHAR)
51 typedef std::string value_type;
52 #elif defined(BOOST_LOG_USE_WCHAR_T)
53 typedef std::wstring value_type;
56 static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); }
59 #if defined(BOOST_LOG_USE_CHAR)
61 * Narrow character log message attribute descriptor.
64 public keyword_descriptor
66 // The attribute value type here is not essential since message attributes are not intended to be created via the keyword
67 typedef void attribute_type;
68 typedef std::string value_type;
70 static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); }
74 #if defined(BOOST_LOG_USE_WCHAR_T)
76 * Wide character log message attribute descriptor.
79 public keyword_descriptor
81 // The attribute value type here is not essential since message attributes are not intended to be created via the keyword
82 typedef void attribute_type;
83 typedef std::wstring value_type;
85 static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); }
92 * Generic message keyword type.
94 typedef attribute_keyword< tag::message > message_type;
96 * Generic message keyword.
98 const message_type message = {};
100 #if defined(BOOST_LOG_USE_CHAR)
102 * Narrow message keyword type.
104 typedef attribute_keyword< tag::smessage > smessage_type;
106 * Narrow message keyword.
108 const smessage_type smessage = {};
111 #if defined(BOOST_LOG_USE_WCHAR_T)
113 * Wide message keyword type.
115 typedef attribute_keyword< tag::wmessage > wmessage_type;
117 * Wide message keyword.
119 const wmessage_type wmessage = {};
122 } // namespace expressions
124 BOOST_LOG_CLOSE_NAMESPACE // namespace log
128 #include <boost/log/detail/footer.hpp>
130 #endif // BOOST_LOG_EXPRESSIONS_MESSAGE_HPP_INCLUDED_