File indexing completed on 2025-01-18 09:39:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_LOG_ATTRIBUTES_CLOCK_HPP_INCLUDED_
0016 #define BOOST_LOG_ATTRIBUTES_CLOCK_HPP_INCLUDED_
0017
0018 #include <boost/log/detail/config.hpp>
0019 #include <boost/log/attributes/attribute.hpp>
0020 #include <boost/log/attributes/attribute_value.hpp>
0021 #include <boost/log/attributes/attribute_cast.hpp>
0022 #include <boost/log/attributes/attribute_value_impl.hpp>
0023 #include <boost/log/attributes/time_traits.hpp>
0024 #include <boost/log/detail/header.hpp>
0025
0026 #ifdef BOOST_HAS_PRAGMA_ONCE
0027 #pragma once
0028 #endif
0029
0030 namespace boost {
0031
0032 BOOST_LOG_OPEN_NAMESPACE
0033
0034 namespace attributes {
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 template< typename TimeTraitsT >
0048 class basic_clock :
0049 public attribute
0050 {
0051 public:
0052
0053 typedef typename TimeTraitsT::time_type value_type;
0054
0055 protected:
0056
0057 struct BOOST_SYMBOL_VISIBLE impl :
0058 public attribute::impl
0059 {
0060 attribute_value get_value()
0061 {
0062 typedef attribute_value_impl< value_type > result_value;
0063 return attribute_value(new result_value(TimeTraitsT::get_clock()));
0064 }
0065 };
0066
0067 public:
0068
0069
0070
0071 basic_clock() : attribute(new impl())
0072 {
0073 }
0074
0075
0076
0077 explicit basic_clock(cast_source const& source) : attribute(source.as< impl >())
0078 {
0079 }
0080 };
0081
0082
0083 typedef basic_clock< utc_time_traits > utc_clock;
0084
0085 typedef basic_clock< local_time_traits > local_clock;
0086
0087 }
0088
0089 BOOST_LOG_CLOSE_NAMESPACE
0090
0091 }
0092
0093 #include <boost/log/detail/footer.hpp>
0094
0095 #endif