Boost C++ Libraries

PrevUpHomeNext

Class template fmt_wrapper

boost::log::formatters::fmt_wrapper — Formatter wrapper to output objects into streams.

Synopsis

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

template<typename CharT, typename T> 
class fmt_wrapper : public basic_formatter< CharT, fmt_wrapper< CharT, T > > {
public:
  // types
  typedef base_type::ostream_type ostream_type;  // Stream type. 
  typedef base_type::record_type  record_type;   // Log record type. 

  // construct/copy/destruct
  explicit fmt_wrapper(T const &);

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

Description

The formatter aggregates some object and provides formatter interface. Upon formatting the wrapper puts the wrapped object into the formatting stream.

fmt_wrapper public construct/copy/destruct

  1. explicit fmt_wrapper(T const & obj);

    Constructor

    Parameters:
    obj

    Object to be aggregated

fmt_wrapper public member functions

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

    Formatting operator. Puts the aggregated object into the strm stream.

    Parameters:
    strm

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


PrevUpHomeNext