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

Target.cti

Go to the documentation of this file.
00001 // $Id: Target.cti 1742 2010-11-04 14:51:56Z g0dil $
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 #include "Target.ih"
00027 
00028 // Custom includes
00029 #include "Levels.hh"
00030 
00031 #define prefix_ inline
00032 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00033 
00034 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00035 // senf::log::Target
00036 
00037 // senf::log::Target::route
00038 
00039 #ifndef DOXYGEN
00040 
00041 template <class A1>
00042 prefix_ void senf::log::Target::route(action_t action, int index)
00043 {
00044     route<A1,mpl::nil,mpl::nil>(action, index);
00045 }
00046 
00047 template <class A1, class A2>
00048 prefix_ void senf::log::Target::route(action_t action, int index)
00049 {
00050     route<A1,A2,mpl::nil>(action, index);
00051 }
00052 
00053 template <class A1, class A2, class A3>
00054 prefix_ void senf::log::Target::route(action_t action, int index)
00055 {
00056     typedef detail::RouteParameters<A1,A2,A3> Params;
00057     route( detail::InstanceP<typename Params::Stream, detail::StreamBase>::value(),
00058            detail::InstanceP<typename Params::Area, detail::AreaBase>::value(),
00059            Params::Level::value,
00060            action, index);
00061 }
00062 
00063 template <class A1>
00064 prefix_ void senf::log::Target::unroute(action_t action)
00065 {
00066     unroute<A1,mpl::nil,mpl::nil>(action);
00067 }
00068 
00069 template <class A1, class A2>
00070 prefix_ void senf::log::Target::unroute(action_t action)
00071 {
00072     unroute<A1,A2,mpl::nil>(action);
00073 }
00074 
00075 template <class A1, class A2, class A3>
00076 prefix_ void senf::log::Target::unroute(action_t action)
00077 {
00078     typedef detail::RouteParameters<A1,A2,A3> Params;
00079     unroute( detail::InstanceP<typename Params::Stream, detail::StreamBase>::value(),
00080              detail::InstanceP<typename Params::Area, detail::AreaBase>::value(),
00081              Params::Level::value,
00082              action);
00083 }
00084 
00085 #endif
00086 
00087 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00088 // namespace senf::log::detail members
00089 
00090 template <class Stream, class Area, class Level>
00091 prefix_ void senf::log::detail::write(std::string const & msg)
00092 {
00093     TargetRegistry::instance().write(Stream::instance(), Area::instance(), Level::value, msg);
00094 }
00095 
00096 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00097 #undef prefix_
00098 
00099 
00100 // Local Variables:
00101 // mode: c++
00102 // fill-column: 100
00103 // comment-column: 40
00104 // c-file-style: "senf"
00105 // indent-tabs-mode: nil
00106 // ispell-local-dictionary: "american"
00107 // compile-command: "scons -u test"
00108 // End:

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