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 message.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 13.07.2012 Chris@16: * Chris@16: * The header contains log message keyword declaration. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_EXPRESSIONS_MESSAGE_HPP_INCLUDED_ Chris@16: #define BOOST_LOG_EXPRESSIONS_MESSAGE_HPP_INCLUDED_ Chris@16: Chris@16: #include Chris@16: #include 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: namespace expressions { Chris@16: Chris@16: namespace tag { Chris@16: Chris@16: /*! Chris@16: * Generic log message attribute descriptor. Chris@16: */ Chris@16: struct message : Chris@16: public keyword_descriptor Chris@16: { Chris@16: // The attribute value type here is not essential since message attributes are not intended to be created via the keyword Chris@16: typedef void attribute_type; Chris@16: Chris@16: #if defined(BOOST_LOG_USE_CHAR) && defined(BOOST_LOG_USE_WCHAR_T) Chris@16: typedef mpl::vector2< std::string, std::wstring > value_type; Chris@16: #elif defined(BOOST_LOG_USE_CHAR) Chris@16: typedef std::string value_type; Chris@16: #elif defined(BOOST_LOG_USE_WCHAR_T) Chris@16: typedef std::wstring value_type; Chris@16: #endif Chris@16: Chris@16: static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); } Chris@16: }; Chris@16: Chris@16: #if defined(BOOST_LOG_USE_CHAR) Chris@16: /*! Chris@16: * Narrow character log message attribute descriptor. Chris@16: */ Chris@16: struct smessage : Chris@16: public keyword_descriptor Chris@16: { Chris@16: // The attribute value type here is not essential since message attributes are not intended to be created via the keyword Chris@16: typedef void attribute_type; Chris@16: typedef std::string value_type; Chris@16: Chris@16: static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); } Chris@16: }; Chris@16: #endif Chris@16: Chris@16: #if defined(BOOST_LOG_USE_WCHAR_T) Chris@16: /*! Chris@16: * Wide character log message attribute descriptor. Chris@16: */ Chris@16: struct wmessage : Chris@16: public keyword_descriptor Chris@16: { Chris@16: // The attribute value type here is not essential since message attributes are not intended to be created via the keyword Chris@16: typedef void attribute_type; Chris@16: typedef std::wstring value_type; Chris@16: Chris@16: static attribute_name get_name() { return boost::log::aux::default_attribute_names::message(); } Chris@16: }; Chris@16: #endif Chris@16: Chris@16: } // namespace tag Chris@16: Chris@16: /*! Chris@16: * Generic message keyword type. Chris@16: */ Chris@16: typedef attribute_keyword< tag::message > message_type; Chris@16: /*! Chris@16: * Generic message keyword. Chris@16: */ Chris@16: const message_type message = {}; Chris@16: Chris@16: #if defined(BOOST_LOG_USE_CHAR) Chris@16: /*! Chris@16: * Narrow message keyword type. Chris@16: */ Chris@16: typedef attribute_keyword< tag::smessage > smessage_type; Chris@16: /*! Chris@16: * Narrow message keyword. Chris@16: */ Chris@16: const smessage_type smessage = {}; Chris@16: #endif Chris@16: Chris@16: #if defined(BOOST_LOG_USE_WCHAR_T) Chris@16: /*! Chris@16: * Wide message keyword type. Chris@16: */ Chris@16: typedef attribute_keyword< tag::wmessage > wmessage_type; Chris@16: /*! Chris@16: * Wide message keyword. Chris@16: */ Chris@16: const wmessage_type wmessage = {}; Chris@16: #endif Chris@16: Chris@16: } // namespace expressions 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_EXPRESSIONS_MESSAGE_HPP_INCLUDED_