Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template basic_custom_mapping

Boost , Chapter 1. Boost.Log v2 , Sinks

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

PrevUpHomeNext

Class template basic_custom_mapping

boost::log::sinks::basic_custom_mapping — Customizable mapping.

Synopsis

// In header: <boost/log/sinks/attribute_mapping.hpp>
template<typename MappedT, typename AttributeValueT = int> 
class basic_custom_mapping :
  public boost::log::sinks::basic_mapping< MappedT >
{
public:
  // types
  typedef AttributeValueT        attribute_value_type;  // Attribute contained value type. 
  typedef base_type::mapped_type mapped_type;           // Mapped value type. 
  // construct/copy/destruct
  explicit basic_custom_mapping(attribute_name const &, mapped_type const &);
  // public member functions
  mapped_type operator()(record_view const &) const;
  implementation_defined operator[](attribute_value_type const &);
};

Description

Класс позволяет настроить настраиваемое отображение между атрибутом и местными значениями. Картирование должно быть инициализировано аналогично стандартному контейнеру map, используя оператора индексации и уступку.

[Note]Note

В отличие от многих других компонентов библиотеки, точный тип значения атрибута должен быть указан в параметре шаблона AttributeValueT. Последовательности типов не поддерживаются.

basic_custom_mapping public construct/copy/destruct

  1. explicit basic_custom_mapping(attribute_name const & name, 
                                  mapped_type const & default_value);

    Constructor

    Parameters:

    default_value

    The default native value that is returned if the conversion cannot be performed

    name

    Attribute name

basic_custom_mapping public member functions

  1. mapped_type operator()(record_view const & rec) const;

    Extraction operator. Extracts the attribute value and attempts to map it onto the native value.

    Parameters:

    rec

    A log record to extract value from

    Returns:

    A mapped value, if mapping was successful, or the default value if mapping did not succeed.

  2. Инсертионный оператор

    Параметры:

    key

    Attribute value to be mapped

    Возвращение:

    Объект неопределенного типа, который позволяет вставить новое отображение через присвоение. Аргумент key становится ключевым значением атрибута, а назначенное значение становится отображенным родным значением.

    Insertion operator

    Parameters:

    key

    Attribute value to be mapped

    Returns:

    An object of unspecified type that allows to insert a new mapping through assignment. The key argument becomes the key attribute value, and the assigned value becomes the mapped native value.

    [ORIG_END] -->

PrevUpHomeNext

Статья Class template basic_custom_mapping раздела Chapter 1. Boost.Log v2 Sinks может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Sinks ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-07-05 09:56:11/0.0064330101013184/0