e811cb1816cbbe9a84afbc078ded6ab7aee7de26
[senf.git] / Utils / Logger / Parameters.hh
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 Parameters public header */
25
26 #ifndef HH_Parameters_
27 #define HH_Parameters_ 1
28
29 // Custom includes
30 #include "Area.hh"
31
32 //#include "Parameters.mpp"
33 #include "Parameters.ih"
34 ///////////////////////////////hh.p////////////////////////////////////////
35
36 /** \brief Set scope default log stream
37     \hideinitializer
38  */
39 #define SENF_LOG_DEFAULT_STREAM(stream) typedef stream SENFLogDefaultStream
40
41 /** \brief Set scope default log area
42     \hideinitializer
43  */
44 #define SENF_LOG_DEFAULT_AREA(area) typedef area SENFLogDefaultArea
45
46 /** \brief Set scope default log level
47     \hideinitializer
48  */
49 #define SENF_LOG_DEFAULT_LEVEL(level) typedef level SENFLogDefaultLevel
50
51 /** \brief Define log parameter alias
52
53     Defines a new parameter alias named \a alias as an alias for the parameters in \a args. The
54     alias is defined as a symbol in the current scope.
55
56     \hideinitializer
57  */
58 #define SENF_LOG_DEF_ALIAS(alias,args)                                                            \
59     struct alias : public senf::log::detail::AliasBase                                            \
60     {                                                                                             \
61         template <class Base>                                                                     \
62         struct apply                                                                              \
63         {                                                                                         \
64             typedef typename SENF_LOG_MERGE_PARAMETERS_I(Base,args) type;                         \
65         };                                                                                        \
66     }
67
68 #define SENF_LOG_CLASS_AREA()                                                                     \
69     SENF_LOG_DEF_AREA_I(SenfLogArea,                                                              \
70                         std::string v_name() const                                                \
71                             { std::string s (fullName()); return std::string(s,s.size()-13); });  \
72     SENF_LOG_DEFAULT_AREA(SenfLogArea)
73
74
75 ///////////////////////////////hh.e////////////////////////////////////////
76 //#include "Parameters.cci"
77 //#include "Parameters.ct"
78 //#include "Parameters.cti"
79 #endif
80
81 \f
82 // Local Variables:
83 // mode: c++
84 // fill-column: 100
85 // comment-column: 40
86 // c-file-style: "senf"
87 // indent-tabs-mode: nil
88 // ispell-local-dictionary: "american"
89 // compile-command: "scons -u test"
90 // End: