boost::logging::format_and_write::simple< msg_type > Struct Template Reference

Formats the message, and writes it to destinations - calls operator() on the formatters , and operator() on the destinations. Ignores clear_format() commands. More...

Inheritance diagram for boost::logging::format_and_write::simple< msg_type >:
[legend]

List of all members.


Detailed Description

template<class msg_type>
struct boost::logging::format_and_write::simple< msg_type >

Formats the message, and writes it to destinations - calls operator() on the formatters , and operator() on the destinations. Ignores clear_format() commands.

Parameters:
msg_type The message to pass to the formatter. This is the type that is passed to the formatter objects and to the destination objects. Thus, it needs to be convertible to the argument to be sent to the formatter objects and to the argument to be sent to the destination objects. Usually, it's the argument you pass on to your destination classes.
If you derive from destination::base, this type can be destination::base::raw_param (see below).

Example:

        typedef destination::base<const std::string &> dest_base;
        // in this case : msg_type = std::string = dest_base::raw_param
        struct write_to_cout : dest_base {
            void operator()(param msg) const {
                std::cout << msg ;
            }
        };


        typedef destination::base<const std::string &> dest_base;
        // in this case : msg_type = cache_string = dest_base::raw_param
        struct write_to_file : dest_base, ... {
            void operator()(param msg) const {
                context() << msg ;
            }
        };

The documentation for this struct was generated from the following file:

Copyright John Torjo © 2007
Have a question/ suggestion/ comment? Send me feedback