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)
8 * \file standard_types.hpp
9 * \author Andrey Semashev
12 * The header contains definition of standard types supported by the library by default.
15 #ifndef BOOST_LOG_STANDARD_TYPES_HPP_INCLUDED_
16 #define BOOST_LOG_STANDARD_TYPES_HPP_INCLUDED_
19 #include <boost/mpl/vector.hpp>
20 #include <boost/mpl/vector/vector30.hpp> // needed to use mpl::vector sizes greater than 20 even when the default BOOST_MPL_LIMIT_VECTOR_SIZE is not set
21 #include <boost/preprocessor/cat.hpp>
22 #include <boost/preprocessor/seq/enum.hpp>
23 #include <boost/preprocessor/seq/size.hpp>
24 #include <boost/log/detail/config.hpp>
25 #include <boost/log/utility/string_literal_fwd.hpp>
26 #include <boost/log/detail/header.hpp>
28 #ifdef BOOST_HAS_PRAGMA_ONCE
34 BOOST_LOG_OPEN_NAMESPACE
36 #if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
37 #define BOOST_LOG_AUX_STANDARD_TYPE_WCHAR_T() (wchar_t)
39 #define BOOST_LOG_AUX_STANDARD_TYPE_WCHAR_T()
42 #if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_LOG_NO_CXX11_CODECVT_FACETS)
43 #define BOOST_LOG_AUX_STANDARD_TYPE_CHAR16_T() (char16_t)
45 #define BOOST_LOG_AUX_STANDARD_TYPE_CHAR16_T()
48 #if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_LOG_NO_CXX11_CODECVT_FACETS)
49 #define BOOST_LOG_AUX_STANDARD_TYPE_CHAR32_T() (char32_t)
51 #define BOOST_LOG_AUX_STANDARD_TYPE_CHAR32_T()
54 //! Boost.Preprocessor sequence of character types
55 #define BOOST_LOG_STANDARD_CHAR_TYPES()\
56 (char)BOOST_LOG_AUX_STANDARD_TYPE_WCHAR_T()BOOST_LOG_AUX_STANDARD_TYPE_CHAR16_T()BOOST_LOG_AUX_STANDARD_TYPE_CHAR32_T()
58 #if defined(BOOST_HAS_LONG_LONG)
59 #define BOOST_LOG_AUX_STANDARD_LONG_LONG_TYPES() (long long)(unsigned long long)
61 #define BOOST_LOG_AUX_STANDARD_LONG_LONG_TYPES()
64 //! Boost.Preprocessor sequence of integral types
65 #define BOOST_LOG_STANDARD_INTEGRAL_TYPES()\
66 (bool)(signed char)(unsigned char)(short)(unsigned short)(int)(unsigned int)(long)(unsigned long)BOOST_LOG_AUX_STANDARD_LONG_LONG_TYPES()\
67 BOOST_LOG_STANDARD_CHAR_TYPES()
69 //! Boost.Preprocessor sequence of floating point types
70 #define BOOST_LOG_STANDARD_FLOATING_POINT_TYPES()\
71 (float)(double)(long double)
73 //! Boost.Preprocessor sequence of arithmetic types
74 #define BOOST_LOG_STANDARD_ARITHMETIC_TYPES()\
75 BOOST_LOG_STANDARD_INTEGRAL_TYPES()BOOST_LOG_STANDARD_FLOATING_POINT_TYPES()
77 #if defined(BOOST_LOG_USE_CHAR)
78 #define BOOST_LOG_AUX_STANDARD_STRING_TYPES() (std::string)(boost::log::string_literal)
80 #define BOOST_LOG_AUX_STANDARD_STRING_TYPES()
83 #if defined(BOOST_LOG_USE_WCHAR_T)
84 #define BOOST_LOG_AUX_STANDARD_WSTRING_TYPES() (std::wstring)(boost::log::wstring_literal)
86 #define BOOST_LOG_AUX_STANDARD_WSTRING_TYPES()
89 //! Boost.Preprocessor sequence of string types
90 #define BOOST_LOG_STANDARD_STRING_TYPES()\
91 BOOST_LOG_AUX_STANDARD_STRING_TYPES()BOOST_LOG_AUX_STANDARD_WSTRING_TYPES()
93 //! Boost.Preprocessor sequence of the default attribute value types supported by the library
94 #define BOOST_LOG_DEFAULT_ATTRIBUTE_VALUE_TYPES()\
95 BOOST_LOG_STANDARD_ARITHMETIC_TYPES()BOOST_LOG_STANDARD_STRING_TYPES()
99 * An MPL-sequence of integral types of attributes, supported by default
102 BOOST_PP_SEQ_ENUM(BOOST_LOG_STANDARD_INTEGRAL_TYPES())
106 * An MPL-sequence of FP types of attributes, supported by default
109 BOOST_PP_SEQ_ENUM(BOOST_LOG_STANDARD_FLOATING_POINT_TYPES())
110 > floating_point_types;
113 * An MPL-sequence of all numeric types of attributes, supported by default
116 BOOST_PP_SEQ_ENUM(BOOST_LOG_STANDARD_ARITHMETIC_TYPES())
120 typedef arithmetic_types numeric_types;
123 * An MPL-sequence of string types of attributes, supported by default
126 BOOST_PP_SEQ_ENUM(BOOST_LOG_STANDARD_STRING_TYPES())
130 * An MPL-sequence of all attribute value types that are supported by the library by default.
132 typedef BOOST_PP_CAT(mpl::vector, BOOST_PP_SEQ_SIZE(BOOST_LOG_DEFAULT_ATTRIBUTE_VALUE_TYPES()))<
133 BOOST_PP_SEQ_ENUM(BOOST_LOG_DEFAULT_ATTRIBUTE_VALUE_TYPES())
134 > default_attribute_value_types;
137 typedef default_attribute_value_types default_attribute_types;
139 BOOST_LOG_CLOSE_NAMESPACE // namespace log
143 #include <boost/log/detail/footer.hpp>
145 #endif // BOOST_LOG_STANDARD_TYPES_HPP_INCLUDED_