Boost C++ Libraries

PrevUpHomeNext

Function template extract_or_throw

boost::log::extract_or_throw

Synopsis

// In header: <boost/log/attributes/value_extraction.hpp>


template<typename T, typename TagT = void> 
  result_of::extract_or_throw< T, TagT >::type 
  extract_or_throw(attribute_name const & name, record const & rec);

Description

The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.

Parameters:

name

The name of the attribute value to extract.

rec

A log record. The attribute value will be sought among those associated with the record.

Returns:

The extracted value or a non-empty value_ref that refers to the value.

Throws:

An exception is thrown if the requested value cannot be extracted.

PrevUpHomeNext