Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / Utils / Logger / StreamRegistry.hh
1 // $Id$
2 //
3 // Copyright (C) 2007
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
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 StreamRegistry public header */
25
26 #ifndef HH_SENF_Utils_Logger_StreamRegistry_
27 #define HH_SENF_Utils_Logger_StreamRegistry_ 1
28
29 // Custom includes
30 #include <map>
31 #include <functional>
32 #include <ext/functional>
33 #include <boost/iterator/transform_iterator.hpp>
34 #include "Levels.hh"
35 #include <senf/Utils/singleton.hh>
36
37 //#include "StreamRegistry.mpp"
38 #include "StreamRegistry.ih"
39 //-/////////////////////////////////////////////////////////////////////////////////////////////////
40
41 namespace senf {
42 namespace log {
43
44     namespace detail { struct StreamBase; }
45
46     /** \brief Stream registry
47
48         The stream registry keeps track of all streams defined. stream classes are defined as
49         singletons and will automatically register with this registry.
50
51         The stream registry exposes a forward sequence interface which is a sequence of the names of
52         all registered streams.
53      */
54     class StreamRegistry
55         : public senf::singleton<StreamRegistry>
56     {
57         typedef std::map<std::string, detail::StreamBase const *> Registry;
58
59     public:
60         typedef boost::transform_iterator< ::__gnu_cxx::select1st<Registry::value_type>,
61                                            Registry::const_iterator > iterator;
62
63 #       ifdef DOXYGEN
64         // Hmm ... doxygen does not understand 'using declarations' ...
65         /// Access stream registry singleton instance
66         static AreaRegistry & instance();
67 #       endif
68
69         using senf::singleton<StreamRegistry>::instance;
70
71         iterator begin();
72         iterator end();
73
74         detail::StreamBase const * lookup(std::string const & name);
75
76     private:
77         StreamRegistry();
78
79         void registerStream(detail::StreamBase const & stream);
80
81         Registry registry_;
82
83         friend class senf::singleton<StreamRegistry>;
84         friend class detail::StreamBase;
85         friend class Target;
86     };
87
88 }}
89
90 //-/////////////////////////////////////////////////////////////////////////////////////////////////
91 #include "StreamRegistry.cci"
92 //#include "StreamRegistry.ct"
93 //#include "StreamRegistry.cti"
94 #endif
95
96 \f
97 // Local Variables:
98 // mode: c++
99 // fill-column: 100
100 // comment-column: 40
101 // c-file-style: "senf"
102 // indent-tabs-mode: nil
103 // ispell-local-dictionary: "american"
104 // compile-command: "scons -u test"
105 // End: