/usr/include/boost/log/attributes
NameSizeModeActions
attribute.hpp52300644editdlrm
attribute_cast.hpp17800644editdlrm
attribute_name.hpp57990644editdlrm
attribute_set.hpp171400644editdlrm
attribute_value.hpp162770644editdlrm
attribute_value_impl.hpp40750644editdlrm
attribute_value_set.hpp169540644editdlrm
clock.hpp26870644editdlrm
constant.hpp35470644editdlrm
counter.hpp30720644editdlrm
current_process_id.hpp16900644editdlrm
current_process_name.hpp17030644editdlrm
current_thread_id.hpp28850644editdlrm
fallback_policy.hpp47310644editdlrm
fallback_policy_fwd.hpp13120644editdlrm
function.hpp46120644editdlrm
mutable_constant.hpp91400644editdlrm
named_scope.hpp149750644editdlrm
scoped_attribute.hpp81410644editdlrm
timer.hpp24690644editdlrm
time_traits.hpp19670644editdlrm
value_extraction.hpp349270644editdlrm
value_extraction_fwd.hpp15940644editdlrm
value_visitation.hpp136120644editdlrm
value_visitation_fwd.hpp11500644editdlrm
Edit: /usr/include/boost/log/attributes/fallback_policy.hpp (4731B)
/* * Copyright Andrey Semashev 2007 - 2015. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) */ /*! * \file fallback_policy.hpp * \author Andrey Semashev * \date 18.08.2012 * * The header contains definition of fallback policies when attribute value visitation or extraction fails. */ #ifndef BOOST_LOG_ATTRIBUTES_FALLBACK_POLICY_HPP_INCLUDED_ #define BOOST_LOG_ATTRIBUTES_FALLBACK_POLICY_HPP_INCLUDED_ #include #include #include #include #include #include #include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif namespace boost { BOOST_LOG_OPEN_NAMESPACE /*! * The \c fallback_to_none policy results in returning an empty value reference if the attribute value cannot be extracted. */ struct fallback_to_none { enum { guaranteed_result = false }; /*! * The method is called in order to apply a function object to the default value. */ template< typename FunT > static bool apply_default(FunT&) { return false; } /*! * The method is called in order to apply a function object to the default value. */ template< typename FunT > static bool apply_default(FunT const&) { return false; } /*! * The method is called when value extraction failed because the attribute value has different type than requested. */ static void on_invalid_type(typeindex::type_index const&) { } /*! * The method is called when value extraction failed because the attribute value was not found. */ static void on_missing_value() { } }; /*! * The \c fallback_to_throw policy results in throwing an exception if the attribute value cannot be extracted. */ struct fallback_to_throw { enum { guaranteed_result = true }; /*! * The method is called in order to apply a function object to the default value. */ template< typename FunT > static bool apply_default(FunT&) { return false; } /*! * The method is called in order to apply a function object to the default value. */ template< typename FunT > static bool apply_default(FunT const&) { return false; } /*! * The method is called when value extraction failed because the attribute value has different type than requested. */ static void on_invalid_type(typeindex::type_index const& t) { BOOST_LOG_THROW_DESCR_PARAMS(invalid_type, "Attribute value has incompatible type", (t)); } /*! * The method is called when value extraction failed because the attribute value was not found. */ static void on_missing_value() { BOOST_LOG_THROW_DESCR(missing_value, "Attribute value not found"); } }; /*! * The \c fallback_to_default policy results in a default value if the attribute value cannot be extracted. */ template< typename DefaultT > struct fallback_to_default { enum { guaranteed_result = true }; //! Default value type typedef typename remove_cv< typename remove_reference< DefaultT >::type >::type default_type; /*! * Default constructor. */ fallback_to_default() : m_default() { } /*! * Initializing constructor. */ explicit fallback_to_default(default_type const& def_val) : m_default(def_val) { } /*! * The method is called in order to apply a function object to the default value. */ template< typename FunT > bool apply_default(FunT& fun) const { fun(m_default); return true; } /*! * The method is called in order to apply a function object to the default value. */ template< typename FunT > bool apply_default(FunT const& fun) const { fun(m_default); return true; } /*! * The method is called when value extraction failed because the attribute value has different type than requested. */ static void on_invalid_type(typeindex::type_index const&) { } /*! * The method is called when value extraction failed because the attribute value was not found. */ static void on_missing_value() { } private: //! Default value DefaultT m_default; }; BOOST_LOG_CLOSE_NAMESPACE // namespace log } // namespace boost #include #endif // BOOST_LOG_ATTRIBUTES_FALLBACK_POLICY_HPP_INCLUDED_