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 template <class Stream>
38 prefix_ void senf::log::Target::route(action_t action, int index)
40 route(&Stream::instance(), 0, NONE::value, action, index);
43 template <class Stream, class Arg>
44 prefix_ void senf::log::Target::route(action_t action, int index)
46 route<Arg>(&Stream::instance(), static_cast<Arg*>(0), action, index);
49 template <class Stream, class Area, class Level>
50 prefix_ void senf::log::Target::route(action_t action, int index)
52 route(&Stream::instance(), &Area::instance(), Level::value, action, index);
55 template <class Stream>
56 prefix_ void senf::log::Target::unroute(action_t action)
58 unroute(&Stream::instance(), 0, NONE::value, action);
61 template <class Stream, class Arg>
62 prefix_ void senf::log::Target::unroute(action_t action)
64 unroute<Arg>(&Stream::instance(), static_cast<Arg*>(0), action);
67 template <class Stream, class Area, class Level>
68 prefix_ void senf::log::Target::unroute(action_t action)
70 unroute(&Stream::instance(), &Area::instance(), Level::value, action);
73 ////////////////////////////////////////
77 prefix_ void senf::log::Target::route(detail::StreamBase const * stream,
78 detail::AreaBase const *, action_t action, int index)
80 route(stream, &Area::instance(), NONE::value, action, index);
83 template <class Level>
84 prefix_ void senf::log::Target::route(detail::StreamBase const * stream,
85 detail::LevelBase const *, action_t action, int index)
87 route(stream, 0, Level::value, action, index);
91 prefix_ void senf::log::Target::unroute(detail::StreamBase const * stream,
92 detail::AreaBase const *, action_t action)
94 unroute(stream, &Area::instance(), NONE::value, action);
97 template <class Level>
98 prefix_ void senf::log::Target::unroute(detail::StreamBase const * stream,
99 detail::LevelBase const *, action_t action)
101 unroute(stream, 0, Level::value, action);
104 ///////////////////////////////////////////////////////////////////////////
105 // namespace senf::log members
107 template <class Stream, class Area, class Level>
108 prefix_ void senf::log::write(std::string msg)
110 TargetRegistry::instance().write(Stream::instance(), Area::instance(), Level::value, msg);
113 ///////////////////////////////cti.e///////////////////////////////////////
120 // comment-column: 40
121 // c-file-style: "senf"
122 // indent-tabs-mode: nil
123 // ispell-local-dictionary: "american"
124 // compile-command: "scons -u test"