# Utilities

Andrey Semashev

12.07.2009

This header contains tools for exception handlers support in different parts of the library.

An exception handler functional object. The handler aggregates a user-defined functional object that will be called when one of the specified exception types is caught.

The exception handler type. HandlerT The handler result type. void void

Exception launcher. Rethrows the current exception in order to detect its type and pass it to the aggregated function object.

Must be called from within a `catch` statement.

`handler_type const &`

Initializing constructor. Creates an exception handler with the specified function object that will receive the exception.

boost::log::exception_handler< SequenceT, HandlerT >

A no-throw exception handler functional object. Acts similar to ``exception_handler``, but in case if the exception cannot be handled the exception is not propagated from the handler. Instead the user-defined functional object is called with no parameters.

The exception handler type. HandlerT The handler result type. void void

Exception launcher. Rethrows the current exception in order to detect its type and pass it to the aggregated function object. If the type of the exception could not be detected, the user-defined handler is called with no arguments.

Must be called from within a `catch` statement.

`handler_type const &`

Initializing constructor. Creates an exception handler with the specified function object that will receive the exception.

``nop`

The function creates an empty exception handler that effectively suppresses any exception

` ``exception_handler`< typename HandlerT::exception_types, HandlerT > `HandlerT const &

User-defined functional object that will receive exceptions.

`

The function creates an exception handler functional object. The handler will call to the user-specified functional object with an exception as its argument.

This form requires the user-defined functional object to have an `exception_types` nested type. This type should be an MPL sequence of all expected exception types.

A nullary functional object that should be called from within a `catch` statement.

` ``nothrow_exception_handler`< typename HandlerT::exception_types, HandlerT > `HandlerT const &

User-defined functional object that will receive exceptions.

``std::nothrow_t const &`

The function creates an exception handler functional object. The handler will call to the user-specified functional object with an exception as its argument. If the exception type cannot be identified, the handler will call the user-defined functor with no arguments, instead of propagating exception to the caller.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This form requires the user-defined functional object to have an `exception_types` nested type. This type should be an MPL sequence of all expected exception types.

A nullary functional object that should be called from within a `catch` statement.

` ``exception_handler`< MPL_sequence_of_ExceptionsT, HandlerT > typename... `HandlerT const &

User-defined functional object that will receive exceptions.

`

The function creates an exception handler functional object. The handler will call to the user-specified functional object with an exception as its argument. All expected exception types should be specified as first template parameters explicitly, in the order they would be specified in a corresponding `try/catch` statement.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

A nullary functional object that should be called from within a `catch` statement.

` ``nothrow_exception_handler`< MPL_sequence_of_ExceptionsT, HandlerT > typename... `HandlerT const &

User-defined functional object that will receive exceptions.

``std::nothrow_t const &`

The function creates an exception handler functional object. The handler will call to the user-specified functional object with an exception as its argument. If the exception type cannot be identified, the handler will call the user-defined functor with no arguments, instead of propagating exception to the caller. All expected exception types should be specified as first template parameters explicitly, in the order they would be specified in a corresponding `try/catch` statement.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

A nullary functional object that should be called from within a `catch` statement.

` Maximum number of exception types that can be specified for exception handlers.

Andrey Semashev

11.07.2012

The header contains implementation of a string stream used for log record formatting. Stream wrapper for log records formatting.

This stream wrapper is used by the library for log record formatting. It implements the standard string stream interface with a few differences:

- It does not derive from standard types `std::basic_ostream`, `std::basic_ios` and `std::ios_base`, although it tries to implement their interfaces closely. There are a few small differences, mostly regarding `rdbuf` and `str` signatures, as well as the supported insertion operator overloads. The actual wrapped stream can be accessed through the `stream` methods.

- By default, `bool` values are formatted using alphabetical representation rather than numeric.

- The stream supports writing strings of character types different from the stream character type. The stream will perform character code conversion as needed using the imbued locale.

- The stream operates on an external string object rather than on the embedded one. The string can be attached or detached from the stream dynamically.

Although ``basic_formatting_ostream`` does not derive from `std::basic_ostream`, users are not required to add special overloads of `operator<<` for it since the stream will by default reuse the operators for `std::basic_ostream`. However, one can define special overloads of `operator<<` for ``basic_formatting_ostream`` if a certain type needs special formatting when output to log. bool bool ``basic_formatting_ostream` &` `sentry const &` sentry &`sentry const &` Character type. CharT Character traits. TraitsT Memory allocator. AllocatorT Stream buffer type. unspecified Target string type. streambuf_type::string_type Stream type. std::basic_ostream< char_type, traits_type > Stream position type. ostream_type::pos_type Stream offset type. ostream_type::off_type Integer type for characters. ostream_type::int_type ostream_type::failure ostream_type::fmtflags ostream_type::iostate ostream_type::openmode ostream_type::seekdir ostream_type::Init ostream_type::event ostream_type::event_callback constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr fmtflags constexpr iostate constexpr iostate constexpr iostate constexpr iostate constexpr openmode constexpr openmode constexpr openmode constexpr openmode constexpr openmode constexpr openmode constexpr seekdir constexpr seekdir constexpr seekdir constexpr event constexpr event constexpr event void `string_type &

The string buffer to attach.

`

Attaches the stream to the string. The string will be used to store the formatted characters.

void

Detaches the stream from the string. Any buffered data is flushed to the string.

string_type const &

Reference to the attached string. The string must be attached before calling this method.

ostream_type &

Reference to the wrapped stream

ostream_type const &

Reference to the wrapped stream

fmtflags fmtflags `fmtflags` fmtflags `fmtflags` fmtflags `fmtflags` `fmtflags` void `fmtflags` std::streamsize std::streamsize `std::streamsize` std::streamsize std::streamsize `std::streamsize` std::locale std::locale `std::locale const &` long &`int` void *&`int` void `event_callback` `int` bool bool iostate void `iostategoodbit` void `iostate` bool bool bool bool iostate void `iostate` ostream_type * ostream_type *`ostream_type *` streambuf_type * `basic_formatting_ostream` &`std::basic_ios< char_type, traits_type > &` `basic_formatting_ostream` &``basic_formatting_ostream` &` char_type char_type `char_type` char `char_type` `char` char_type `char` `basic_formatting_ostream` & pos_type `basic_formatting_ostream` &`pos_type` `basic_formatting_ostream` &`off_type` `std::ios_base::seekdir` `basic_formatting_ostream` &`char_type` unspecified `OtherCharT` `basic_formatting_ostream` &`const char_type *``std::streamsize` unspecified `const OtherCharT *``std::streamsize` `basic_formatting_ostream` &`ios_base_manip` `basic_formatting_ostream` &`basic_ios_manip` `basic_formatting_ostream` &`stream_manip` `basic_formatting_ostream` &`char` `basic_formatting_ostream` &`const char *` `basic_formatting_ostream` &`wchar_t` `basic_formatting_ostream` &`const wchar_t *` `basic_formatting_ostream` &`char16_t` `basic_formatting_ostream` &`const char16_t *` `basic_formatting_ostream` &`char32_t` `basic_formatting_ostream` &`const char32_t *` `basic_formatting_ostream` &`bool` `basic_formatting_ostream` &`signed char` `basic_formatting_ostream` &`unsigned char` `basic_formatting_ostream` &`short` `basic_formatting_ostream` &`unsigned short` `basic_formatting_ostream` &`int` `basic_formatting_ostream` &`unsigned int` `basic_formatting_ostream` &`long` `basic_formatting_ostream` &`unsigned long` `basic_formatting_ostream` &`long long` `basic_formatting_ostream` &`unsigned long long` `basic_formatting_ostream` &`float` `basic_formatting_ostream` &`double` `basic_formatting_ostream` &`long double` `basic_formatting_ostream` &`const void *` `basic_formatting_ostream` &`std::basic_streambuf< char_type, traits_type > *`

Default constructor. Creates an empty record that is equivalent to the invalid record handle. The stream capability is not available after construction.

`!*this == true`

`string_type &

The string buffer to attach.

`

Initializing constructor. Attaches the string to the constructed stream. The string will be used to store the formatted characters.

`!*this == false`

Destructor. Destroys the record, releases any sinks and attribute values that were involved in processing this record.

int bool `booltrue` void `basic_formatting_ostream` &`const char_type *``std::streamsize` `basic_formatting_ostream` & `const OtherCharT *``std::streamsize` void `const char_type *``std::streamsize` void `const OtherCharT *``std::streamsize` ``basic_formatting_ostream` const &`Copy constructor (closed) `basic_formatting_ostream` &``basic_formatting_ostream` const &`Assignment (closed) `unspecified `StreamT &``T const &`` `unspecified `StreamT &``T &`` `unspecified `StreamT &&``T const &`` `unspecified `StreamT &&``T &``

Andrey Semashev

11.07.2012

The header contains forward declaration of a string stream used for log record formatting. `basic_formatting_ostream`< char > `basic_formatting_ostream`< wchar_t >

Andrey Semashev

30.03.2008

This header includes all functional helpers.

Andrey Semashev

30.03.2008

This header contains function object adapter for compatibility with Boost.Spirit actions interface requirements. Function object adapter for Boost.Spirit actions. FunT::result_type result_type `AttributeT const &``ContextT const &``bool &` `FunT const &` ``as_action_adapter`< FunT > `FunT const &``

Andrey Semashev

30.03.2008

This header contains a predicate for checking if the provided string begins with a substring. The `begins_with` functor. bool bool `T const &``U const &`

Andrey Semashev

30.03.2008

This header contains function object adapters. This is a lightweight alternative to what Boost.Phoenix and Boost.Bind provides. First argument binder. FunT::result_type result_type result_type `T0 const &` result_type `T0 const &``T1 const &` `FunT const &``unspecified` FunT &FirstArgT First argument binder. remove_cv< FunT >::type::result_type result_type result_type `T0 const &` result_type `T0 const &``T1 const &` `FunT &``unspecified` Second argument binder. FunT::result_type result_type `T const &` result_type `T0 const &``T1 const &` `FunT const &``unspecified` FunT &SecondArgT Second argument binder. remove_cv< FunT >::type::result_type result_type `T const &` result_type `T0 const &``T1 const &` `FunT &``unspecified` Third argument binder. FunT::result_type result_type `T0 const &``T1 const &` `FunT const &``unspecified` FunT &ThirdArgT Third argument binder. remove_cv< FunT >::type::result_type result_type `T0 const &``T1 const &` `FunT &``unspecified` ``binder1st`< FunT, FirstArgT > `FunT``FirstArgT const &`` ``binder1st`< FunT, FirstArgT > `FunT``FirstArgT &`` ``binder2nd`< FunT, SecondArgT > `FunT``SecondArgT const &`` ``binder2nd`< FunT, SecondArgT > `FunT``SecondArgT &`` ``binder3rd`< FunT, ThirdArgT > `FunT``ThirdArgT const &`` ``binder3rd`< FunT, ThirdArgT > `FunT``ThirdArgT &``

Andrey Semashev

30.03.2008

This header contains a function object that assigns the received value to the bound object. This is a lightweight alternative to what Boost.Phoenix and Boost.Lambda provides. The function object that assigns its second operand to the first one. void void `LeftT &``RightT const &` ``binder1st`< `assign_fun`, AssigneeT & > `AssigneeT &``

Andrey Semashev

30.03.2008

This header contains a function object that puts the received value to the bound stream. This is a lightweight alternative to what Boost.Phoenix and Boost.Lambda provides. The function object that outputs its second operand to the first one. void void `StreamT &``T const &` ``binder1st`< `output_fun`, StreamT & > `StreamT &``

Andrey Semashev

06.11.2012

This header contains a function object that puts the received value to the bound stream using the `to_log` manipulator. This is a lightweight alternative to what Boost.Phoenix and Boost.Lambda provides. void The function object that outputs its second operand to the first one. void void `StreamT &``T const &` void The function object that outputs its second operand to the first one. void void `StreamT &``T const &` ``binder1st`< `to_log_fun`< >, StreamT & > `StreamT &`` ``binder1st`< `to_log_fun`< TagT >, StreamT & > `StreamT &``

Andrey Semashev

30.03.2008

This header contains a predicate for checking if the provided string contains a substring. The `contains` functor. bool bool `T const &``U const &`

Andrey Semashev

30.03.2008

This header contains a predicate for checking if the provided string ends with a substring. The `ends_with` functor. bool bool `T const &``U const &`

Andrey Semashev

30.03.2008

This header contains function object reference adapter. The adapter stores a reference to external function object and forwards all calls to the referred function. Reference wrapper for function objects. FunT::result_type result_type result_type typename... `ArgsT const &...` `FunT &` ``function_reference_wrapper`< FunT > `FunT &``

Andrey Semashev

30.03.2008

This header contains a predicate for checking if the provided value is within a half-open range. The in_range functor. bool bool `T const &``std::pair< U, U > const &` bool `T const &``std::pair< U, U > const &``mpl::false_ const &` bool `T const &``std::pair< U, U > const &``mpl::true_ const &`

Andrey Semashev

30.03.2008

This header contains logical predicates for value comparison, analogous to `std::less`, `std::greater` and others. The main difference from the standard equivalents is that the predicates defined in this header are not templates and therefore do not require a fixed argument type. Furthermore, both arguments may have different types, in which case the comparison is performed without type conversion.

In case if arguments are integral, the conversion is performed according to the standard C++ rules in order to avoid warnings from the compiler.

Equality predicate.
bool
bool `T const &` `U const &`
bool `T const &` `U const &` `mpl::false_ const &`
bool `T const &` `U const &` `mpl::true_ const &`
Inequality predicate.
bool
bool `T const &` `U const &`
bool `T const &` `U const &` `mpl::false_ const &`
bool `T const &` `U const &` `mpl::true_ const &`
Less predicate.
bool
bool `T const &` `U const &`
bool `T const &` `U const &` `mpl::false_ const &`
bool `T const &` `U const &` `mpl::true_ const &`
Greater predicate.
bool
bool `T const &` `U const &`
bool `T const &` `U const &` `mpl::false_ const &`
bool `T const &` `U const &` `mpl::true_ const &`
Less or equal predicate.
bool
bool `T const &` `U const &`
bool `T const &` `U const &` `mpl::false_ const &`
bool `T const &` `U const &` `mpl::true_ const &`
Greater or equal predicate.
bool
bool `T const &` `U const &`
bool `T const &` `U const &` `mpl::false_ const &`
bool `T const &` `U const &` `mpl::true_ const &`

Andrey Semashev

30.03.2008

This header contains a predicate for checking if the provided string matches a regular expression. The regex matching functor. bool bool `StringT const &``ExpressionT const &` bool `StringT const &``ExpressionT const &``ArgT const &`

Andrey Semashev

30.03.2008

This header contains a function object that does nothing. The function object that does nothing. void void void typename... `ArgsT const &`

Andrey Semashev

19.01.2013

This header contains function object adapter that saves the result of the adopted function to an external variable. Function object wrapper for saving the adopted function object result. void result_type `ArgT const &` `FunT` `AssigneeT &` ``save_result_wrapper`< FunT, AssigneeT > `FunT const &``AssigneeT &``

Andrey Semashev

06.11.2012

This header includes all manipulators.

Andrey Semashev

26.11.2012

This header contains the `add_value` manipulator. Attribute value manipulator. Stored reference type. RefT Attribute value type. remove_cv< typename remove_reference< reference_type >::type >::type attribute_name Returns attribute name. get_value_result_type Returns attribute value. `attribute_name const &``reference_type` Initializing constructor. `basic_record_ostream< CharT > & `basic_record_ostream< CharT > &```add_value_manip`< RefT > const &`The operator attaches an attribute value to the log record.` `add_value_manip`< T && > `attribute_name const &``T &&``add_value_manip`< typename DescriptorT::value_type && > template< typename > class `expressions::attribute_keyword< DescriptorT, ActorT > const &``typename DescriptorT::value_type &&``add_value_manip`< typename DescriptorT::value_type & > template< typename > class `expressions::attribute_keyword< DescriptorT, ActorT > const &``typename DescriptorT::value_type &``add_value_manip`< typename DescriptorT::value_type const & > template< typename > class `expressions::attribute_keyword< DescriptorT, ActorT > const &``typename DescriptorT::value_type const &`The function creates a manipulator that attaches an attribute value to a log record.

Andrey Semashev

03.05.2013

This header contains the `dump` output manipulator. Manipulator for printing binary representation of the data. const void * std::size_t `const void *``std::size_t` ``dump_manip` const &` dump_manip Manipulator for printing binary representation of the data with a size limit. std::size_t `const void *``std::size_t` `std::size_t` ``bounded_dump_manip` const &` `std::basic_ostream< CharT, TraitsT > & `std::basic_ostream< CharT, TraitsT > &```dump_manip` const &`The operator outputs binary data to a stream.` `std::basic_ostream< CharT, TraitsT > & `std::basic_ostream< CharT, TraitsT > &```bounded_dump_manip` const &`The operator outputs binary data to a stream.` `unspecified `T *

The pointer to the beginning of the region

``std::size_t

The size of the region, in bytes

`Creates a stream manipulator that will output contents of a memory region in hexadecimal form.

The manipulator that is to be put to a stream

` ``dump_manip` `T *

The pointer to the beginning of the array

``std::size_t

The size of the region, in number of `T` elements

`Creates a stream manipulator that will dump elements of an array in hexadecimal form.

The manipulator that is to be put to a stream

` `unspecified `T *

The pointer to the beginning of the region

``std::size_t

The size of the region, in bytes max_size The maximum number of bytes of the region to output

``std::size_t`Creates a stream manipulator that will output contents of a memory region in hexadecimal form.

The manipulator that is to be put to a stream

` ``bounded_dump_manip` `T *

The pointer to the beginning of the array

``std::size_t

The size of the region, in number of `T` elements max_count The maximum number of elements to output

``std::size_t`Creates a stream manipulator that will dump elements of an array in hexadecimal form.

The manipulator that is to be put to a stream

`

Andrey Semashev

06.11.2012

This header contains the `to_log` output manipulator. void Generic manipulator for customizing output to log. Output value type. T Value tag type. TagT value_type const & `value_type const &` ``to_log_manip` const &` `unspecified `StreamT &```to_log_manip`< T, TagT >`` ``to_log_manip`< T > `T const &`` ``to_log_manip`< T, TagT > `T const &``

The header defines classes and macros for once-blocks.

Andrey Semashev

23.06.2010

A flag to detect if a code block has already been executed.

This structure should be used in conjunction with the `BOOST_LOG_ONCE_BLOCK_FLAG` macro. Usage example:

``once_block_flag` flag = BOOST_LOG_ONCE_BLOCK_INIT;`

`void foo() { BOOST_LOG_ONCE_BLOCK_FLAG(flag) { puts("Hello, world once!"); } }`

The static initializer for `once_block_flag`.

Begins a code block to be executed only once, with protection against thread concurrency. User has to provide the flag variable that controls whether the block has already been executed.

Begins a code block to be executed only once, with protection against thread concurrency.

Andrey Semashev

23.08.2009

This header contains ordering predicates for logging records. `less` Ordering predicate, based on opaque pointers to the record view implementation data.

Since record views only refer to a shared implementation data, this predicate is able to order the views by comparing the pointers to the data. Therefore two views are considered to be equivalent if they refer to the same implementation data. Otherwise it is not specified whether one record is ordered before the other until the predicate is applied. Note that the ordering may change every time the application runs.

This kind of ordering may be useful if log records are to be stored in an associative container with as least performance overhead as possible, when the particular order is not important.

The `FunT` template argument is the predicate that is used to actually compare pointers. It should be able to compare `const void*` pointers. The compared pointers may refer to distinct memory regions, the pointers must not be interpreted in any way.

Result type. bool result_type `record_view const &``record_view const &`

Ordering operator

Default constructor. Requires `FunT` to be default constructible.

`FunT const &`

Initializing constructor. Constructs `FunT` instance as a copy of the fun argument.

`less` Ordering predicate, based on attribute values associated with records.

This predicate allows to order log records based on values of a specifically named attribute associated with them. Two given log records being compared should both have the specified attribute value of the specified type to be able to be ordered properly. As a special case, if neither of the records have the value, these records are considered equivalent. Otherwise, the ordering results are unspecified.

void result_type `LeftT const &` ``attribute_value_ordering` const &``record_view const &``bool &` void result_type `RightT const &` `FunT const &``LeftT const &``bool &` Result type. bool Compared attribute value type. ValueT result_type `record_view const &``record_view const &`

Ordering operator

`attribute_name const &

The attribute value name to be compared

``FunT const &FunT()

The ordering functor

`

Initializing constructor.

``attribute_value_ordering`< ValueT, FunT > `attribute_name const &``FunT const &`

The function constructs a log record ordering predicate

` `unspecified `attribute_name const &``FunT const &`

The function constructs a log record ordering predicate

`

Andrey Semashev

16.02.2013

This header includes all library setup helpers.

Andrey Semashev

16.05.2008

The header contains implementation of convenience functions for registering commonly used attributes. `voidSimple attribute initialization routine.

The function adds commonly used attributes to the logging system. Specifically, the following attributes are registered globally:

- LineID - logging records counter with value type `unsigned int`

- TimeStamp - local time generator with value type `boost::posix_time::ptime`

- ProcessID - current process identifier with value type `attributes::current_process_id::value_type`

- ThreadID - in multithreaded builds, current thread identifier with value type `attributes::current_thread_id::value_type`

`

Andrey Semashev

16.05.2008

The header contains implementation of convenience functions for enabling logging to console. `shared_ptr< sinks::synchronous_sink< sinks::basic_text_ostream_backend< CharT > >> typename... `std::basic_ostream< CharT > &

One of the standard console streams: `std::cout`, `std::cerr` or `std::clog` (or the corresponding wide-character analogues).

``ArgsT...const &

Optional additional named arguments for the sink initialization. The following arguments are supported:

- `filter` Specifies a filter to install into the sink. May be a string that represents a filter, or a filter lambda expression.

- `format` Specifies a formatter to install into the sink. May be a string that represents a formatter, or a formatter lambda expression (either streaming or Boost.Format-like notation).

- `auto_flush` A boolean flag that shows whether the sink should automatically flush the stream after each written record.

`

The function constructs sink for the specified console stream and adds it to the core

Pointer to the constructed sink.

` `shared_ptr< sinks::synchronous_sink< sinks::basic_text_ostream_backend< CharT > >> typename... `ArgsT...const &`

Equivalent to: `add_console_log(std::clog);` or `add_console_log(std::wclog);`, depending on the `CharT` type.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

` `shared_ptr< sinks::synchronous_sink< sinks::text_ostream_backend >>

The function constructs sink for the `std::clog` stream and adds it to the core

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Pointer to the constructed sink.

` `shared_ptr< sinks::synchronous_sink< sinks::wtext_ostream_backend >>

The function constructs sink for the `std::wclog` stream and adds it to the core

Pointer to the constructed sink.

`

Andrey Semashev

16.05.2008

The header contains implementation of convenience functions for enabling logging to a file. `shared_ptr< sinks::synchronous_sink< sinks::text_file_backend > > typename... `ArgsT...const &

A number of named arguments. The following parameters are supported:

- `file_name` The file name or its pattern. This parameter is mandatory.

- `open_mode` The mask that describes the open mode for the file. See `std::ios_base::openmode`.

- `rotation_size` The size of the file at which rotation should occur. See `basic_text_file_backend`.

- `time_based_rotation` The predicate for time-based file rotations. See `basic_text_file_backend`.

- `auto_flush` A boolean flag that shows whether the sink should automatically flush the file after each written record.

- `target` The target directory to store rotated files in. See `sinks::file::make_collector`.

- `max_size` The maximum total size of rotated files in the target directory. See `sinks::file::make_collector`.

- `min_free_space` Minimum free space in the target directory. See `sinks::file::make_collector`.

- `max_files` The maximum total number of rotated files in the target directory. See `sinks::file::make_collector`.

- `scan_method` The method of scanning the target directory for log files. See `sinks::file::scan_method`.

- `filter` Specifies a filter to install into the sink. May be a string that represents a filter, or a filter lambda expression.

- `format` Specifies a formatter to install into the sink. May be a string that represents a formatter, or a formatter lambda expression (either streaming or Boost.Format-like notation).

`

The function initializes the logging library to write logs to a file stream.

Pointer to the constructed sink.

`

Andrey Semashev

31.03.2008

The header contains definition of a filter parser function.

The interface class for all filter factories.

Character type. CharT String type. std::basic_string< char_type > filter `attribute_name const &`

The callback for filter for the attribute existence test

filter `attribute_name const &``string_type const &`

The callback for equality relation filter

filter `attribute_name const &``string_type const &`

The callback for inequality relation filter

filter `attribute_name const &``string_type const &`

The callback for less relation filter

filter `attribute_name const &``string_type const &`

The callback for greater relation filter

filter `attribute_name const &``string_type const &`

The callback for less or equal relation filter

filter `attribute_name const &``string_type const &`

The callback for greater or equal relation filter

filter `attribute_name const &``string_type const &``string_type const &`

The callback for custom relation filter

Default constructor

Virtual destructor

``filter_factory` const &` `filter_factory` &``filter_factory` const &` boost::log::filter_factory< CharT >

The base class for filter factories. The class defines default implementations for most filter expressions. In order to be able to construct filters, the attribute value type must support reading from a stream. Also, the default filters will rely on relational operators for the type, so these operators must also be defined.

The type(s) of the attribute value expected. AttributeValueT String type. base_type::string_type filter `attribute_name const &`

The callback for filter for the attribute existence test

filter `attribute_name const &``string_type const &`

The callback for equality relation filter

filter `attribute_name const &``string_type const &`

The callback for inequality relation filter

filter `attribute_name const &``string_type const &`

The callback for less relation filter

filter `attribute_name const &``string_type const &`

The callback for greater relation filter

filter `attribute_name const &``string_type const &`

The callback for less or equal relation filter

filter `attribute_name const &``string_type const &`

The callback for greater or equal relation filter

filter `attribute_name const &``string_type const &``string_type const &`

The callback for custom relation filter

value_type `string_type const &`

The function parses the argument value for a binary relation

`void `attribute_name const &

Attribute name to associate the factory with

``shared_ptr< `filter_factory`< CharT > > const &

The filter factory

`

The function registers a filter factory object for the specified attribute name. The factory will be used to construct a filter during parsing the filter string.

`name != NULL && factory != NULL`, `name` points to a zero-terminated string

` `enable_if< is_base_and_derived< `filter_factory`< typename FactoryT::char_type >, FactoryT >>::type `attribute_name const &

Attribute name to associate the factory with

``shared_ptr< FactoryT > const &

The filter factory

`

The function registers a filter factory object for the specified attribute name. The factory will be used to construct a filter during parsing the filter string.

`name != NULL && factory != NULL`, `name` points to a zero-terminated string

` `void `attribute_name const &

Attribute name to associate the factory with

`

The function registers a simple filter factory object for the specified attribute name. The factory will support attribute values of type `AttributeValueT`, which must support all relation operations, such as equality comparison and less/greater ordering, and also extraction from stream.

`name != NULL`, `name` points to a zero-terminated string

` `void `attribute_name const &

Attribute name to associate the factory with

`

The function registers a simple filter factory object for the specified attribute name. The factory will support attribute values of type `AttributeValueT`, which must support all relation operations, such as equality comparison and less/greater ordering, and also extraction from stream.

`name != NULL`, `name` points to a zero-terminated string

` `void template< typename > class `expressions::attribute_keyword< DescriptorT, ActorT > const &

Attribute keyword to associate the factory with

`

The function registers a simple filter factory object for the specified attribute keyword. The factory will support attribute values described by the keyword. The values must support all relation operations, such as equality comparison and less/greater ordering, and also extraction from stream.

`name != NULL`, `name` points to a zero-terminated string

` `filter `const CharT *

Pointer to the first character of the sequence

``const CharT *

Pointer to the after-the-last character of the sequence

`

The function parses a filter from the sequence of characters

Throws: An `std::exception`-based exception, if a filter cannot be recognized in the character sequence.

`begin <= end`, both pointers must not be `NULL`

A function object that can be used as a filter.

` `filter `std::basic_string< CharT, TraitsT, AllocatorT > const &

A string that contains filter description

`

The function parses a filter from the string

Throws: An `std::exception`-based exception, if a filter cannot be recognized in the character sequence.

A function object that can be used as a filter.

` `filter `const CharT *

A string that contains filter description.

`

The function parses a filter from the string

Throws: An `std::exception`-based exception, if a filter cannot be recognized in the character sequence.

`str != NULL`, `str` points to a zero-terminated string.

A function object that can be used as a filter.

`

Andrey Semashev

07.04.2008

The header contains definition of a formatter parser function, along with facilities to add support for custom formatters.

Formatter factory base interface.

Character type. CharT String type. std::basic_string< char_type > The formatter function object. basic_formatter< char_type >

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.

std::map< string_type, string_type > formatter_type `attribute_name const &

Attribute name

``args_map const &

Formatter arguments

`

The function creates a formatter for the specified attribute.

Default constructor

Virtual destructor

``formatter_factory` const &` `formatter_factory` &``formatter_factory` const &` boost::log::formatter_factory< CharT >

Base class for formatter factories. This class provides default implementation of formatter expressions for types supporting stream output. The factory does not take into account any additional parameters that may be specified.

Attribute value type. AttributeValueT The formatter function object. base_type::formatter_type

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.

base_type::args_map formatter_type `attribute_name const &

Attribute name

``args_map const &

Formatter arguments

`

The function creates a formatter for the specified attribute.

`void `attribute_name const &

Attribute name

``shared_ptr< `formatter_factory`< CharT > > const &

Pointer to the formatter factory

`The function registers a user-defined formatter factory.

The function registers a user-defined formatter factory. The registered factory function will be called when the formatter parser detects the specified attribute name in the formatter string.

`!!attr_name && !!factory`.

` `enable_if< is_base_and_derived< `formatter_factory`< typename FactoryT::char_type >, FactoryT >>::type `attribute_name const &

Attribute name

``shared_ptr< FactoryT > const &

Pointer to the formatter factory

`The function registers a user-defined formatter factory.

The function registers a user-defined formatter factory. The registered factory function will be called when the formatter parser detects the specified attribute name in the formatter string.

`!!attr_name && !!factory`.

` `void `attribute_name const &

Attribute name

`The function registers a simple formatter factory.

The function registers a simple formatter factory. The registered factory will generate formatters that will be equivalent to the `log::expressions::attr` formatter (i.e. that will use the native `operator<<` to format the attribute value). The factory does not use any arguments from the format string, if specified.

`!!attr_name`.

` `basic_formatter< CharT > `const CharT *

Pointer to the first character of the sequence

``const CharT *

Pointer to the after-the-last character of the sequence

`

The function parses a formatter from the sequence of characters

Throws: An `std::exception`-based exception, if a formatter cannot be recognized in the character sequence.

`begin <= end`, both pointers must not be NULL

The parsed formatter.

` `basic_formatter< CharT > `std::basic_string< CharT, TraitsT, AllocatorT > const &

A string that contains format description

`

The function parses a formatter from the string

Throws: An `std::exception`-based exception, if a formatter cannot be recognized in the character sequence.

The parsed formatter.

` `basic_formatter< CharT > `const CharT *

A string that contains format description.

`

The function parses a formatter from the string

Throws: An `std::exception`-based exception, if a formatter cannot be recognized in the character sequence.

`str != NULL`, `str` points to a zero-terminated string

The parsed formatter.

`

Andrey Semashev

11.10.2009

The header contains definition of facilities that allows to initialize the library from settings.

Sink factory base interface

Character type. CharT String type. std::basic_string< char_type > Settings section type. `basic_settings_section`< char_type > shared_ptr< sinks::sink >`settings_section const &

Sink parameters

`

The function creates a formatter for the specified attribute.

Default constructor

Virtual destructor

``sink_factory` const &` `sink_factory` &``sink_factory` const &` `void ``basic_settings_section`< CharT > const &

Library settings container

`

The function initializes the logging library from a settings container

Throws: An `std::exception`-based exception if the provided settings are not valid.

` `void `const char *

The custom sink name. Must point to a zero-terminated sequence of characters, must not be NULL.

``shared_ptr< `sink_factory`< CharT > > const &

Pointer to the custom sink factory. Must not be NULL.

`The function registers a factory for a custom sink.

The function registers a factory for a sink. The factory will be called to create sink instance when the parser discovers the specified sink type in the settings file. The factory must accept a map of parameters [parameter name -> parameter value] that it may use to initialize the sink. The factory must return a non-NULL pointer to the constructed sink instance.

` `void `std::string const &

The custom sink name

``shared_ptr< `sink_factory`< CharT > > const &

Pointer to the custom sink factory. Must not be NULL.

`The function registers a factory for a custom sink.

The function registers a factory for a sink. The factory will be called to create sink instance when the parser discovers the specified sink type in the settings file. The factory must accept a map of parameters [parameter name -> parameter value] that it may use to initialize the sink. The factory must return a non-NULL pointer to the constructed sink instance.

` `enable_if< is_base_and_derived< `sink_factory`< typename FactoryT::char_type >, FactoryT >>::type `const char *

The custom sink name. Must point to a zero-terminated sequence of characters, must not be NULL.

``shared_ptr< FactoryT > const &

Pointer to the custom sink factory. Must not be NULL.

`The function registers a factory for a custom sink.

The function registers a factory for a sink. The factory will be called to create sink instance when the parser discovers the specified sink type in the settings file. The factory must accept a map of parameters [parameter name -> parameter value] that it may use to initialize the sink. The factory must return a non-NULL pointer to the constructed sink instance.

` `enable_if< is_base_and_derived< `sink_factory`< typename FactoryT::char_type >, FactoryT >>::type `std::string const &

The custom sink name

``shared_ptr< FactoryT > const &

Pointer to the custom sink factory. Must not be NULL.

`The function registers a factory for a custom sink.

The function registers a factory for a sink. The factory will be called to create sink instance when the parser discovers the specified sink type in the settings file. The factory must accept a map of parameters [parameter name -> parameter value] that it may use to initialize the sink. The factory must return a non-NULL pointer to the constructed sink instance.

`

Andrey Semashev

22.03.2008

The header contains definition of facilities that allows to initialize the library from a settings file. `void `std::basic_istream< CharT > &

Stream, that provides library settings

`

The function initializes the logging library from a stream containing logging settings

Throws: An `std::exception`-based exception if the read data cannot be interpreted as the library settings

`

Andrey Semashev

11.10.2009

The header contains definition of the library settings container. The class represents a reference to the settings container section.

The section refers to a sub-tree of the library settings container. It does not own the referred sub-tree but allows for convenient access to parameters within the subsection.

Character type. CharT String type. std::basic_string< char_type > Property tree type. property_tree::basic_ptree< std::string, string_type > Property tree path type. property_tree_type::path_type

Constant reference to the parameter value

implementation_defined

Mutable reference to the parameter value

implementation_defined

Constant iterator over nested parameters and subsections

implementation_defined

Mutable iterator over nested parameters and subsections

implementation_defined bool

Checks if the section refers to the container.

bool

Checks if the section refers to the container.

iterator

Returns an iterator over the nested subsections and parameters.

iterator

Returns an iterator over the nested subsections and parameters.

const_iterator

Returns an iterator over the nested subsections and parameters.

const_iterator

Returns an iterator over the nested subsections and parameters.

reverse_iterator

Returns a reverse iterator over the nested subsections and parameters.

reverse_iterator

Returns a reverse iterator over the nested subsections and parameters.

const_reverse_iterator

Returns a reverse iterator over the nested subsections and parameters.

const_reverse_iterator

Returns a reverse iterator over the nested subsections and parameters.

bool

Checks if the container is empty (i.e. contains no sections and parameters).

reference `std::string const &

The name of the section in which the parameter resides

`

Accessor to a single parameter. This operator should be used in conjunction with the subsequent subscript operator that designates the parameter name.

An unspecified reference type that can be used for parameter name specifying

const_reference `std::string const &

The name of the section in which the parameter resides

`

Accessor to a single parameter. This operator should be used in conjunction with the subsequent subscript operator that designates the parameter name.

An unspecified reference type that can be used for parameter name specifying

reference `const char *

The name of the section in which the parameter resides

`

Accessor to a single parameter. This operator should be used in conjunction with the subsequent subscript operator that designates the parameter name.

An unspecified reference type that can be used for parameter name specifying

const_reference `const char *

The name of the section in which the parameter resides

`

Accessor to a single parameter. This operator should be used in conjunction with the subsequent subscript operator that designates the parameter name.

An unspecified reference type that can be used for parameter name specifying

property_tree_type const &

Accessor for the embedded property tree

property_tree_type &

Accessor for the embedded property tree

bool `string_type const &

The name of the section

`

Checks if the specified section is present in the container.

bool `string_type const &

The name of the section in which the parameter resides

``string_type const &

The name of the parameter

`

Checks if the specified parameter is present in the container.

void``basic_settings_section` &`

Swaps two references to settings sections.

Default constructor. Creates an empty settings container.

``basic_settings_section` const &`

Copy constructor.

`property_tree_type *` boost::log::basic_settings_section< CharT >The class represents settings container.

All settings are presented as a number of named parameters divided into named sections. The parameters values are stored as strings. Individual parameters may be queried via subscript operators, like this:

``

     optional< string > param = settings["Section1"]["Param1"]; // reads parameter "Param1" in section "Section1"
                                                                // returns an empty value if no such parameter exists
     settings["Section2"]["Param2"] = 10; // sets the parameter "Param2" in section "Section2"
                                          // to value "10"

There are also other methods to work with parameters.

Section type. `basic_settings_section`< CharT > Property tree type. section::property_tree_type

Default constructor. Creates an empty settings container.

``basic_settings` const &`

Copy constructor.

``this_type` &&`

Move constructor.

`property_tree_type const &`

Initializing constructor. Creates a settings container with the copy of the specified property tree.

Destructor

`basic_settings` &``basic_settings` const &`

Copy assignment operator.

`basic_settings` &``basic_settings` &&`

Move assignment operator.

Convenience typedef for narrow-character logging. `basic_settings`< char > Convenience typedef for narrow-character logging. `basic_settings_section`< char > Convenience typedef for wide-character logging. `basic_settings`< wchar_t > Convenience typedef for wide-character logging. `basic_settings_section`< wchar_t > `void ``basic_settings_section`< CharT > &```basic_settings_section`< CharT > &``

Andrey Semashev

20.07.2012

The header contains definition of a settings parser function. ``basic_settings`< CharT > `std::basic_istream< CharT > &

Stream, that provides library settings

`

The function parses library settings from an input stream

Throws: An `std::exception`-based exception if the read data cannot be interpreted as the library settings

`

Andrey Semashev

30.05.2010

The header contains definition of the `strictest_lock` metafunction that allows to select a lock with the strictest access requirements. no_lock< MutexT > lock_guard< MutexT > unique_lock< MutexT > shared_lock< MutexT > upgrade_lock< MutexT > boost::log::aux::exclusive_lock_guard< MutexT > boost::log::aux::shared_lock_guard< MutexT > typename... The metafunction selects the most strict lock type of the specified.

The template supports all lock types provided by the Boost.Thread library (except for `upgrade_to_unique_lock`), plus additional pseudo-lock `no_lock` that indicates no locking at all. Exclusive locks are considered the strictest, shared locks are weaker, and `no_lock` is the weakest.

implementation_defined A thread that owns this kind of lock doesn't restrict other threads in any way. A thread that owns this kind of lock requires that no other thread modify the locked data. A thread that owns this kind of lock requires that no other thread has access to the locked data. Access modes for different types of locks.

Andrey Semashev

24.06.2007

The header contains implementation of a constant string literal wrapper. String literal wrapper.

The ``basic_string_literal`` is a thin wrapper around a constant string literal. It provides interface similar to STL strings, but because of read-only nature of string literals, lacks ability to modify string contents. However, ``basic_string_literal`` objects can be assigned to and cleared.

The main advantage of this class comparing to other string classes is that it doesn't dynamically allocate memory and therefore is fast, thin and exception safe.

CharT TraitsT std::size_t std::ptrdiff_t const value_type * value_type const & const value_type * std::reverse_iterator< const_iterator > Corresponding STL string type. std::basic_string< value_type, traits_type > bool``this_type` const &

Comparand

`

Lexicographical comparison (equality)

`true` if the comparand string equals to this string, `false` otherwise

bool `const_pointer

Comparand. Must point to a zero-terminated sequence of characters, must not be NULL.

`

Lexicographical comparison (equality)

`true` if the comparand string equals to this string, `false` otherwise

bool `string_type const &

Comparand

`

Lexicographical comparison (equality)

`true` if the comparand string equals to this string, `false` otherwise

bool``this_type` const &

Comparand

`

Lexicographical comparison (less ordering)

`true` if this string is less than the comparand, `false` otherwise

bool `const_pointer

Comparand. Must point to a zero-terminated sequence of characters, must not be NULL.

`

Lexicographical comparison (less ordering)

`true` if this string is less than the comparand, `false` otherwise

bool `string_type const &

Comparand

`

Lexicographical comparison (less ordering)

`true` if this string is less than the comparand, `false` otherwise

bool``this_type` const &

Comparand

`

Lexicographical comparison (greater ordering)

`true` if this string is greater than the comparand, `false` otherwise

bool `const_pointer

Comparand. Must point to a zero-terminated sequence of characters, must not be NULL.

`

Lexicographical comparison (greater ordering)

`true` if this string is greater than the comparand, `false` otherwise

bool `string_type const &

Comparand

`

Lexicographical comparison (greater ordering)

`true` if this string is greater than the comparand, `false` otherwise

const_reference `size_type

Requested character index

`

Subscript operator

`i < size()`

Constant reference to the requested character

const_reference `size_type

Requested character index

`

Checked subscript

Throws: An `std::exception`-based exception if index i is out of string boundaries

Constant reference to the requested character

const_pointer

Pointer to the beginning of the literal

const_pointer

Pointer to the beginning of the literal

size_type

Length of the literal

size_type

Length of the literal

bool

`true` if the literal is an empty string, `false` otherwise

const_iterator

Iterator that points to the first character of the literal

const_iterator

Iterator that points after the last character of the literal

const_reverse_iterator

Reverse iterator that points to the last character of the literal

const_reverse_iterator

Reverse iterator that points before the first character of the literal

string_type

STL string constructed from the literal

void

The method clears the literal

`empty() == true`

void``this_type` &`

The method swaps two literals

`this_type` &``this_type` const &

Source literal to copy string from

`

Assignment from another literal

`*this == that`

`this_type` & size_type `T(&)

A zero-terminated constant sequence of characters

`

Assignment from another literal

`*this == p`

size_type `value_type *

Pointer to the external buffer beginning. Must not be NULL. The buffer must have enough capacity to accommodate the requested number of characters.

``size_type

Maximum number of characters to copy

``size_type0

Starting position to start copying from

`

The method copies the literal or its portion to an external buffer

Throws: An `std::exception`-based exception if pos is out of range.

`pos <= size()`

Number of characters copied

int `size_type

Starting position within this string to perform comparison to

``size_type

Length of the substring of this string to perform comparison to

``const_pointer

Comparand. Must point to a sequence of characters, must not be NULL.

``size_type

Number of characters in the sequence str.

`

Lexicographically compares the argument string to a part of this string

Throws: An `std::exception`-based exception if pos is out of range.

`pos <= size()`

Zero if the comparand equals this string, a negative value if this string is less than the comparand, a positive value if this string is greater than the comparand.

int `size_type

Starting position within this string to perform comparison to

``size_type

Length of the substring of this string to perform comparison to

``const_pointer

Comparand. Must point to a zero-terminated sequence of characters, must not be NULL.

`

Lexicographically compares the argument string to a part of this string

Throws: An `std::exception`-based exception if pos is out of range.

`pos <= size()`

Zero if the comparand equals this string, a negative value if this string is less than the comparand, a positive value if this string is greater than the comparand.

int `size_type

Starting position within this string to perform comparison to

``size_type

Length of the substring of this string to perform comparison to

```this_type` const &

Comparand

`

Lexicographically compares the argument string literal to a part of this string

Throws: An `std::exception`-based exception if pos is out of range.

`pos <= size()`

Zero if the comparand equals this string, a negative value if this string is less than the comparand, a positive value if this string is greater than the comparand.

int `const_pointer

Comparand. Must point to a sequence of characters, must not be NULL.

``size_type

Number of characters in the sequence str.

`

Lexicographically compares the argument string to this string

Zero if the comparand equals this string, a negative value if this string is less than the comparand, a positive value if this string is greater than the comparand.

int `const_pointer

Comparand. Must point to a zero-terminated sequence of characters, must not be NULL.

`

Lexicographically compares the argument string to this string

Zero if the comparand equals this string, a negative value if this string is less than the comparand, a positive value if this string is greater than the comparand.

int``this_type` const &

Comparand

`

Lexicographically compares the argument string to this string

Zero if the comparand equals this string, a negative value if this string is less than the comparand, a positive value if this string is greater than the comparand.

Constructor

`empty() == true`

size_type `T(&)

A zero-terminated constant sequence of characters

`

Constructor from a string literal

`*this == p`

``basic_string_literal` const &

Source literal to copy string from

`

Copy constructor

`*this == that`

`this_type` &``this_type` const &

Source literal to copy string from

`

Assignment operator

`*this == that`

`this_type` & size_type `T(&)

A zero-terminated constant sequence of characters

`

Assignment from a string literal

`*this == p`

`std::basic_ostream< CharT, StrmTraitsT > & `std::basic_ostream< CharT, StrmTraitsT > &```basic_string_literal`< CharT, LitTraitsT > const &`Output operator.` `void ``basic_string_literal`< CharT, TraitsT > &```basic_string_literal`< CharT, TraitsT > &`External swap.` ``basic_string_literal`< T > std::size_t `T(&)`Creates a string literal wrapper from a constant string literal.`

Andrey Semashev

24.06.2007

The header contains forward declaration of a constant string literal wrapper. String literal type for narrow characters. `basic_string_literal`< char > String literal type for wide characters. `basic_string_literal`< wchar_t >

Andrey Semashev

13.03.2008

The header contains definition of date and time-related types supported by the library by default.

An MPL-sequence of natively supported date and time types of attributes

mpl::vector<>

An MPL-sequence of Boost date and time types of attributes

mpl::vector<>

An MPL-sequence with the complete list of the supported date and time types

mpl::vector<>

An MPL-sequence of natively supported date types of attributes

native_date_time_types

An MPL-sequence of Boost date types of attributes

mpl::vector<>

An MPL-sequence with the complete list of the supported date types

mpl::vector<>

An MPL-sequence of natively supported time types

native_date_time_types An MPL-sequence of Boost time types. boost_date_time_types

An MPL-sequence with the complete list of the supported time types

date_time_types

An MPL-sequence of natively supported time duration types of attributes

mpl::vector<>

An MPL-sequence of Boost time duration types of attributes

mpl::vector<>

An MPL-sequence with the complete list of the supported time duration types

mpl::vector<>

An MPL-sequence of Boost time duration types of attributes

mpl::vector<>

An MPL-sequence with the complete list of the supported time period types

boost_time_period_types Boost.Preprocessor sequence of the standard C date/time types. Boost.Preprocessor sequence of the standard C date types. Boost.Preprocessor sequence of the Boost date/time types. Boost.Preprocessor sequence of date/time types. Boost.Preprocessor sequence of the Boost date types. Boost.Preprocessor sequence of date types. Boost.Preprocessor sequence of the standard time duration types. Boost.Preprocessor sequence of the Boost time duration types. Boost.Preprocessor sequence of time duration types. Boost.Preprocessor sequence of the Boost time period types. Boost.Preprocessor sequence of time period types.

Andrey Semashev

15.04.2007

The header contains implementation of the run-time type dispatcher. type_dispatcher A dynamic type dispatcher.

The type dispatcher can be used to pass objects of arbitrary types from one component to another. With regard to the library, the type dispatcher can be used to extract attribute values.

The dynamic type dispatcher can be initialized in run time and, therefore, can support different types, depending on runtime conditions. Each supported type is associated with a functional object that will be called when an object of the type is dispatched.

void `VisitorT const &

Function object that will be associated with the type `T`

`

The method registers a new type

dispatching_map::size_type

The method returns the number of registered types

Default constructor

``dynamic_type_dispatcher` const &`

Copy constructor

`dynamic_type_dispatcher` &``dynamic_type_dispatcher` const &`

Copy assignment

Andrey Semashev

19.05.2007

The header contains definition of standard types supported by the library by default.

An MPL-sequence of integral types of attributes, supported by default

mpl::vector<>

An MPL-sequence of FP types of attributes, supported by default

mpl::vector<>

An MPL-sequence of all numeric types of attributes, supported by default

mpl::vector<> Deprecated alias. arithmetic_types

An MPL-sequence of string types of attributes, supported by default

mpl::vector<> Deprecated alias. default_attribute_value_types `typedef`mpl::vector``BOOST_PP_SEQ_SIZE((bool)(signed char)(unsigned char)(short)(unsigned short)(int)(unsigned int)(long)(unsigned long)(char)(wchar_t)(char16_t)(char32_t)(float)(double)(long double)(std::string)(`boost::log::string_literal`)(std::wstring)(`boost::log::wstring_literal`))`

An MPL-sequence of all attribute value types that are supported by the library by default.

` Boost.Preprocessor sequence of character types. Boost.Preprocessor sequence of integral types. Boost.Preprocessor sequence of floating point types. Boost.Preprocessor sequence of arithmetic types. Boost.Preprocessor sequence of string types. Boost.Preprocessor sequence of the default attribute value types supported by the library.

Andrey Semashev

15.04.2007

The header contains implementation of a compile-time type dispatcher. A static type dispatcher class.

The type dispatcher can be used to pass objects of arbitrary types from one component to another. With regard to the library, the type dispatcher can be used to extract attribute values.

Static type dispatchers allow to specify one or several supported types at compile time.

`ReceiverT &

Unary function object that will be called on a dispatched value. The receiver must be callable with an argument of any of the supported types of the dispatcher.

`

Constructor. Initializes the dispatcher internals.

The receiver object is not copied inside the dispatcher, but references to it may be kept by the dispatcher after construction. The receiver object must remain valid until the dispatcher is destroyed.

``static_type_dispatcher` const &` `static_type_dispatcher` &``static_type_dispatcher` const &`

Andrey Semashev

15.04.2007

The header contains definition of generic type dispatcher interfaces. A type dispatcher interface.

All type dispatchers support this interface. It is used to acquire the visitor interface for the requested type.

This interface is used by type dispatchers to consume the dispatched value.

void `T const &

The dispatched value

`

The operator invokes the visitor-specific logic with the given value

bool

The operator checks if the visitor is attached to a receiver

bool

The operator checks if the visitor is not attached to a receiver

`get_callback_impl_type`

Initializing constructor

``type_dispatcher` const &` `type_dispatcher` &``type_dispatcher` const &` `callback`< T >

The method requests a callback for the value of type `T`

The type-specific callback or an empty value, if the type is not supported

Andrey Semashev

15.04.2007

The header contains implementation of a type information wrapper. A simple `std::type_info` wrapper that implements value semantic for type information objects.

The type info wrapper is very useful for storing type information objects in containers, as a key or value. It also provides a number of useful features, such as default construction and assignment support, an empty state and extended support for human-friendly type names.

bool

`true` if the type info wrapper was initialized with a particular type, `false` if the wrapper was default-constructed and not yet initialized

std::type_info const &

Stored type info getter

`!!*this`

Constant reference to the wrapped type info object

void``type_info_wrapper` &`

Swaps two instances of the wrapper

std::string

The method returns the contained type name string in a possibly more readable format than `get().name()`

`!!*this`

Type name string

bool

`false` if the type info wrapper was initialized with a particular type, `true` if the wrapper was default-constructed and not yet initialized

bool``type_info_wrapper` const &

Comparand

`

Equality comparison

If either this object or comparand is in empty state and the other is not, the result is `false`. If both arguments are empty, the result is `true`. If both arguments are not empty, the result is `true` if this object wraps the same type as the comparand and `false` otherwise.

bool``type_info_wrapper` const &

Comparand

`

Ordering operator

The results of this operator are only consistent within a single run of application. The result may change for the same types after rebuilding or even restarting the application.

`!!*this && !!that`

`true` if this object wraps type info object that is ordered before the type info object in the comparand, `false` otherwise

Default constructor

`!*this == true`

``type_info_wrapper` const &

Source type info wrapper to copy from

`

Copy constructor

`*this == that`

`std::type_info const &

Type info object to be wrapped

`

Conversion constructor

`*this == that && !!*this`

`bool``type_info_wrapper` const &```type_info_wrapper` const &`Inequality operator.` `bool``type_info_wrapper` const &```type_info_wrapper` const &`Ordering operator.` `bool``type_info_wrapper` const &```type_info_wrapper` const &`Ordering operator.` `bool``type_info_wrapper` const &```type_info_wrapper` const &`Ordering operator.` `void``type_info_wrapper` &```type_info_wrapper` &`Free swap for type info wrapper.` `std::string``type_info_wrapper` const &`The function for exception serialization to string.`

Andrey Semashev

30.04.2008

The header contains `BOOST_LOG_UNIQUE_IDENTIFIER_NAME` macro definition.

Constructs a unique (in the current file scope) token that can be used as a variable name. The name will contain a prefix passed in the prefix argument. This allows to use the macro multiple times on a single line.

Andrey Semashev

10.05.2008

The header contains definition of a macro to suppress compiler warnings about unused variables. The macro suppresses compiler warnings for `var` being unused.

Andrey Semashev

27.07.2012

The header contains implementation of a value reference wrapper. Reference wrapper for a stored attribute value.

The ``value_ref`` class template provides access to the stored attribute value. It is not a traditional reference wrapper since it may be empty (i.e. refer to no value at all) and it can also refer to values of different types. Therefore its interface and behavior combines features of Boost.Ref, Boost.Optional and Boost.Variant, depending on the use case.

The template parameter `T` can be a single type or an MPL sequence of possible types being referred. The reference wrapper will act as either an optional reference or an optional variant of references to the specified types. In any case, the referred values will not be modifiable (i.e. ``value_ref`` always models a const reference).

Template parameter `TagT` is optional. It can be used for customizing the operations on this reference wrapper, such as putting the referred value to log.

bool

The operator verifies if the wrapper refers to a value.

bool

The operator verifies if the wrapper does not refer to a value.

bool

`true` if the wrapper does not refer to a value.

void``value_ref` &`

Swaps two reference wrappers

Default constructor. Creates a reference wrapper that does not refer to a value.

``value_ref` const &`

Copy constructor.

`U const &``typename enable_if< typename base_type::template is_compatible< U >, int >::type0`

Initializing constructor. Creates a reference wrapper that refers to the specified value.

`void ``value_ref`< T, TagT > &```value_ref`< T, TagT > &`Free swap function.` `std::basic_ostream< CharT, TraitsT > & `std::basic_ostream< CharT, TraitsT > &```value_ref`< T, TagT > const &`Stream output operator.` ``basic_formatting_ostream`< CharT, TraitsT, AllocatorT > & ``basic_formatting_ostream`< CharT, TraitsT, AllocatorT > &```value_ref`< T, TagT > const &`Log formatting operator.` `bool ``value_ref`< T, TagT > const &``U const &`` `bool `U const &```value_ref`< T, TagT > const &`` `bool ``value_ref`< T1, TagT1 > const &```value_ref`< T2, TagT2 > const &`` `bool ``value_ref`< T, TagT > const &``U const &`` `bool `U const &```value_ref`< T, TagT > const &`` `bool ``value_ref`< T1, TagT1 > const &```value_ref`< T2, TagT2 > const &`` `bool ``value_ref`< T, TagT > const &``U const &`` `bool `U const &```value_ref`< T, TagT > const &`` `bool ``value_ref`< T1, TagT1 > const &```value_ref`< T2, TagT2 > const &`` `bool ``value_ref`< T, TagT > const &``U const &`` `bool `U const &```value_ref`< T, TagT > const &`` `bool ``value_ref`< T1, TagT1 > const &```value_ref`< T2, TagT2 > const &`` `bool ``value_ref`< T, TagT > const &``U const &`` `bool `U const &```value_ref`< T, TagT > const &`` `bool ``value_ref`< T1, TagT1 > const &```value_ref`< T2, TagT2 > const &`` `bool ``value_ref`< T, TagT > const &``U const &`` `bool `U const &```value_ref`< T, TagT > const &`` `bool ``value_ref`< T1, TagT1 > const &```value_ref`< T2, TagT2 > const &``

Andrey Semashev

27.07.2012

The header contains forward declaration of a value reference wrapper.