Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:24

0001 /*
0002  *          Copyright Andrey Semashev 2007 - 2015.
0003  * Distributed under the Boost Software License, Version 1.0.
0004  *    (See accompanying file LICENSE_1_0.txt or copy at
0005  *          http://www.boost.org/LICENSE_1_0.txt)
0006  */
0007 /*!
0008  * \file   message.hpp
0009  * \author Andrey Semashev
0010  * \date   13.07.2012
0011  *
0012  * The header contains log message keyword declaration.
0013  */
0014 
0015 #ifndef BOOST_LOG_EXPRESSIONS_MESSAGE_HPP_INCLUDED_
0016 #define BOOST_LOG_EXPRESSIONS_MESSAGE_HPP_INCLUDED_
0017 
0018 #include <string>
0019 #include <boost/mpl/vector.hpp>
0020 #include <boost/log/detail/config.hpp>
0021 #include <boost/log/detail/default_attribute_names.hpp>
0022 #include <boost/log/expressions/keyword.hpp>
0023 #include <boost/log/expressions/is_keyword_descriptor.hpp>
0024 #include <boost/log/attributes/attribute_name.hpp>
0025 #include <boost/log/detail/header.hpp>
0026 
0027 #ifdef BOOST_HAS_PRAGMA_ONCE
0028 #pragma once
0029 #endif
0030 
0031 namespace boost {
0032 
0033 BOOST_LOG_OPEN_NAMESPACE
0034 
0035 namespace expressions {
0036 
0037 namespace tag {
0038 
0039 /*!
0040  * Generic log message attribute descriptor.
0041  */
0042 struct message :
0043     public keyword_descriptor
0044 {
0045     // The attribute value type here is not essential since message attributes are not intended to be created via the keyword
0046     typedef void attribute_type;
0047 
0048 #if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T)
0049     typedef mpl::vector2< std::string, std::wstring > value_type;
0050 #elif defined(BOOST_LOG_USE_CHAR)
0051     typedef std::string value_type;
0052 #elif defined(BOOST_LOG_USE_WCHAR_T)
0053     typedef std::wstring value_type;
0054 #endif
0055 
0056     static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); }
0057 };
0058 
0059 #if defined(BOOST_LOG_USE_CHAR)
0060 /*!
0061  * Narrow character log message attribute descriptor.
0062  */
0063 struct smessage :
0064     public keyword_descriptor
0065 {
0066     // The attribute value type here is not essential since message attributes are not intended to be created via the keyword
0067     typedef void attribute_type;
0068     typedef std::string value_type;
0069 
0070     static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); }
0071 };
0072 #endif
0073 
0074 #if defined(BOOST_LOG_USE_WCHAR_T)
0075 /*!
0076  * Wide character log message attribute descriptor.
0077  */
0078 struct wmessage :
0079     public keyword_descriptor
0080 {
0081     // The attribute value type here is not essential since message attributes are not intended to be created via the keyword
0082     typedef void attribute_type;
0083     typedef std::wstring value_type;
0084 
0085     static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); }
0086 };
0087 #endif
0088 
0089 } // namespace tag
0090 
0091 /*!
0092  * Generic message keyword type.
0093  */
0094 typedef attribute_keyword< tag::message > message_type;
0095 /*!
0096  * Generic message keyword.
0097  */
0098 BOOST_INLINE_VARIABLE const message_type message = {};
0099 
0100 #if defined(BOOST_LOG_USE_CHAR)
0101 /*!
0102  * Narrow message keyword type.
0103  */
0104 typedef attribute_keyword< tag::smessage > smessage_type;
0105 /*!
0106  * Narrow message keyword.
0107  */
0108 BOOST_INLINE_VARIABLE const smessage_type smessage = {};
0109 #endif
0110 
0111 #if defined(BOOST_LOG_USE_WCHAR_T)
0112 /*!
0113  * Wide message keyword type.
0114  */
0115 typedef attribute_keyword< tag::wmessage > wmessage_type;
0116 /*!
0117  * Wide message keyword.
0118  */
0119 BOOST_INLINE_VARIABLE const wmessage_type wmessage = {};
0120 #endif
0121 
0122 } // namespace expressions
0123 
0124 BOOST_LOG_CLOSE_NAMESPACE // namespace log
0125 
0126 } // namespace boost
0127 
0128 #include <boost/log/detail/footer.hpp>
0129 
0130 #endif // BOOST_LOG_EXPRESSIONS_MESSAGE_HPP_INCLUDED_