X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FTarget.cti;h=0f7e287ff931018c53e0a975ead3e4337104bdd7;hb=82ad2ed94c12c3e53097fef92978de8c28239fab;hp=a61c70330322cc0c855507c2a329530dde3ea5c2;hpb=f6f670f2dbc82b77db29df6cd452f2b351b9662a;p=senf.git diff --git a/Utils/Logger/Target.cti b/Utils/Logger/Target.cti index a61c703..0f7e287 100644 --- a/Utils/Logger/Target.cti +++ b/Utils/Logger/Target.cti @@ -23,7 +23,7 @@ /** \file \brief Target inline template implementation */ -//#include "Target.ih" +#include "Target.ih" // Custom includes #include "Levels.hh" @@ -34,50 +34,121 @@ /////////////////////////////////////////////////////////////////////////// // senf::log::Target +// senf::log::Target::route + +#ifndef DOXYGEN + template -prefix_ void senf::log::Target::route(action_t action) +prefix_ void senf::log::Target::route(action_t action, int index) +{ + route(&Stream::instance(), 0, NONE::value, action, index); +} + +template +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) +{ + route(&Stream::instance(), 0, Level::value, action, index); +} + +template +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) { - route(&Stream::instance(), 0, NONE::value, action); + route(&Stream::instance(), &Area::instance(), NONE::value, action, index); } -template -prefix_ void senf::log::Target::route(action_t action) +template +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) { - route(&Stream::instance(), static_cast(0), action); + route(&Stream::instance(), &AreaClass::SENFLogArea::instance(), NONE::value, action, index); } template -prefix_ void senf::log::Target::route(action_t action) +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) { - route(&Stream::instance(), &Area::instance(), Level::value, action); + route(&Stream::instance(), &Area::instance(), Level::value, action, index); } -//////////////////////////////////////// -// private members +template +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) +{ + route(&Stream::instance(), &AreaClass::SENFLogArea::instance(), Level::value, action, index); +} + +// senf::log::target::ununroute + +template +prefix_ void senf::log::Target::unroute(action_t action) +{ + unroute(&Stream::instance(), 0, NONE::value, action); +} -template -prefix_ void senf::log::Target::route(detail::StreamBase const * stream, - detail::AreaBase const *, action_t action) +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) { - route(stream, &Area::instance(), NONE::value, action); + unroute(&Stream::instance(), 0, Level::value, action); } -template -prefix_ void senf::log::Target::route(detail::StreamBase const * stream, - detail::LevelBase const *, action_t action) +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) { - route(stream, 0, Level::value, action); + unroute(&Stream::instance(), &Area::instance(), NONE::value, action); } +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) +{ + unroute(&Stream::instance(), &AreaClass::SENFLogArea::instance(), NONE::value, action); +} + +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) +{ + unroute(&Stream::instance(), &Area::instance(), Level::value, action); +} + +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) +{ + unroute(&Stream::instance(), &AreaClass::SENFLogArea::instance(), Level::value, action); +} + +#endif + /////////////////////////////////////////////////////////////////////////// -// namespace senf::log members +// namespace senf::log::detail members template -prefix_ void senf::log::write(std::string msg) +prefix_ void senf::log::detail::write(std::string msg) { TargetRegistry::instance().write(Stream::instance(), Area::instance(), Level::value, msg); } +template +prefix_ void senf::log::timeSource() +{ + timeSource(std::auto_ptr(new Source())); +} + ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_