...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::attributes::attribute_value_impl — Basic attribute value implementation class.
// In header: <boost/log/attributes/attribute_value_impl.hpp> template<typename T> class attribute_value_impl : public attribute_value::impl { public: // types typedef T value_type; // Value type. // public member functions explicit attribute_value_impl(value_type const &); explicit attribute_value_impl(value_type &&) noexcept(boost::is_nothrow_move_constructible< value_type >::value); virtual bool dispatch(type_dispatcher &); virtual typeindex::type_index get_type() const; value_type const & get() const; };
This class can be used as a boilerplate for simple attribute values. The class implements all needed interfaces of attribute values and allows to store a single value of the type specified as a template parameter. The stored value can be dispatched with type dispatching mechanism.
attribute_value_impl
public member functionsexplicit attribute_value_impl(value_type const & v);
Constructor with initialization of the stored value
explicit attribute_value_impl(value_type && v) noexcept(boost::is_nothrow_move_constructible< value_type >::value);
Constructor with initialization of the stored value
virtual bool dispatch(type_dispatcher & dispatcher);
Attribute value dispatching method.
Parameters: |
|
||
Returns: |
|
virtual typeindex::type_index get_type() const;
Returns: |
The attribute value type |
value_type const & get() const;
Returns: |
Reference to the contained value. |