4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer NETwork research (NET)
6 // Stefan Bund <g0dil@berlios.de>
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.
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.
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.
24 \brief Target inline template implementation */
26 //#include "Target.ih"
31 #define prefix_ inline
32 ///////////////////////////////cti.p///////////////////////////////////////
34 ///////////////////////////////////////////////////////////////////////////
37 // senf::log::Target::route
39 template <class Stream>
40 prefix_ void senf::log::Target::route(action_t action, int index)
42 route(&Stream::instance(), 0, NONE::value, action, index);
45 template <class Stream, class Level>
46 prefix_ void senf::log::Target::
47 route(action_t action, int index,
48 typename boost::enable_if< boost::is_convertible<Level*, detail::LevelBase *> >::type *)
50 route(&Stream::instance(), 0, Level::value, action, index);
53 template <class Stream, class Area>
54 prefix_ void senf::log::Target::
55 route(action_t action, int index,
56 typename boost::enable_if< boost::is_convertible<Area*, detail::AreaBase *> >::type *)
58 route(&Stream::instance(), &Area::instance(), NONE::value, action, index);
61 template <class Stream, class AreaClass>
62 prefix_ void senf::log::Target::
63 route(action_t action, int index,
64 typename boost::enable_if< boost::is_convertible<typename AreaClass::SENFLogArea *, detail::AreaBase *> >::type *)
66 route(&Stream::instance(), &AreaClass::SENFLogArea::instance(), NONE::value, action, index);
69 template <class Stream, class Area, class Level>
70 prefix_ void senf::log::Target::
71 route(action_t action, int index,
72 typename boost::enable_if< boost::is_convertible<Area *, detail::AreaBase *> >::type *)
74 route(&Stream::instance(), &Area::instance(), Level::value, action, index);
77 template <class Stream, class AreaClass, class Level>
78 prefix_ void senf::log::Target::
79 route(action_t action, int index,
80 typename boost::enable_if< boost::is_convertible<typename AreaClass::SENFLogArea *, detail::AreaBase *> >::type *)
82 route(&Stream::instance(), &AreaClass::SENFLogArea::instance(), Level::value, action, index);
85 // senf::log::target::ununroute
87 template <class Stream>
88 prefix_ void senf::log::Target::unroute(action_t action)
90 unroute(&Stream::instance(), 0, NONE::value, action);
93 template <class Stream, class Level>
94 prefix_ void senf::log::Target::
95 unroute(action_t action,
96 typename boost::enable_if< boost::is_convertible<Level*, detail::LevelBase *> >::type *)
98 unroute(&Stream::instance(), 0, Level::value, action);
101 template <class Stream, class Area>
102 prefix_ void senf::log::Target::
103 unroute(action_t action,
104 typename boost::enable_if< boost::is_convertible<Area*, detail::AreaBase *> >::type *)
106 unroute(&Stream::instance(), &Area::instance(), NONE::value, action);
109 template <class Stream, class AreaClass>
110 prefix_ void senf::log::Target::
111 unroute(action_t action,
112 typename boost::enable_if< boost::is_convertible<typename AreaClass::SENFLogArea *, detail::AreaBase *> >::type *)
114 unroute(&Stream::instance(), &AreaClass::SENFLogArea::instance(), NONE::value, action);
117 template <class Stream, class Area, class Level>
118 prefix_ void senf::log::Target::
119 unroute(action_t action,
120 typename boost::enable_if< boost::is_convertible<Area *, detail::AreaBase *> >::type *)
122 unroute(&Stream::instance(), &Area::instance(), Level::value, action);
125 template <class Stream, class AreaClass, class Level>
126 prefix_ void senf::log::Target::
127 unroute(action_t action,
128 typename boost::enable_if< boost::is_convertible<typename AreaClass::SENFLogArea *, detail::AreaBase *> >::type *)
130 unroute(&Stream::instance(), &AreaClass::SENFLogArea::instance(), Level::value, action);
133 ///////////////////////////////////////////////////////////////////////////
134 // namespace senf::log members
136 template <class Stream, class Area, class Level>
137 prefix_ void senf::log::write(std::string msg)
139 TargetRegistry::instance().write(Stream::instance(), Area::instance(), Level::value, msg);
142 ///////////////////////////////cti.e///////////////////////////////////////
149 // comment-column: 40
150 // c-file-style: "senf"
151 // indent-tabs-mode: nil
152 // ispell-local-dictionary: "american"
153 // compile-command: "scons -u test"