Boost C++ Libraries

PrevUpHomeNext

Class template fmt_if

boost::log::formatters::fmt_if — Conditional 'if' formatter.

Synopsis

// In header: <boost/log/formatters/if.hpp>

template<typename FilterT, typename FormatterT> 
class fmt_if : public basic_formatter< FormatterT::char_type, fmt_if< FilterT, FormatterT > >
{
public:
  // types
  typedef base_type::string_type  string_type;   // String type. 
  typedef base_type::ostream_type ostream_type;  // Stream type. 
  typedef base_type::record_type  record_type;   // Log record type. 

  // construct/copy/destruct
  fmt_if(FilterT const &, FormatterT const &);

  // public member functions
  void operator()(ostream_type &, record_type const &) const;

  // public data members
  implementation_defined else_;
};

Description

fmt_if public construct/copy/destruct

  1. fmt_if(FilterT const & flt, FormatterT const & fmt);

    Constructor

    Parameters:
    flt

    The condition filter

    fmt

    The formatter that gets invoked if flt returns true

fmt_if public member functions

  1. void operator()(ostream_type & strm, record_type const & record) const;

    Formatting operator. Applies the filter to the log record. If the filter returns true passes the received arguments to the aggregated formatter. Otherwise does nothing.

    Parameters:
    record

    A logging record

    strm

    A reference to the stream, where the final text of the logging record is composed

fmt_if public public data members

  1. implementation_defined else_;

    Else-formatter generation object


PrevUpHomeNext