File indexing completed on 2025-01-18 09:39:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef BOOST_LOG_ATTRIBUTES_VALUE_EXTRACTION_HPP_INCLUDED_
0017 #define BOOST_LOG_ATTRIBUTES_VALUE_EXTRACTION_HPP_INCLUDED_
0018
0019 #include <boost/mpl/vector.hpp>
0020 #include <boost/mpl/joint_view.hpp>
0021 #include <boost/mpl/if.hpp>
0022 #include <boost/mpl/eval_if.hpp>
0023 #include <boost/mpl/identity.hpp>
0024 #include <boost/mpl/is_sequence.hpp>
0025 #include <boost/mpl/contains.hpp>
0026 #include <boost/mpl/push_back.hpp>
0027 #include <boost/type_traits/is_same.hpp>
0028 #include <boost/core/enable_if.hpp>
0029 #include <boost/log/detail/config.hpp>
0030 #include <boost/log/exceptions.hpp>
0031 #include <boost/log/core/record.hpp>
0032 #include <boost/log/attributes/attribute_name.hpp>
0033 #include <boost/log/attributes/attribute_value.hpp>
0034 #include <boost/log/attributes/attribute.hpp>
0035 #include <boost/log/attributes/attribute_value_set.hpp>
0036 #include <boost/log/attributes/value_extraction_fwd.hpp>
0037 #include <boost/log/attributes/fallback_policy.hpp>
0038 #include <boost/log/expressions/keyword_fwd.hpp>
0039 #include <boost/log/utility/value_ref.hpp>
0040 #include <boost/log/utility/type_dispatch/static_type_dispatcher.hpp>
0041 #include <boost/log/detail/header.hpp>
0042
0043 #ifdef BOOST_HAS_PRAGMA_ONCE
0044 #pragma once
0045 #endif
0046
0047 namespace boost {
0048
0049 BOOST_LOG_OPEN_NAMESPACE
0050
0051 namespace result_of {
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062 template< typename T, typename DefaultT, typename TagT >
0063 struct extract_or_default
0064 {
0065 typedef typename mpl::eval_if<
0066 mpl::is_sequence< T >,
0067 mpl::eval_if<
0068 mpl::contains< T, DefaultT >,
0069 mpl::identity< T >,
0070 mpl::push_back< T, DefaultT >
0071 >,
0072 mpl::if_<
0073 is_same< T, DefaultT >,
0074 T,
0075 mpl::vector2< T, DefaultT >
0076 >
0077 >::type extracted_type;
0078
0079 typedef typename mpl::if_<
0080 mpl::is_sequence< extracted_type >,
0081 value_ref< extracted_type, TagT >,
0082 extracted_type const&
0083 >::type type;
0084 };
0085
0086
0087
0088
0089
0090
0091
0092
0093 template< typename T, typename TagT >
0094 struct extract_or_throw
0095 {
0096 typedef typename mpl::if_<
0097 mpl::is_sequence< T >,
0098 value_ref< T, TagT >,
0099 T const&
0100 >::type type;
0101 };
0102
0103
0104
0105
0106
0107
0108 template< typename T, typename TagT >
0109 struct extract
0110 {
0111 typedef value_ref< T, TagT > type;
0112 };
0113
0114 }
0115
0116 namespace aux {
0117
0118
0119 template< typename RefT >
0120 struct value_ref_initializer
0121 {
0122 typedef void result_type;
0123
0124 value_ref_initializer(RefT& ref) : m_ref(ref)
0125 {
0126 }
0127
0128 template< typename ArgT >
0129 result_type operator() (ArgT const& arg) const
0130 {
0131 m_ref = RefT(arg);
0132 }
0133
0134 private:
0135 RefT& m_ref;
0136 };
0137
0138
0139 template< typename T, typename TagT >
0140 BOOST_FORCEINLINE typename boost::enable_if_c< mpl::is_sequence< T >::value, value_ref< T, TagT > >::type
0141 unwrap_value_ref(value_ref< T, TagT > const& r)
0142 {
0143 return r;
0144 }
0145
0146 template< typename T, typename TagT >
0147 BOOST_FORCEINLINE typename boost::disable_if_c< mpl::is_sequence< T >::value, T const& >::type
0148 unwrap_value_ref(value_ref< T, TagT > const& r)
0149 {
0150 return r.get();
0151 }
0152
0153 }
0154
0155
0156
0157
0158
0159
0160
0161
0162 template< typename T, typename FallbackPolicyT, typename TagT >
0163 class value_extractor :
0164 private FallbackPolicyT
0165 {
0166 public:
0167
0168 typedef FallbackPolicyT fallback_policy;
0169
0170 typedef T value_type;
0171
0172 typedef value_ref< value_type, TagT > result_type;
0173
0174 public:
0175
0176
0177
0178 BOOST_DEFAULTED_FUNCTION(value_extractor(), {})
0179
0180
0181
0182
0183 value_extractor(value_extractor const& that) : fallback_policy(static_cast< fallback_policy const& >(that))
0184 {
0185 }
0186
0187
0188
0189
0190
0191
0192 template< typename U >
0193 explicit value_extractor(U const& arg) : fallback_policy(arg) {}
0194
0195
0196
0197
0198
0199
0200
0201
0202 result_type operator() (attribute_value const& attr) const
0203 {
0204 result_type res;
0205 aux::value_ref_initializer< result_type > initializer(res);
0206 if (!!attr)
0207 {
0208 static_type_dispatcher< value_type > disp(initializer);
0209 if (!attr.dispatch(disp) && !fallback_policy::apply_default(initializer))
0210 fallback_policy::on_invalid_type(attr.get_type());
0211 }
0212 else if (!fallback_policy::apply_default(initializer))
0213 {
0214 fallback_policy::on_missing_value();
0215 }
0216 return res;
0217 }
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228 result_type operator() (attribute_name const& name, attribute_value_set const& attrs) const
0229 {
0230 try
0231 {
0232 attribute_value_set::const_iterator it = attrs.find(name);
0233 if (it != attrs.end())
0234 return operator() (it->second);
0235 else
0236 return operator() (attribute_value());
0237 }
0238 catch (exception& e)
0239 {
0240
0241 boost::log::aux::attach_attribute_name_info(e, name);
0242 throw;
0243 }
0244 }
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255 result_type operator() (attribute_name const& name, record const& rec) const
0256 {
0257 return operator() (name, rec.attribute_values());
0258 }
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269 result_type operator() (attribute_name const& name, record_view const& rec) const
0270 {
0271 return operator() (name, rec.attribute_values());
0272 }
0273
0274
0275
0276
0277 fallback_policy const& get_fallback_policy() const
0278 {
0279 return *static_cast< fallback_policy const* >(this);
0280 }
0281 };
0282
0283 #if !defined(BOOST_LOG_DOXYGEN_PASS)
0284 #if !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
0285 #define BOOST_LOG_AUX_VOID_DEFAULT = void
0286 #else
0287 #define BOOST_LOG_AUX_VOID_DEFAULT
0288 #endif
0289 #endif
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT >
0300 inline typename result_of::extract< T, TagT >::type extract(attribute_name const& name, attribute_value_set const& attrs)
0301 {
0302 value_extractor< T, fallback_to_none, TagT > extractor;
0303 return extractor(name, attrs);
0304 }
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT >
0315 inline typename result_of::extract< T, TagT >::type extract(attribute_name const& name, record const& rec)
0316 {
0317 value_extractor< T, fallback_to_none, TagT > extractor;
0318 return extractor(name, rec);
0319 }
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT >
0330 inline typename result_of::extract< T, TagT >::type extract(attribute_name const& name, record_view const& rec)
0331 {
0332 value_extractor< T, fallback_to_none, TagT > extractor;
0333 return extractor(name, rec);
0334 }
0335
0336
0337
0338
0339
0340
0341
0342
0343 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT >
0344 inline typename result_of::extract< T, TagT >::type extract(attribute_value const& value)
0345 {
0346 value_extractor< T, fallback_to_none, TagT > extractor;
0347 return extractor(value);
0348 }
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT >
0360 inline typename result_of::extract_or_throw< T, TagT >::type extract_or_throw(attribute_name const& name, attribute_value_set const& attrs)
0361 {
0362 value_extractor< T, fallback_to_throw, TagT > extractor;
0363 return aux::unwrap_value_ref(extractor(name, attrs));
0364 }
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT >
0376 inline typename result_of::extract_or_throw< T, TagT >::type extract_or_throw(attribute_name const& name, record const& rec)
0377 {
0378 value_extractor< T, fallback_to_throw, TagT > extractor;
0379 return aux::unwrap_value_ref(extractor(name, rec));
0380 }
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT >
0392 inline typename result_of::extract_or_throw< T, TagT >::type extract_or_throw(attribute_name const& name, record_view const& rec)
0393 {
0394 value_extractor< T, fallback_to_throw, TagT > extractor;
0395 return aux::unwrap_value_ref(extractor(name, rec));
0396 }
0397
0398
0399
0400
0401
0402
0403
0404
0405
0406 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT >
0407 inline typename result_of::extract_or_throw< T, TagT >::type extract_or_throw(attribute_value const& value)
0408 {
0409 value_extractor< T, fallback_to_throw, TagT > extractor;
0410 return aux::unwrap_value_ref(extractor(value));
0411 }
0412
0413
0414
0415
0416
0417
0418
0419
0420
0421
0422
0423
0424
0425 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT, typename DefaultT >
0426 inline typename result_of::extract_or_default< T, DefaultT, TagT >::type
0427 extract_or_default(attribute_name const& name, attribute_value_set const& attrs, DefaultT const& def_val)
0428 {
0429 typedef typename result_of::extract_or_default< T, DefaultT, TagT >::extracted_type extracted_type;
0430 value_extractor< extracted_type, fallback_to_default< DefaultT const& >, TagT > extractor(def_val);
0431 return aux::unwrap_value_ref(extractor(name, attrs));
0432 }
0433
0434
0435
0436
0437
0438
0439
0440
0441
0442
0443
0444
0445
0446 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT, typename DefaultT >
0447 inline typename result_of::extract_or_default< T, DefaultT, TagT >::type
0448 extract_or_default(attribute_name const& name, record const& rec, DefaultT const& def_val)
0449 {
0450 typedef typename result_of::extract_or_default< T, DefaultT, TagT >::extracted_type extracted_type;
0451 value_extractor< extracted_type, fallback_to_default< DefaultT const& >, TagT > extractor(def_val);
0452 return aux::unwrap_value_ref(extractor(name, rec));
0453 }
0454
0455
0456
0457
0458
0459
0460
0461
0462
0463
0464
0465
0466
0467 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT, typename DefaultT >
0468 inline typename result_of::extract_or_default< T, DefaultT, TagT >::type
0469 extract_or_default(attribute_name const& name, record_view const& rec, DefaultT const& def_val)
0470 {
0471 typedef typename result_of::extract_or_default< T, DefaultT, TagT >::extracted_type extracted_type;
0472 value_extractor< extracted_type, fallback_to_default< DefaultT const& >, TagT > extractor(def_val);
0473 return aux::unwrap_value_ref(extractor(name, rec));
0474 }
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487 template< typename T, typename TagT BOOST_LOG_AUX_VOID_DEFAULT, typename DefaultT >
0488 inline typename result_of::extract_or_default< T, DefaultT, TagT >::type extract_or_default(attribute_value const& value, DefaultT const& def_val)
0489 {
0490 typedef typename result_of::extract_or_default< T, DefaultT, TagT >::extracted_type extracted_type;
0491 value_extractor< extracted_type, fallback_to_default< DefaultT const& >, TagT > extractor(def_val);
0492 return aux::unwrap_value_ref(extractor(value));
0493 }
0494
0495 #if defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
0496
0497 template< typename T >
0498 inline typename result_of::extract< T >::type extract(attribute_name const& name, attribute_value_set const& attrs)
0499 {
0500 value_extractor< T, fallback_to_none > extractor;
0501 return extractor(name, attrs);
0502 }
0503
0504 template< typename T >
0505 inline typename result_of::extract< T >::type extract(attribute_name const& name, record const& rec)
0506 {
0507 value_extractor< T, fallback_to_none > extractor;
0508 return extractor(name, rec);
0509 }
0510
0511 template< typename T >
0512 inline typename result_of::extract< T >::type extract(attribute_name const& name, record_view const& rec)
0513 {
0514 value_extractor< T, fallback_to_none > extractor;
0515 return extractor(name, rec);
0516 }
0517
0518 template< typename T >
0519 inline typename result_of::extract< T >::type extract(attribute_value const& value)
0520 {
0521 value_extractor< T, fallback_to_none > extractor;
0522 return extractor(value);
0523 }
0524
0525 template< typename T >
0526 inline typename result_of::extract_or_throw< T >::type extract_or_throw(attribute_name const& name, attribute_value_set const& attrs)
0527 {
0528 value_extractor< T, fallback_to_throw > extractor;
0529 return aux::unwrap_value_ref(extractor(name, attrs));
0530 }
0531
0532 template< typename T >
0533 inline typename result_of::extract_or_throw< T >::type extract_or_throw(attribute_name const& name, record const& rec)
0534 {
0535 value_extractor< T, fallback_to_throw > extractor;
0536 return aux::unwrap_value_ref(extractor(name, rec));
0537 }
0538
0539 template< typename T >
0540 inline typename result_of::extract_or_throw< T >::type extract_or_throw(attribute_name const& name, record_view const& rec)
0541 {
0542 value_extractor< T, fallback_to_throw > extractor;
0543 return aux::unwrap_value_ref(extractor(name, rec));
0544 }
0545
0546 template< typename T >
0547 inline typename result_of::extract_or_throw< T >::type extract_or_throw(attribute_value const& value)
0548 {
0549 value_extractor< T, fallback_to_throw > extractor;
0550 return aux::unwrap_value_ref(extractor(value));
0551 }
0552
0553 template< typename T, typename DefaultT >
0554 inline typename result_of::extract_or_default< T, DefaultT >::type extract_or_default(
0555 attribute_name const& name, attribute_value_set const& attrs, DefaultT const& def_val)
0556 {
0557 typedef typename result_of::extract_or_default< T, DefaultT >::extracted_type extracted_type;
0558 value_extractor< extracted_type, fallback_to_default< DefaultT const& > > extractor(def_val);
0559 return aux::unwrap_value_ref(extractor(name, attrs));
0560 }
0561
0562 template< typename T, typename DefaultT >
0563 inline typename result_of::extract_or_default< T, DefaultT >::type extract_or_default(
0564 attribute_name const& name, record const& rec, DefaultT const& def_val)
0565 {
0566 typedef typename result_of::extract_or_default< T, DefaultT >::extracted_type extracted_type;
0567 value_extractor< extracted_type, fallback_to_default< DefaultT const& > > extractor(def_val);
0568 return aux::unwrap_value_ref(extractor(name, rec));
0569 }
0570
0571 template< typename T, typename DefaultT >
0572 inline typename result_of::extract_or_default< T, DefaultT >::type extract_or_default(
0573 attribute_name const& name, record_view const& rec, DefaultT const& def_val)
0574 {
0575 typedef typename result_of::extract_or_default< T, DefaultT >::extracted_type extracted_type;
0576 value_extractor< extracted_type, fallback_to_default< DefaultT const& > > extractor(def_val);
0577 return aux::unwrap_value_ref(extractor(name, rec));
0578 }
0579
0580 template< typename T, typename DefaultT >
0581 inline typename result_of::extract_or_default< T, DefaultT >::type extract_or_default(attribute_value const& value, DefaultT const& def_val)
0582 {
0583 typedef typename result_of::extract_or_default< T, DefaultT >::extracted_type extracted_type;
0584 value_extractor< extracted_type, fallback_to_default< DefaultT const& > > extractor(def_val);
0585 return aux::unwrap_value_ref(extractor(value));
0586 }
0587
0588 #endif
0589
0590
0591
0592
0593
0594
0595
0596
0597
0598 template< typename DescriptorT, template< typename > class ActorT >
0599 inline typename result_of::extract< typename DescriptorT::value_type, DescriptorT >::type
0600 extract(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, attribute_value_set const& attrs)
0601 {
0602 value_extractor< typename DescriptorT::value_type, fallback_to_none, DescriptorT > extractor;
0603 return extractor(keyword.get_name(), attrs);
0604 }
0605
0606
0607
0608
0609
0610
0611
0612
0613
0614 template< typename DescriptorT, template< typename > class ActorT >
0615 inline typename result_of::extract< typename DescriptorT::value_type, DescriptorT >::type
0616 extract(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, record const& rec)
0617 {
0618 value_extractor< typename DescriptorT::value_type, fallback_to_none, DescriptorT > extractor;
0619 return extractor(keyword.get_name(), rec);
0620 }
0621
0622
0623
0624
0625
0626
0627
0628
0629
0630 template< typename DescriptorT, template< typename > class ActorT >
0631 inline typename result_of::extract< typename DescriptorT::value_type, DescriptorT >::type
0632 extract(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, record_view const& rec)
0633 {
0634 value_extractor< typename DescriptorT::value_type, fallback_to_none, DescriptorT > extractor;
0635 return extractor(keyword.get_name(), rec);
0636 }
0637
0638
0639
0640
0641
0642
0643
0644
0645
0646
0647 template< typename DescriptorT, template< typename > class ActorT >
0648 inline typename result_of::extract_or_throw< typename DescriptorT::value_type, DescriptorT >::type
0649 extract_or_throw(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, attribute_value_set const& attrs)
0650 {
0651 value_extractor< typename DescriptorT::value_type, fallback_to_throw, DescriptorT > extractor;
0652 return aux::unwrap_value_ref(extractor(keyword.get_name(), attrs));
0653 }
0654
0655
0656
0657
0658
0659
0660
0661
0662
0663
0664 template< typename DescriptorT, template< typename > class ActorT >
0665 inline typename result_of::extract_or_throw< typename DescriptorT::value_type, DescriptorT >::type
0666 extract_or_throw(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, record const& rec)
0667 {
0668 value_extractor< typename DescriptorT::value_type, fallback_to_throw, DescriptorT > extractor;
0669 return aux::unwrap_value_ref(extractor(keyword.get_name(), rec));
0670 }
0671
0672
0673
0674
0675
0676
0677
0678
0679
0680
0681 template< typename DescriptorT, template< typename > class ActorT >
0682 inline typename result_of::extract_or_throw< typename DescriptorT::value_type, DescriptorT >::type
0683 extract_or_throw(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, record_view const& rec)
0684 {
0685 value_extractor< typename DescriptorT::value_type, fallback_to_throw, DescriptorT > extractor;
0686 return aux::unwrap_value_ref(extractor(keyword.get_name(), rec));
0687 }
0688
0689
0690
0691
0692
0693
0694
0695
0696
0697
0698
0699
0700
0701 template< typename DescriptorT, template< typename > class ActorT, typename DefaultT >
0702 inline typename result_of::extract_or_default< typename DescriptorT::value_type, DefaultT, DescriptorT >::type
0703 extract_or_default(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, attribute_value_set const& attrs, DefaultT const& def_val)
0704 {
0705 typedef typename result_of::extract_or_default< typename DescriptorT::value_type, DefaultT, DescriptorT >::extracted_type extracted_type;
0706 value_extractor< extracted_type, fallback_to_default< DefaultT const& >, DescriptorT > extractor(def_val);
0707 return aux::unwrap_value_ref(extractor(keyword.get_name(), attrs));
0708 }
0709
0710
0711
0712
0713
0714
0715
0716
0717
0718
0719
0720
0721
0722 template< typename DescriptorT, template< typename > class ActorT, typename DefaultT >
0723 inline typename result_of::extract_or_default< typename DescriptorT::value_type, DefaultT, DescriptorT >::type
0724 extract_or_default(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, record const& rec, DefaultT const& def_val)
0725 {
0726 typedef typename result_of::extract_or_default< typename DescriptorT::value_type, DefaultT, DescriptorT >::extracted_type extracted_type;
0727 value_extractor< extracted_type, fallback_to_default< DefaultT const& >, DescriptorT > extractor(def_val);
0728 return aux::unwrap_value_ref(extractor(keyword.get_name(), rec));
0729 }
0730
0731
0732
0733
0734
0735
0736
0737
0738
0739
0740
0741
0742
0743 template< typename DescriptorT, template< typename > class ActorT, typename DefaultT >
0744 inline typename result_of::extract_or_default< typename DescriptorT::value_type, DefaultT, DescriptorT >::type
0745 extract_or_default(expressions::attribute_keyword< DescriptorT, ActorT > const& keyword, record_view const& rec, DefaultT const& def_val)
0746 {
0747 typedef typename result_of::extract_or_default< typename DescriptorT::value_type, DefaultT, DescriptorT >::extracted_type extracted_type;
0748 value_extractor< extracted_type, fallback_to_default< DefaultT const& >, DescriptorT > extractor(def_val);
0749 return aux::unwrap_value_ref(extractor(keyword.get_name(), rec));
0750 }
0751
0752 #if !defined(BOOST_LOG_DOXYGEN_PASS)
0753
0754 template< typename T, typename TagT >
0755 inline typename result_of::extract< T, TagT >::type attribute_value::extract() const
0756 {
0757 return boost::log::extract< T, TagT >(*this);
0758 }
0759
0760 template< typename T, typename TagT >
0761 inline typename result_of::extract_or_throw< T, TagT >::type attribute_value::extract_or_throw() const
0762 {
0763 return boost::log::extract_or_throw< T, TagT >(*this);
0764 }
0765
0766 template< typename T, typename TagT >
0767 inline typename result_of::extract_or_default< T, T, TagT >::type attribute_value::extract_or_default(T const& def_value) const
0768 {
0769 return boost::log::extract_or_default< T, TagT >(*this, def_value);
0770 }
0771
0772 template< typename T, typename TagT, typename DefaultT >
0773 inline typename result_of::extract_or_default< T, DefaultT, TagT >::type attribute_value::extract_or_default(DefaultT const& def_value) const
0774 {
0775 return boost::log::extract_or_default< T, TagT >(*this, def_value);
0776 }
0777
0778 #if defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
0779
0780 template< typename T >
0781 inline typename result_of::extract< T >::type attribute_value::extract() const
0782 {
0783 return boost::log::extract< T >(*this);
0784 }
0785
0786 template< typename T >
0787 inline typename result_of::extract_or_throw< T >::type attribute_value::extract_or_throw() const
0788 {
0789 return boost::log::extract_or_throw< T >(*this);
0790 }
0791
0792 template< typename T >
0793 inline typename result_of::extract_or_default< T, T >::type attribute_value::extract_or_default(T const& def_value) const
0794 {
0795 return boost::log::extract_or_default< T >(*this, def_value);
0796 }
0797
0798 template< typename T, typename DefaultT >
0799 inline typename result_of::extract_or_default< T, DefaultT >::type attribute_value::extract_or_default(DefaultT const& def_value) const
0800 {
0801 return boost::log::extract_or_default< T >(*this, def_value);
0802 }
0803
0804 #endif
0805
0806 #endif
0807
0808 #undef BOOST_LOG_AUX_VOID_DEFAULT
0809
0810 BOOST_LOG_CLOSE_NAMESPACE
0811
0812 }
0813
0814 #include <boost/log/detail/footer.hpp>
0815
0816 #endif