#include "StreamRegistry.hh"
#include "../Exception.hh"
#include "TimeSource.hh"
+#include "../Console/LazyDirectory.hh"
//#include "Target.mpp"
///////////////////////////////hh.p////////////////////////////////////////
namespace detail { class TargetRegistry; }
namespace detail { class AreaBase; }
+ namespace detail { struct LogParameters; }
/** \brief Logging target base class
# endif
RoutingEntry();
- bool operator==(RoutingEntry const & other);
+ bool operator==(RoutingEntry const & other) const;
private:
RoutingEntry(detail::StreamBase const * stream, detail::AreaBase const * area,
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();
///@}
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
+
+ senf::console::ScopedDirectory<> & consoleDir(); ///< Get console/config directory
+
private:
void route(detail::StreamBase const * stream, detail::AreaBase const * area,
unsigned level, action_t action, int index);
void write(time_type timestamp, detail::StreamBase const & stream,
detail::AreaBase const & area, unsigned level, std::string const & message);
+ void consoleList(std::ostream & os);
+ void consoleRoute(int index, detail::LogParameters const & pm, action_t action);
+ void consoleUnroute(detail::LogParameters const & pm, action_t action);
+
# ifdef DOXYGEN
protected:
# endif
RIB rib_;
+ console::LazyDirectory consoleDir_;
+
friend class detail::AreaBase;
friend class detail::TargetRegistry;
};