X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FConfig.ih;h=a850fdea4f848de373e15ba193ffde9078736130;hb=5443435c4c2b6e4386c5334b5b8358273f2bae93;hp=1ead3fcb3153940283fce44e30bad28bd5c25e27;hpb=2400f5c9d91e715773ed965fb92da1b6a54903e5;p=senf.git diff --git a/Utils/Logger/Config.ih b/Utils/Logger/Config.ih index 1ead3fc..a850fde 100644 --- a/Utils/Logger/Config.ih +++ b/Utils/Logger/Config.ih @@ -23,8 +23,8 @@ /** \file \brief Config internal header */ -#ifndef IH_Config_ -#define IH_Config_ 1 +#ifndef IH_SENF_Utils_Logger_Config_ +#define IH_SENF_Utils_Logger_Config_ 1 // Custom includes #include @@ -33,6 +33,7 @@ #include #include #include +#include #include "../preprocessor.hh" ///////////////////////////////ih.p//////////////////////////////////////// @@ -44,25 +45,45 @@ namespace detail { struct na {}; /// Internal: Compile time configuration for given \a Stream and \a Area - template + template struct Config { - typedef typename Config::compileLimit compileLimit; + typedef typename Config::compileLimit compileLimit; }; # ifndef DOXYGEN - template - struct Config + template + struct Config { - typedef typename Stream::compileLimit compileLimit; + 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_SEQ_TO_NAME_(s,state,elem) state::elem +#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) @@ -76,7 +97,7 @@ namespace detail { BOOST_PP_SEQ_POP_BACK(seq) ) #define SENF_LOG_PREDECL_short(seq) \ - class SENF_PP_SEQ_BACK(seq); + BOOST_PP_IF( SENF_LOG_IS_NA( SENF_PP_SEQ_BACK(seq) ), ; , class SENF_PP_SEQ_BACK(seq); ) #define SENF_LOG_PREDECL(seq) \ BOOST_PP_CAT(SENF_LOG_PREDECL_, \ @@ -88,22 +109,22 @@ namespace detail { SENF_LOG_PREDECL(stream) \ SENF_LOG_PREDECL(area) \ namespace senf { namespace log { namespace detail { \ - template <> \ + template \ struct Config< SENF_LOG_SEQ_TO_NAME(stream), \ - SENF_LOG_SEQ_TO_NAME(area) > \ + SENF_LOG_SEQ_TO_NAME(area), \ + QueryStream, \ + true > \ { typedef senf::log::level compileLimit; }; \ }}} #ifdef SENF_LOG_CONF -# define _ senf::log::detail::na # 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 -# undef _ #endif