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 for the latest Boost documentation.
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 const &) = delete;
  formatter_factory & operator=(formatter_factory const &) = delete;
  ~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(formatter_factory const &) = delete;
  2. formatter_factory & operator=(formatter_factory const &) = delete;
  3. ~formatter_factory();

    Default constructor

    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