// $Id$ // // Copyright (C) 2007 // Fraunhofer Institute for Open Communication Systems (FOKUS) // // The contents of this file are subject to the Fraunhofer FOKUS Public License // Version 1.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // http://senf.berlios.de/license.html // // The Fraunhofer FOKUS Public License Version 1.0 is based on, // but modifies the Mozilla Public License Version 1.1. // See the full license text for the amendments. // // Software distributed under the License is distributed on an "AS IS" basis, // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License // for the specific language governing rights and limitations under the License. // // The Original Code is Fraunhofer FOKUS code. // // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. // (registered association), Hansastraße 27 c, 80686 Munich, Germany. // All Rights Reserved. // // Contributor(s): // Stefan Bund /** \file \brief Config internal header */ #ifndef IH_SENF_Utils_Logger_Config_ #define IH_SENF_Utils_Logger_Config_ 1 // Custom includes #include #include #include #include #include #include #include #include //-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { namespace log { namespace detail { struct na {}; /// Internal: Compile time configuration for given \a Stream and \a Area template struct Config { typedef typename Config::compileLimit compileLimit; }; # ifndef DOXYGEN template struct Config { typedef typename Config::compileLimit compileLimit; }; template struct Config { typedef typename Config::compileLimit compileLimit; }; template struct Config { typedef typename QueryStream::compileLimit compileLimit; }; # endif }}} #define SENF_LOG_CHECK_NA_ #define SENF_LOG_CAT(a,b) SENF_LOG_CAT_I(a,b) #define SENF_LOG_CAT_I(a,b) a ## b #define SENF_LOG_IS_NA(elt) BOOST_PP_IS_EMPTY( SENF_LOG_CAT(SENF_LOG_CHECK_NA, elt) ) #define SENF_LOG_SEQ_TO_NAME_(s,state,elem) \ BOOST_PP_IF( SENF_LOG_IS_NA(elem), senf::log::detail::na, state::elem ) #define SENF_LOG_SEQ_TO_NAME(seq) \ BOOST_PP_SEQ_FOLD_LEFT(SENF_LOG_SEQ_TO_NAME_, , seq) #define SENF_LOG_PREDECL_(s, state, elem) \ namespace elem { state } #define SENF_LOG_PREDECL_long(seq) \ BOOST_PP_SEQ_FOLD_RIGHT( SENF_LOG_PREDECL_, \ struct SENF_PP_SEQ_BACK(seq);, \ BOOST_PP_SEQ_POP_BACK(seq) ) #define SENF_LOG_PREDECL_short(seq) \ BOOST_PP_IF( SENF_LOG_IS_NA( SENF_PP_SEQ_BACK(seq) ), ; , struct SENF_PP_SEQ_BACK(seq); ) #define SENF_LOG_PREDECL(seq) \ BOOST_PP_CAT(SENF_LOG_PREDECL_, \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)),long,short))(seq) #define SENF_LOG_NIL(x) #define SENF_LOG_CONF_DEFINE(stream, area, level) \ SENF_LOG_PREDECL(stream) \ SENF_LOG_PREDECL(area) \ namespace senf { namespace log { namespace detail { \ template \ struct Config< SENF_LOG_SEQ_TO_NAME(stream), \ SENF_LOG_SEQ_TO_NAME(area), \ QueryStream, \ true > \ { typedef senf::log::level compileLimit; }; \ }}} #ifdef SENF_LOG_CONF # define SLC_elt(r, data, elt) \ SENF_LOG_CONF_DEFINE elt BOOST_PP_SEQ_FOR_EACH(SLC_elt, none, SENF_LOG_CONF) # undef SLC_elt #endif //-///////////////////////////////////////////////////////////////////////////////////////////////// #endif // Local Variables: // mode: c++ // fill-column: 100 // comment-column: 40 // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" // compile-command: "scons -u test" // End: