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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Struct template formatter_factory

boost::log::formatter_factory

Synopsis

// In header: <boost/log/utility/setup/formatter_parser.hpp>

template<typename CharT> 
struct formatter_factory {
  // types
  typedef CharT                                char_type;       // Character type. 
  typedef std::basic_string< char_type >       string_type;     // String type. 
  typedef basic_formatter< char_type >         formatter_type;  // The formatter function object. 
  typedef std::map< string_type, string_type > args_map;      

  // construct/copy/destruct
  formatter_factory();
  formatter_factory(formatter_factory const &);
  formatter_factory & operator=(formatter_factory const &);
  ~formatter_factory();

  // public member functions
  virtual formatter_type 
  create_formatter(attribute_name const &, args_map const &) = 0;
};

Description

Formatter factory base interface.

formatter_factory public types

  1. typedef std::map< string_type, string_type > args_map;

    Type of the map of formatter factory arguments [argument name -> argument value]. This type of maps will be passed to formatter factories on attempt to create a formatter.

formatter_factory public construct/copy/destruct

  1. formatter_factory();

    Default constructor

  2. formatter_factory(formatter_factory const &);
  3. formatter_factory & operator=(formatter_factory const &);
  4. ~formatter_factory();

    Virtual destructor

formatter_factory public member functions

  1. virtual formatter_type 
    create_formatter(attribute_name const & name, args_map const & args) = 0;

    The function creates a formatter for the specified attribute.

    Parameters:

    args

    Formatter arguments

    name

    Attribute name


PrevUpHomeNext