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 #ifndef BOOST_LOG_CORE_RECORD_HPP_INCLUDED_
0016 #define BOOST_LOG_CORE_RECORD_HPP_INCLUDED_
0017
0018 #include <boost/move/core.hpp>
0019 #include <boost/core/explicit_operator_bool.hpp>
0020 #include <boost/log/detail/config.hpp>
0021 #include <boost/log/attributes/attribute_value_set.hpp>
0022 #include <boost/log/expressions/keyword_fwd.hpp>
0023 #include <boost/log/core/record_view.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 class core;
0035
0036
0037
0038
0039
0040
0041
0042
0043 class record
0044 {
0045 BOOST_MOVABLE_BUT_NOT_COPYABLE(record)
0046
0047 friend class core;
0048
0049 #ifndef BOOST_LOG_DOXYGEN_PASS
0050 private:
0051
0052 typedef record_view::public_data public_data;
0053
0054 private:
0055
0056 public_data* m_impl;
0057
0058 private:
0059
0060 BOOST_CONSTEXPR explicit record(public_data* impl) BOOST_NOEXCEPT : m_impl(impl) {}
0061
0062 #endif
0063
0064 public:
0065
0066
0067
0068
0069
0070 BOOST_CONSTEXPR record() BOOST_NOEXCEPT : m_impl(NULL) {}
0071
0072
0073
0074
0075 record(BOOST_RV_REF(record) that) BOOST_NOEXCEPT : m_impl(that.m_impl)
0076 {
0077 that.m_impl = NULL;
0078 }
0079
0080
0081
0082
0083 ~record() BOOST_NOEXCEPT
0084 {
0085 reset();
0086 }
0087
0088
0089
0090
0091 record& operator= (BOOST_RV_REF(record) that) BOOST_NOEXCEPT
0092 {
0093 swap(static_cast< record& >(that));
0094 return *this;
0095 }
0096
0097
0098
0099
0100
0101
0102 attribute_value_set& attribute_values() BOOST_NOEXCEPT
0103 {
0104 return m_impl->m_attribute_values;
0105 }
0106
0107
0108
0109
0110
0111
0112 attribute_value_set const& attribute_values() const BOOST_NOEXCEPT
0113 {
0114 return m_impl->m_attribute_values;
0115 }
0116
0117
0118
0119
0120
0121
0122 BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
0123
0124
0125
0126
0127
0128
0129 bool operator! () const BOOST_NOEXCEPT
0130 {
0131 return !m_impl;
0132 }
0133
0134
0135
0136
0137
0138
0139
0140 void swap(record& that) BOOST_NOEXCEPT
0141 {
0142 public_data* p = m_impl;
0143 m_impl = that.m_impl;
0144 that.m_impl = p;
0145 }
0146
0147
0148
0149
0150
0151
0152
0153 void reset() BOOST_NOEXCEPT
0154 {
0155 if (m_impl)
0156 {
0157 public_data::destroy(m_impl);
0158 m_impl = NULL;
0159 }
0160 }
0161
0162
0163
0164
0165
0166
0167
0168 attribute_value_set::mapped_type operator[] (attribute_value_set::key_type name) const
0169 {
0170 return m_impl->m_attribute_values[name];
0171 }
0172
0173
0174
0175
0176
0177
0178
0179 template< typename DescriptorT, template< typename > class ActorT >
0180 typename result_of::extract< typename expressions::attribute_keyword< DescriptorT, ActorT >::value_type, DescriptorT >::type
0181 operator[] (expressions::attribute_keyword< DescriptorT, ActorT > const& keyword) const
0182 {
0183 return m_impl->m_attribute_values[keyword];
0184 }
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194 BOOST_LOG_API record_view lock();
0195 };
0196
0197
0198
0199
0200 inline void swap(record& left, record& right) BOOST_NOEXCEPT
0201 {
0202 left.swap(right);
0203 }
0204
0205 BOOST_LOG_CLOSE_NAMESPACE
0206
0207 }
0208
0209 #include <boost/log/detail/footer.hpp>
0210
0211 #endif