Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::sinks::event_log::custom_event_id_mapping< AttributeValueT > Class Template Reference

Customizable event ID mapping. More...

#include <event_log_backend.hpp>

Inheritance diagram for boost::sinks::event_log::custom_event_id_mapping< AttributeValueT >:
Collaboration diagram for boost::sinks::event_log::custom_event_id_mapping< AttributeValueT >:

Public Types

typedef AttributeValueT attribute_value_type
 Attribute contained value type. More...
 
typedef base_type::mapped_type mapped_type
 Mapped value type. More...
 
typedef mapped_type result_type
 Result type. More...
 

Public Member Functions

 custom_event_id_mapping (attribute_name const &name)
 Constructor. More...
 
mapped_type operator() (record_view const &rec) const
 Extraction operator. More...
 
reference_proxy operator[] (attribute_value_type const &key)
 Insertion operator. More...
 

Detailed Description

template<typename AttributeValueT = int>
class boost::sinks::event_log::custom_event_id_mapping< AttributeValueT >

Customizable event ID mapping.

The class allows to setup a custom mapping between an attribute and event identifiers. The mapping should be initialized similarly to the standard map container, by using indexing operator and assignment.

Member Typedef Documentation

typedef AttributeValueT boost::sinks::basic_custom_mapping< event_id , AttributeValueT >::attribute_value_type
inherited

Attribute contained value type.

Mapped value type.

Result type.

Constructor & Destructor Documentation

template<typename AttributeValueT = int>
boost::sinks::event_log::custom_event_id_mapping< AttributeValueT >::custom_event_id_mapping ( attribute_name const &  name)
inlineexplicit

Constructor.

Parameters
nameAttribute name

Member Function Documentation

mapped_type boost::sinks::basic_custom_mapping< event_id , AttributeValueT >::operator() ( record_view const &  rec) const
inlineinherited

Extraction operator.

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

Parameters
recA log record to extract value from
Returns
A mapped value, if mapping was successful, or the default value if mapping did not succeed.
reference_proxy boost::sinks::basic_custom_mapping< event_id , AttributeValueT >::operator[] ( attribute_value_type const &  key)
inlineinherited

Insertion operator.

Parameters
keyAttribute 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.

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