...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::value_extractor — Generic attribute value extractor.
// In header: <boost/log/attributes/value_extraction_fwd.hpp> template<typename T, typename FallbackPolicyT, typename TagT> class value_extractor : private FallbackPolicyT { public: // construct/copy/destruct value_extractor(value_extractor const &); template<typename U> explicit value_extractor(U const &); // public member functions result_type operator()(attribute_value const &) const; result_type operator()(attribute_name const &, attribute_value_set const &) const; result_type operator()(attribute_name const &, record const &) const; result_type operator()(attribute_name const &, record_view const &) const; fallback_policy const & get_fallback_policy() const; };
Attribute value extractor is a functional object that attempts to find and extract the stored attribute value from the attribute values view or a log record. The extracted value is returned from the extractor.
value_extractor
public
construct/copy/destructvalue_extractor(value_extractor const & that);
Default constructor
Copy constructor
template<typename U> explicit value_extractor(U const & arg);
Constructor
Parameters: |
|
value_extractor
public member functionsresult_type operator()(attribute_value const & attr) const;
Extraction operator. Attempts to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.
Parameters: |
|
||
Returns: |
The extracted value, if extraction succeeded, an empty value otherwise. |
result_type operator()(attribute_name const & name, attribute_value_set const & attrs) const;
Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.
Parameters: |
|
||||
Returns: |
The extracted value, if extraction succeeded, an empty value otherwise. |
result_type operator()(attribute_name const & name, record const & rec) const;
Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.
Parameters: |
|
||||
Returns: |
The extracted value, if extraction succeeded, an empty value otherwise. |
result_type operator()(attribute_name const & name, record_view const & rec) const;
Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.
Parameters: |
|
||||
Returns: |
The extracted value, if extraction succeeded, an empty value otherwise. |
fallback_policy const & get_fallback_policy() const;
Returns: |
Fallback policy |