// $Id$ // // Copyright (C) 2007 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file \brief Config internal header */ #ifndef IH_Config_ #define IH_Config_ 1 // Custom includes #include #include #include #include #include #include #include "../preprocessor.hh" ///////////////////////////////ih.p//////////////////////////////////////// namespace senf { namespace log { namespace detail { /// 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 Stream::compileLimit compileLimit; }; # endif }}} #define SENF_LOG_SEQ_TO_NAME_(s,state,elem) 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(seq) \ BOOST_PP_SEQ_FOLD_RIGHT( SENF_LOG_PREDECL_, \ class SENF_PP_SEQ_BACK(seq);, \ BOOST_PP_SEQ_POP_BACK(seq) ) #define SENF_LOG_NIL(x) #define SENF_LOG_CONF_DEFINE(stream, area, level) \ SENF_LOG_PREDECL(stream) \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(area)), \ SENF_LOG_PREDECL, \ SENF_LOG_NIL)(area) \ namespace senf { namespace log { namespace detail { \ template <> \ struct Config< SENF_LOG_SEQ_TO_NAME(stream), \ BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(area)), \ SENF_LOG_SEQ_TO_NAME(area), \ void) > \ { 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 ///////////////////////////////ih.e//////////////////////////////////////// #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: