Utils: Moved Logger into 'Logger/' submodule
[senf.git] / Utils / Logger / Config.ih
1 // $Id$
2 //
3 // Copyright (C) 2007 
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 //     Stefan Bund <g0dil@berlios.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \file
24     \brief Config internal header */
25
26 #ifndef IH_Config_
27 #define IH_Config_ 1
28
29 // Custom includes
30 #include <boost/preprocessor/expand.hpp>
31 #include <boost/preprocessor/seq/for_each.hpp>
32 #include <boost/preprocessor/seq/to_tuple.hpp>
33 #include "Defaults.hh"
34
35 ///////////////////////////////ih.p////////////////////////////////////////
36
37 namespace senf {
38 namespace log {
39 namespace detail {
40
41     template <class Stream, class Area>
42     struct Config
43     {
44         typedef typename Config<Stream,void>::compileLimit compileLimit;
45     };
46
47     template <class Stream>
48     struct Config<Stream, void>
49     {
50         typedef typename Stream::compileLimit compileLimit;
51     };
52
53 #   define SENF_LOG_CONF_DEFINE(stream, area, level)                                              \
54            template <>                                                                            \
55            struct Config<stream, area>                                                            \
56            { typedef senf::log::level compileLimit; };
57
58 #   ifdef SENF_LOG_CONF
59
60 #       define _ void
61 #       define SLC_elt(r, data, elt) \
62             BOOST_PP_EXPAND(SENF_LOG_CONF_DEFINE BOOST_PP_SEQ_TO_TUPLE(elt))
63
64         BOOST_PP_SEQ_FOR_EACH(SLC_elt, x, SENF_LOG_CONF)
65
66 #       undef SLC_elt
67 #       undef _
68
69 #   endif
70
71 }}}
72
73
74
75 ///////////////////////////////ih.e////////////////////////////////////////
76 #endif
77
78 \f
79 // Local Variables:
80 // mode: c++
81 // fill-column: 100
82 // comment-column: 40
83 // c-file-style: "senf"
84 // indent-tabs-mode: nil
85 // ispell-local-dictionary: "american"
86 // compile-command: "scons -u test"
87 // End: