Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

StreamRegistry.hh

Go to the documentation of this file.
00001 // $Id: StreamRegistry.hh 1757 2011-01-06 16:52:09Z tho $
00002 //
00003 // Copyright (C) 2007
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Stefan Bund <g0dil@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #ifndef HH_SENF_Utils_Logger_StreamRegistry_
00027 #define HH_SENF_Utils_Logger_StreamRegistry_ 1
00028 
00029 // Custom includes
00030 #include <map>
00031 #include <ext/functional>
00032 #include <boost/iterator/transform_iterator.hpp>
00033 #include <senf/Utils/singleton.hh>
00034 
00035 //#include "StreamRegistry.mpp"
00036 #include "StreamRegistry.ih"
00037 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00038 
00039 namespace senf {
00040 namespace log {
00041 
00042     namespace detail { struct StreamBase; }
00043 
00052     class StreamRegistry
00053         : public senf::singleton<StreamRegistry>
00054     {
00055         typedef std::map<std::string, detail::StreamBase const *> Registry;
00056 
00057     public:
00058         typedef boost::transform_iterator< ::__gnu_cxx::select1st<Registry::value_type>,
00059                                            Registry::const_iterator > iterator;
00060 
00061 #       ifdef DOXYGEN
00062         // Hmm ... doxygen does not understand 'using declarations' ...
00064         static AreaRegistry & instance();
00065 #       endif
00066 
00067         using senf::singleton<StreamRegistry>::instance;
00068 
00069         iterator begin();
00070         iterator end();
00071 
00072         detail::StreamBase const * lookup(std::string const & name);
00073 
00074     private:
00075         StreamRegistry();
00076 
00077         void registerStream(detail::StreamBase const & stream);
00078 
00079         Registry registry_;
00080 
00081         friend class senf::singleton<StreamRegistry>;
00082         friend class detail::StreamBase;
00083         friend class Target;
00084     };
00085 
00086 }}
00087 
00088 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00089 #include "StreamRegistry.cci"
00090 //#include "StreamRegistry.ct"
00091 //#include "StreamRegistry.cti"
00092 #endif
00093 
00094 
00095 // Local Variables:
00096 // mode: c++
00097 // fill-column: 100
00098 // comment-column: 40
00099 // c-file-style: "senf"
00100 // indent-tabs-mode: nil
00101 // ispell-local-dictionary: "american"
00102 // compile-command: "scons -u test"
00103 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research