Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class basic_sink_frontend

boost::log::sinks::basic_sink_frontend — A base class for a logging sink frontend.

Synopsis

// In header: <boost/log/sinks/basic_sink_frontend.hpp>


class basic_sink_frontend : public sink {
public:
  // types
  typedef base_type::exception_handler_type exception_handler_type;  // An exception handler type. 

  // construct/copy/destruct
  explicit basic_sink_frontend(bool);

  // public member functions
  template<typename FunT> void set_filter(FunT const &);
  void reset_filter();
  template<typename FunT> void set_exception_handler(FunT const &);
  void reset_exception_handler();
  virtual bool will_consume(attribute_value_set const &);

  // protected member functions
  mutex_type & frontend_mutex() const;
  exception_handler_type & exception_handler();
  exception_handler_type const  & exception_handler() const;
  template<typename BackendMutexT, typename BackendT> 
    void feed_record(record_view const &, BackendMutexT &, BackendT &);
  template<typename BackendMutexT, typename BackendT> 
    bool try_feed_record(record_view const &, BackendMutexT &, BackendT &);
  template<typename BackendMutexT, typename BackendT> 
    void flush_backend(BackendMutexT &, BackendT &);

  // private member functions
  template<typename BackendMutexT, typename BackendT> 
    void flush_backend_impl(BackendMutexT &, BackendT &, mpl::true_);
  template<typename BackendMutexT, typename BackendT> 
    void flush_backend_impl(BackendMutexT &, BackendT &, mpl::false_);
};

Description

basic_sink_frontend public construct/copy/destruct

  1. explicit basic_sink_frontend(bool cross_thread);
    Initializing constructor.

    Parameters:

    cross_thread

    The flag indicates whether the sink passes log records between different threads

basic_sink_frontend public member functions

  1. template<typename FunT> void set_filter(FunT const & filter);

    The method sets sink-specific filter functional object

  2. void reset_filter();

    The method resets the filter

  3. template<typename FunT> void set_exception_handler(FunT const & handler);

    The method sets an exception handler function

  4. void reset_exception_handler();

    The method resets the exception handler function

  5. virtual bool will_consume(attribute_value_set const & attrs);

    The method returns true if no filter is set or the attribute values pass the filter

    Parameters:

    attrs

    A set of attribute values of a logging record

basic_sink_frontend protected member functions

  1. mutex_type & frontend_mutex() const;
    Returns reference to the frontend mutex.
  2. exception_handler_type & exception_handler();
    Returns reference to the exception handler.
  3. exception_handler_type const  & exception_handler() const;
    Returns reference to the exception handler.
  4. template<typename BackendMutexT, typename BackendT> 
      void feed_record(record_view const & rec, BackendMutexT & backend_mutex, 
                       BackendT & backend);
    Feeds log record to the backend.
  5. template<typename BackendMutexT, typename BackendT> 
      bool try_feed_record(record_view const & rec, BackendMutexT & backend_mutex, 
                           BackendT & backend);
    Attempts to feeds log record to the backend, does not block if backend_mutex is locked.
  6. template<typename BackendMutexT, typename BackendT> 
      void flush_backend(BackendMutexT & backend_mutex, BackendT & backend);
    Flushes record buffers in the backend, if one supports it.

basic_sink_frontend private member functions

  1. template<typename BackendMutexT, typename BackendT> 
      void flush_backend_impl(BackendMutexT & backend_mutex, BackendT & backend, 
                              mpl::true_);
    Flushes record buffers in the backend (the actual implementation)
  2. template<typename BackendMutexT, typename BackendT> 
      void flush_backend_impl(BackendMutexT &, BackendT &, mpl::false_);
    Flushes record buffers in the backend (stub for backends that don't support flushing)

PrevUpHomeNext