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 custom_terminal_spec.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 29.01.2012 Chris@16: * Chris@16: * The header contains Boost.Phoenix custom terminal specialization for Boost.Log terminals. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_DETAIL_CUSTOM_TERMINAL_SPEC_HPP_INCLUDED_ Chris@16: #define BOOST_LOG_DETAIL_CUSTOM_TERMINAL_SPEC_HPP_INCLUDED_ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include // needed for terminal-related part of the grammar 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: namespace phoenix { Chris@16: Chris@16: template< typename T > Chris@16: struct is_custom_terminal< T, typename T::_is_boost_log_terminal > : Chris@16: public mpl::true_ Chris@16: { Chris@16: }; Chris@16: Chris@16: template< typename T > Chris@16: struct custom_terminal< T, typename T::_is_boost_log_terminal > Chris@16: { Chris@16: typedef custom_terminal< T, typename T::_is_boost_log_terminal > this_type; Chris@16: Chris@16: template< typename > Chris@16: struct result; Chris@16: Chris@16: template< typename ThisT, typename TermT, typename ContextT > Chris@16: struct result< ThisT(TermT, ContextT) > Chris@16: { Chris@16: typedef typename remove_cv< typename remove_reference< TermT >::type >::type term; Chris@16: typedef typename boost::result_of< const term(ContextT) >::type type; Chris@16: }; Chris@16: Chris@16: template< typename ContextT > Chris@16: typename result< const this_type(T const&, ContextT&) >::type operator() (T const& term, ContextT& ctx) const Chris@16: { Chris@16: return term(ctx); Chris@16: } Chris@16: }; Chris@16: Chris@16: } // namespace phoenix Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_LOG_DETAIL_CUSTOM_TERMINAL_SPEC_HPP_INCLUDED_