X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FTarget.ih;h=a0838719b46757d5f7f93247aa1e9af738c34bc7;hb=4225875220d88a3a1c2b89a7ddae7ac864daa98d;hp=d11daf0e984ae38119b4d80e1e782ef59b72e452;hpb=1b1d76302a5d61e918ef71f1c8e11f80ac1262e2;p=senf.git diff --git a/Utils/Logger/Target.ih b/Utils/Logger/Target.ih index d11daf0..a083871 100644 --- a/Utils/Logger/Target.ih +++ b/Utils/Logger/Target.ih @@ -23,12 +23,13 @@ /** \file \brief Target internal header */ -#ifndef IH_Target_ -#define IH_Target_ 1 +#ifndef IH_SENF_Utils_Logger_Target_ +#define IH_SENF_Utils_Logger_Target_ 1 // Custom includes #include -#include +#include +#include ///////////////////////////////ih.p//////////////////////////////////////// @@ -44,9 +45,7 @@ namespace detail { using senf::singleton::instance; void write(StreamBase const & stream, AreaBase const & area, unsigned level, - std::string msg); - - void timeSource(std::auto_ptr source); + std::string const & msg); void routed(); bool fallbackRouting(); @@ -59,7 +58,6 @@ namespace detail { typedef std::set Targets; Targets targets_; - boost::scoped_ptr timeSource_; bool fallbackRouting_; @@ -69,7 +67,12 @@ namespace detail { /** \brief Internal: Write log message */ template - void write(std::string msg); + void write(std::string const & msg); + +#ifndef DOXYGEN + + // This code takes the routing target template arguments in any order and sorts them + // by type (Stream, Area and Level). senf::mpl::rv<0u> RouteParameterCheck_(...); senf::mpl::rv<1u> RouteParameterCheck_(StreamBase *); @@ -77,8 +80,10 @@ namespace detail { template senf::mpl::rv<3u> RouteParameterCheck_(T*, typename T::SENFLogArea * = 0); senf::mpl::rv<4u> RouteParameterCheck_(LevelBase *); + // For g++ 4.0 (at least) we need to provide the fully scoped name for this default value. + // no idea why. It works without the scope in 4.1 template < class T, class A2, class A1, - unsigned type = SENF_MPL_RV( RouteParameterCheck_(static_cast(0)) ) > + unsigned type = SENF_MPL_RV( senf::log::detail::RouteParameterCheck_(static_cast(0)) ) > struct RouteParameters {}; @@ -103,6 +108,8 @@ namespace detail { struct RouteParameters : public RouteParameters { + typedef RouteParameters base; + BOOST_STATIC_ASSERT(( boost::is_same::value )); typedef T Stream; }; @@ -110,6 +117,8 @@ namespace detail { struct RouteParameters : public RouteParameters { + typedef RouteParameters base; + BOOST_STATIC_ASSERT(( boost::is_same::value )); typedef T Area; }; @@ -117,6 +126,8 @@ namespace detail { struct RouteParameters : public RouteParameters { + typedef RouteParameters base; + BOOST_STATIC_ASSERT(( boost::is_same::value )); typedef typename T::SENFLogArea Area; }; @@ -124,6 +135,8 @@ namespace detail { struct RouteParameters : public RouteParameters { + typedef RouteParameters base; + BOOST_STATIC_ASSERT(( boost::is_same::value )); typedef T Level; }; @@ -139,6 +152,8 @@ namespace detail { static RV * value() { return 0; } }; +#endif + }}} ///////////////////////////////ih.e////////////////////////////////////////