X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FTarget.hh;h=69fd1d123115c7987da35c61c92ddea75c8279c1;hb=41eff772147b6df1961d9029ba6815b553b4f81d;hp=622adf1e5762df4217c2f79af25cde42542504c6;hpb=09a763012dd7b394c8bae6ed720e681273a0e94a;p=senf.git diff --git a/Utils/Logger/Target.hh b/Utils/Logger/Target.hh index 622adf1..69fd1d1 100644 --- a/Utils/Logger/Target.hh +++ b/Utils/Logger/Target.hh @@ -36,6 +36,7 @@ #include "StreamRegistry.hh" #include "../Exception.hh" #include "TimeSource.hh" +#include "../Console/LazyDirectory.hh" //#include "Target.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -160,7 +161,7 @@ namespace log { # endif RoutingEntry(); - bool operator==(RoutingEntry const & other); + bool operator==(RoutingEntry const & other) const; private: RoutingEntry(detail::StreamBase const * stream, detail::AreaBase const * area, @@ -179,12 +180,13 @@ namespace log { public: typedef RIB::const_iterator iterator; ///< Routing table iterator + typedef RIB::size_type size_type; /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members ///@{ - Target(); + explicit Target(std::string const & name); virtual ~Target(); ///@} @@ -332,6 +334,13 @@ namespace log { iterator begin() const; ///< Iterator to beginning of routing table iterator end() const; ///< Iterator past the end of routing table + RoutingEntry const & operator[](size_type i) const; ///< Access routing entry + + size_type size() const; ///< Number of routing table entries + bool empty() const; ///< \c true, if routing table empty, \c false otherwise + + void flush(); ///< Clear routing table + private: void route(detail::StreamBase const * stream, detail::AreaBase const * area, unsigned level, action_t action, int index); @@ -343,6 +352,8 @@ namespace log { void write(time_type timestamp, detail::StreamBase const & stream, detail::AreaBase const & area, unsigned level, std::string const & message); + void consoleList(std::ostream & os); + # ifdef DOXYGEN protected: # endif @@ -374,6 +385,8 @@ namespace log { RIB rib_; + console::LazyDirectory consoleDir_; + friend class detail::AreaBase; friend class detail::TargetRegistry; };