1<?xml version="1.0" standalone="yes"?> 2<library-reference id="attributes"><title>Attributes</title><header name="boost/log/attributes/attribute.hpp"> 3<para><para>Andrey Semashev </para> 4 5<para>15.04.2007</para> 6 7The header contains attribute interface definition. </para><namespace name="boost"> 8<namespace name="log"> 9<class name="attribute"><purpose>A base class for an attribute value factory. </purpose><description><para>Every attribute is represented with a factory that is basically an attribute value generator. The sole purpose of an attribute is to return an actual value when requested. A simplest attribute can always return the same value that it stores internally, but more complex ones can perform a considerable amount of work to return a value, and the returned values may differ each time requested.</para><para>A word about thread safety. An attribute should be prepared to be requested a value from multiple threads concurrently. </para></description><struct name="impl"><inherit access="public">boost::intrusive_ref_counter< impl ></inherit><purpose>A base class for an attribute value factory. </purpose><description><para>All attributes must derive their implementation from this class. </para></description><method-group name="public member functions"> 10<method name="get_value" cv="= 0" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para> 11</para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para> 12</returns></method> 13</method-group> 14<destructor><purpose>Virtual destructor. </purpose></destructor> 15<method-group name="public static functions"> 16<method name="operator new" specifiers="static"><type>void *</type><parameter name="size"><paramtype>std::size_t</paramtype></parameter></method> 17<method name="operator delete" cv="noexcept" specifiers="static"><type>void</type><parameter name="p"><paramtype>void *</paramtype></parameter><parameter name="size"><paramtype>std::size_t</paramtype></parameter></method> 18</method-group> 19</struct><method-group name="public member functions"> 20<method name="conversion-operator" cv="const noexcept" specifiers="explicit"><type>bool</type><description><para>Verifies that the factory is not in empty state </para></description></method> 21<method name="operator!" cv="const noexcept"><type>bool</type><description><para>Verifies that the factory is in empty state </para></description></method> 22<method name="get_value" cv="const"><type><classname>attribute_value</classname></type><description><para> 23</para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para> 24</returns></method> 25<method name="swap" cv="noexcept"><type>void</type><parameter name="that"><paramtype><classname>attribute</classname> &</paramtype></parameter><description><para>The method swaps two factories (i.e. their implementations). </para></description></method> 26</method-group> 27<constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute</classname> const &</paramtype></parameter><description><para>Default constructor. Creates an empty attribute value factory, which is not usable until <computeroutput>set_impl</computeroutput> is called.</para><para>Copy constructor </para></description></constructor> 28<constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute</classname> &&</paramtype></parameter><description><para>Move constructor </para></description></constructor> 29<constructor specifiers="explicit" cv="noexcept"><parameter name="p"><paramtype>intrusive_ptr< <classname>impl</classname> ></paramtype><description><para>Pointer to the implementation. Must not be <computeroutput>NULL</computeroutput>. </para></description></parameter><description><para>Initializing constructor</para><para> 30</para></description></constructor> 31<copy-assignment cv="noexcept"><type><classname>attribute</classname> &</type><parameter name="that"><paramtype><classname>attribute</classname> const &</paramtype></parameter><description><para>Copy assignment </para></description></copy-assignment> 32<copy-assignment cv="noexcept"><type><classname>attribute</classname> &</type><parameter name="that"><paramtype><classname>attribute</classname> &&</paramtype></parameter><description><para>Move assignment </para></description></copy-assignment> 33<method-group name="protected member functions"> 34<method name="get_impl" cv="const noexcept"><type><classname>impl</classname> *</type><description><para> 35</para></description><returns><para>The pointer to the implementation </para> 36</returns></method> 37<method name="set_impl" cv="noexcept"><type>void</type><parameter name="p"><paramtype>intrusive_ptr< <classname>impl</classname> ></paramtype><description><para>Pointer to the implementation. Must not be <computeroutput>NULL</computeroutput>. </para></description></parameter><description><para>Sets the pointer to the factory implementation.</para><para> 38</para></description></method> 39</method-group> 40<method-group name="friend functions"> 41<method name="attribute_cast"><type>friend T</type><template> 42 <template-type-parameter name="T"/> 43 </template><parameter name=""><paramtype><classname>attribute</classname> const &</paramtype></parameter><description><para>The function casts one attribute factory to another </para></description></method> 44</method-group> 45</class> 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80<function name="swap"><type>void</type><parameter name="left"><paramtype><classname>attribute</classname> &</paramtype></parameter><parameter name="right"><paramtype><classname>attribute</classname> &</paramtype></parameter><description><para>The function swaps two attribute value factories </para></description></function> 81</namespace> 82</namespace> 83</header> 84<header name="boost/log/attributes/attribute_cast.hpp"> 85<para><para>Andrey Semashev </para> 86 87<para>06.08.2010</para> 88 89The header contains utilities for casting between attribute factories. </para><namespace name="boost"> 90<namespace name="log"> 91<namespace name="attributes"> 92<class name="cast_source"><description><para>The class holds a reference to the attribute factory implementation being casted </para></description><method-group name="public member functions"> 93<method name="as" cv="const"><type>T *</type><template> 94 <template-type-parameter name="T"/> 95 </template><description><para>The function attempts to cast the aggregated pointer to the implementation to the specified type.</para><para> 96</para></description><returns><para>The converted pointer or <computeroutput>NULL</computeroutput>, if the conversion fails. </para> 97</returns></method> 98</method-group> 99<constructor specifiers="explicit"><parameter name="p"><paramtype><classname>attribute::impl</classname> *</paramtype></parameter><description><para>Initializing constructor. Creates a source that refers to the specified factory implementation. </para></description></constructor> 100</class> 101 102 103 104</namespace> 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139<function name="attribute_cast"><type>T</type><template> 140 <template-type-parameter name="T"/> 141 </template><parameter name="attr"><paramtype><classname>attribute</classname> const &</paramtype></parameter><description><para>The function casts one attribute factory to another </para></description></function> 142 143</namespace> 144</namespace> 145</header> 146<header name="boost/log/attributes/attribute_name.hpp"> 147<para><para>Andrey Semashev </para> 148 149<para>28.06.2010</para> 150 151The header contains attribute name interface definition. </para><namespace name="boost"> 152<namespace name="log"> 153<class name="attribute_name"><purpose>The class represents an attribute name in containers used by the library. </purpose><description><para>The class mostly serves for optimization purposes. Each attribute name that is used with the library is automatically associated with a unique identifier, which is much lighter in terms of memory footprint and operations complexity. This is done transparently by this class, on object construction. Passing objects of this class to other library methods, such as attribute lookup functions, will not require this translation and/or string copying and thus will result in a more efficient code. </para></description><typedef name="string_type"><purpose>String type. </purpose><type>std::string</type></typedef> 154<typedef name="id_type"><purpose>Associated identifier. </purpose><type>unspecified</type></typedef> 155<method-group name="public member functions"> 156<method name="operator==" cv="const noexcept"><type>bool</type><parameter name="that"><paramtype><classname>attribute_name</classname> const &</paramtype></parameter><description><para>Compares the attribute names</para><para> 157</para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> and <computeroutput>that</computeroutput> refer to the same attribute name, and <computeroutput>false</computeroutput> otherwise. </para> 158</returns></method> 159<method name="operator!=" cv="const noexcept"><type>bool</type><parameter name="that"><paramtype><classname>attribute_name</classname> const &</paramtype></parameter><description><para>Compares the attribute names</para><para> 160</para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> and <computeroutput>that</computeroutput> refer to different attribute names, and <computeroutput>false</computeroutput> otherwise. </para> 161</returns></method> 162<method name="operator==" cv="const"><type>bool</type><parameter name="that"><paramtype>const char *</paramtype></parameter><description><para>Compares the attribute names</para><para> 163</para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> and <computeroutput>that</computeroutput> refer to the same attribute name, and <computeroutput>false</computeroutput> otherwise. </para> 164</returns></method> 165<method name="operator!=" cv="const"><type>bool</type><parameter name="that"><paramtype>const char *</paramtype></parameter><description><para>Compares the attribute names</para><para> 166</para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> and <computeroutput>that</computeroutput> refer to different attribute names, and <computeroutput>false</computeroutput> otherwise. </para> 167</returns></method> 168<method name="operator==" cv="const"><type>bool</type><parameter name="that"><paramtype>string_type const &</paramtype></parameter><description><para>Compares the attribute names</para><para> 169</para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> and <computeroutput>that</computeroutput> refer to the same attribute name, and <computeroutput>false</computeroutput> otherwise. </para> 170</returns></method> 171<method name="operator!=" cv="const"><type>bool</type><parameter name="that"><paramtype>string_type const &</paramtype></parameter><description><para>Compares the attribute names</para><para> 172</para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> and <computeroutput>that</computeroutput> refer to different attribute names, and <computeroutput>false</computeroutput> otherwise. </para> 173</returns></method> 174<method name="conversion-operator" cv="const noexcept" specifiers="explicit"><type>bool</type><description><para>Checks if the object was default-constructed</para><para> 175</para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> was constructed with an attribute name, <computeroutput>false</computeroutput> otherwise </para> 176</returns></method> 177<method name="operator!" cv="const noexcept"><type>bool</type><description><para>Checks if the object was default-constructed</para><para> 178</para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> was default-constructed and does not refer to any attribute name, <computeroutput>false</computeroutput> otherwise </para> 179</returns></method> 180<method name="id" cv="const noexcept"><type>id_type</type><description><para> 181 182</para></description><requires><para><computeroutput>(!*this) == false</computeroutput> </para> 183</requires><returns><para>The associated id value </para> 184</returns></method> 185<method name="string" cv="const"><type>string_type const &</type><description><para> 186 187</para></description><requires><para><computeroutput>(!*this) == false</computeroutput> </para> 188</requires><returns><para>The attribute name string that was used during the object construction </para> 189</returns></method> 190</method-group> 191<constructor cv="noexcept"><description><para>Default constructor. Creates an object that does not refer to any attribute name. </para></description></constructor> 192<constructor><parameter name="name"><paramtype>const char *</paramtype><description><para>An attribute name </para></description></parameter><description><para>Constructs an attribute name from the specified string</para><para> 193 194</para></description><requires><para><emphasis>name</emphasis> is not NULL and points to a zero-terminated string </para> 195</requires></constructor> 196<constructor><parameter name="name"><paramtype>string_type const &</paramtype><description><para>An attribute name </para></description></parameter><description><para>Constructs an attribute name from the specified string</para><para> 197</para></description></constructor> 198</class> 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231<function name="operator<<"><type>std::basic_ostream< CharT, TraitsT > &</type><template> 232 <template-type-parameter name="CharT"/> 233 <template-type-parameter name="TraitsT"/> 234 </template><parameter name="strm"><paramtype>std::basic_ostream< CharT, TraitsT > &</paramtype></parameter><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype></parameter></function> 235 236 237</namespace> 238</namespace> 239</header> 240<header name="boost/log/attributes/attribute_set.hpp"> 241<para><para>Andrey Semashev </para> 242 243<para>08.03.2007</para> 244 245This header contains definition of the attribute set container. </para><namespace name="boost"> 246<namespace name="log"> 247<class name="attribute_set"><purpose>An attribute set class. </purpose><description><para>An attribute set is an associative container with attribute name as a key and pointer to the attribute as a mapped value. The container allows storing only one element for each distinct key value. In most regards attribute set container provides interface similar to <computeroutput>std::unordered_map</computeroutput>. However, there are differences in <computeroutput>operator</computeroutput>[] semantics and a number of optimizations with regard to iteration. Besides, attribute names are stored as a read-only <computeroutput><classname alt="boost::log::attribute_name">attribute_name</classname></computeroutput>'s instead of <computeroutput>std::string</computeroutput>, which saves memory and CPU time. </para></description><typedef name="key_type"><purpose>Key type. </purpose><type><classname>attribute_name</classname></type></typedef> 248<typedef name="mapped_type"><purpose>Mapped attribute type. </purpose><type><classname>attribute</classname></type></typedef> 249<typedef name="value_type"><purpose>Value type. </purpose><type>std::pair< const key_type, mapped_type ></type></typedef> 250<typedef name="reference"><purpose>Reference type. </purpose><type>value_type &</type></typedef> 251<typedef name="const_reference"><purpose>Const reference type. </purpose><type>value_type const &</type></typedef> 252<typedef name="pointer"><purpose>Pointer type. </purpose><type>value_type *</type></typedef> 253<typedef name="const_pointer"><purpose>Const pointer type. </purpose><type>value_type const *</type></typedef> 254<typedef name="size_type"><purpose>Size type. </purpose><type>std::size_t</type></typedef> 255<typedef name="difference_type"><purpose>Difference type. </purpose><type>std::ptrdiff_t</type></typedef> 256<typedef name="iterator"><description><para>Iterator type. The iterator complies to the bidirectional iterator requirements. </para></description><type>implementation_defined</type></typedef> 257<typedef name="const_iterator"><description><para>Constant iterator type. The iterator complies to the bidirectional iterator requirements with read-only capabilities. </para></description><type>implementation_defined</type></typedef> 258<method-group name="public member functions"> 259<method name="swap" cv="noexcept"><type>void</type><parameter name="that"><paramtype><classname>attribute_set</classname> &</paramtype></parameter><description><para>Swaps two instances of the container.</para><para><emphasis role="bold">Throws:</emphasis> Nothing. </para></description></method> 260<method name="begin" cv="noexcept"><type>iterator</type><description><para> 261</para></description><returns><para>Iterator to the first element of the container. </para> 262</returns></method> 263<method name="end" cv="noexcept"><type>iterator</type><description><para> 264</para></description><returns><para>Iterator to the after-the-last element of the container. </para> 265</returns></method> 266<method name="begin" cv="const noexcept"><type>const_iterator</type><description><para> 267</para></description><returns><para>Constant iterator to the first element of the container. </para> 268</returns></method> 269<method name="end" cv="const noexcept"><type>const_iterator</type><description><para> 270</para></description><returns><para>Constant iterator to the after-the-last element of the container. </para> 271</returns></method> 272<method name="size" cv="const noexcept"><type>size_type</type><description><para> 273</para></description><returns><para>Number of elements in the container. </para> 274</returns></method> 275<method name="empty" cv="const noexcept"><type>bool</type><description><para> 276</para></description><returns><para>true if there are no elements in the container, false otherwise. </para> 277</returns></method> 278<method name="find" cv="noexcept"><type>iterator</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>The method finds the attribute by name.</para><para> 279 280</para></description><returns><para>Iterator to the found element or end() if the attribute with such name is not found. </para> 281</returns></method> 282<method name="find" cv="const noexcept"><type>const_iterator</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>The method finds the attribute by name.</para><para> 283 284</para></description><returns><para>Iterator to the found element or <computeroutput>end()</computeroutput> if the attribute with such name is not found. </para> 285</returns></method> 286<method name="count" cv="const noexcept"><type>size_type</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>The method counts the number of the attribute occurrences in the container. Since there can be only one attribute with a particular key, the method always return 0 or 1.</para><para> 287 288</para></description><returns><para>The number of times the attribute is found in the container. </para> 289</returns></method> 290<method name="operator[]" cv="noexcept"><type><emphasis>unspecified</emphasis></type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>Combined lookup/insertion operator. The operator semantics depends on the further usage of the returned reference. <itemizedlist> 291<listitem><para>If the reference is used as an assignment target, the assignment expression is equivalent to element insertion, where the element is composed of the second argument of the <computeroutput>operator</computeroutput>[] as a key and the second argument of assignment as a mapped value. </para> 292</listitem> 293<listitem><para>If the returned reference is used in context where a conversion to the mapped type is required, the result of the conversion is equivalent to the mapped value found with the second argument of the <computeroutput>operator</computeroutput>[] as a key, if such an element exists in the container, or a default-constructed mapped value, if an element does not exist in the container.</para> 294</listitem> 295</itemizedlist> 296 297 298</para></description><returns><para>A smart reference object of unspecified type. </para> 299</returns></method> 300<method name="operator[]" cv="const noexcept"><type>mapped_type</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>Lookup operator</para><para> 301 302</para></description><returns><para>If an element with the corresponding attribute name is found in the container, its mapped value is returned. Otherwise a default-constructed mapped value is returned. </para> 303</returns></method> 304<method name="insert"><type>std::pair< iterator, bool ></type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><parameter name="data"><paramtype>mapped_type const &</paramtype><description><para>Pointer to the attribute. Must not be NULL. </para></description></parameter><description><para>Insertion method</para><para> 305 306</para></description><returns><para>A pair of values. If second is true, the insertion succeeded and the first component points to the inserted element. Otherwise the first component points to the element that prevents insertion. </para> 307</returns></method> 308<method name="insert"><type>std::pair< iterator, bool ></type><parameter name="value"><paramtype>const_reference</paramtype><description><para>An element to be inserted. </para></description></parameter><description><para>Insertion method</para><para> 309 310</para></description><returns><para>A pair of values. If second is true, the insertion succeeded and the first component points to the inserted element. Otherwise the first component points to the element that prevents insertion. </para> 311</returns></method> 312<method name="insert"><type>void</type><template> 313 <template-type-parameter name="FwdIteratorT"/> 314 </template><parameter name="begin"><paramtype>FwdIteratorT</paramtype><description><para>A forward iterator that points to the first element to be inserted. </para></description></parameter><parameter name="end"><paramtype>FwdIteratorT</paramtype><description><para>A forward iterator that points to the after-the-last element to be inserted. </para></description></parameter><description><para>Mass insertion method.</para><para> 315</para></description></method> 316<method name="insert"><type>void</type><template> 317 <template-type-parameter name="FwdIteratorT"/> 318 <template-type-parameter name="OutputIteratorT"/> 319 </template><parameter name="begin"><paramtype>FwdIteratorT</paramtype><description><para>A forward iterator that points to the first element to be inserted. </para></description></parameter><parameter name="end"><paramtype>FwdIteratorT</paramtype><description><para>A forward iterator that points to the after-the-last element to be inserted. </para></description></parameter><parameter name="out"><paramtype>OutputIteratorT</paramtype><description><para>An output iterator that receives results of insertion of the elements </para></description></parameter><description><para>Mass insertion method with ability to acquire iterators to the inserted elements.</para><para> 320</para></description></method> 321<method name="erase" cv="noexcept"><type>size_type</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>The method erases all attributes with the specified name</para><para> 322 323 324</para></description><postconditions><para>All iterators to the erased elements become invalid. </para> 325</postconditions><returns><para>Tne number of erased elements </para> 326</returns></method> 327<method name="erase" cv="noexcept"><type>void</type><parameter name="it"><paramtype>iterator</paramtype><description><para>A valid iterator to the element to be erased. </para></description></parameter><description><para>The method erases the specified attribute</para><para> 328 329 330</para></description><postconditions><para>All iterators to the erased element become invalid. </para> 331</postconditions><returns><para>Tne number of erased elements </para> 332</returns></method> 333<method name="erase" cv="noexcept"><type>void</type><parameter name="begin"><paramtype>iterator</paramtype><description><para>An iterator that points to the first element to be erased. </para></description></parameter><parameter name="end"><paramtype>iterator</paramtype><description><para>An iterator that points to the after-the-last element to be erased. </para></description></parameter><description><para>The method erases all attributes within the specified range</para><para> 334 335 336</para></description><requires><para><emphasis>end</emphasis> is reachable from <emphasis>begin</emphasis> with a finite number of increments. </para> 337</requires><postconditions><para>All iterators to the erased elements become invalid. </para> 338</postconditions></method> 339<method name="clear" cv="noexcept"><type>void</type><description><para>The method removes all elements from the container</para><para> 340</para></description><postconditions><para><computeroutput>empty() == true</computeroutput> </para> 341</postconditions></method> 342</method-group> 343<constructor><description><para>Default constructor.</para><para> 344</para></description><postconditions><para><computeroutput>empty() == true</computeroutput> </para> 345</postconditions></constructor> 346<constructor><parameter name="that"><paramtype><classname>attribute_set</classname> const &</paramtype></parameter><description><para>Copy constructor.</para><para> 347</para></description><postconditions><para><computeroutput>size() == that.size() && std::equal(begin(), end(), that.begin()) == true</computeroutput> </para> 348</postconditions></constructor> 349<constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute_set</classname> &&</paramtype></parameter><description><para>Move constructor </para></description></constructor> 350<destructor><description><para>Destructor. All stored references to attributes are released. </para></description></destructor> 351<copy-assignment cv="noexcept"><type><classname>attribute_set</classname> &</type><parameter name="that"><paramtype><classname>attribute_set</classname></paramtype></parameter><description><para>Copy assignment operator.</para><para> 352</para></description><postconditions><para><computeroutput>size() == that.size() && std::equal(begin(), end(), that.begin()) == true</computeroutput> </para> 353</postconditions></copy-assignment> 354</class> 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386<function name="swap"><type>void</type><parameter name="left"><paramtype><classname>attribute_set</classname> &</paramtype></parameter><parameter name="right"><paramtype><classname>attribute_set</classname> &</paramtype></parameter><description><para>Free swap overload </para></description></function> 387 388 389 390</namespace> 391</namespace> 392</header> 393<header name="boost/log/attributes/attribute_value.hpp"> 394<para><para>Andrey Semashev </para> 395 396<para>21.05.2010</para> 397 398The header contains <computeroutput>attribute_value</computeroutput> class definition. </para><namespace name="boost"> 399<namespace name="log"> 400<class name="attribute_value"><purpose>An attribute value class. </purpose><description><para>An attribute value is an object that contains a piece of data that represents an attribute state at the point of the value acquisition. All major operations with log records, such as filtering and formatting, involve attribute values contained in a single view. Most likely an attribute value is implemented as a simple holder of some typed value. This holder implements the <computeroutput>attribute_value::implementation</computeroutput> interface and acts as a pimpl for the <computeroutput><classname alt="boost::log::attribute_value">attribute_value</classname></computeroutput> object. The <computeroutput><classname alt="boost::log::attribute_value">attribute_value</classname></computeroutput> class provides type dispatching support in order to allow to extract the value from the holder.</para><para>Normally, attributes and their values shall be designed in order to exclude as much interference as reasonable. Such approach allows to have more than one attribute value simultaneously, which improves scalability and allows to implement generating attributes.</para><para>However, there are cases when this approach does not help to achieve the required level of independency of attribute values and attribute itself from each other at a reasonable performance tradeoff. For example, an attribute or its values may use thread-specific data, which is global and shared between all the instances of the attribute/value. Passing such an attribute value to another thread would be a disaster. To solve this the library defines an additional method for attribute values, namely <computeroutput>detach_from_thread</computeroutput>. The <computeroutput><classname alt="boost::log::attribute_value">attribute_value</classname></computeroutput> class forwards the call to its pimpl, which is supposed to ensure that it no longer refers to any thread-specific data after the call. The pimpl can create a new holder as a result of this method and return it to the <computeroutput><classname alt="boost::log::attribute_value">attribute_value</classname></computeroutput> wrapper, which will keep the returned reference for any further calls. This method is called for all attribute values that are passed to another thread. </para></description><struct name="impl"><inherit access="public">attribute::impl</inherit><purpose>A base class for an attribute value implementation. </purpose><description><para>All attribute value holders should derive from this interface. </para></description><method-group name="public member functions"> 401<method name="dispatch" cv="= 0" specifiers="virtual"><type>bool</type><parameter name="dispatcher"><paramtype>type_dispatcher &</paramtype><description><para>The object that attempts to dispatch the stored value. </para></description></parameter><description><para>The method dispatches the value to the given object.</para><para> 402 403</para></description><returns><para>true if <emphasis>dispatcher</emphasis> was capable to consume the real attribute value type and false otherwise. </para> 404</returns></method> 405<method name="detach_from_thread" specifiers="virtual"><type>intrusive_ptr< <classname>impl</classname> ></type><description><para>The method is called when the attribute value is passed to another thread (e.g. in case of asynchronous logging). The value should ensure it properly owns all thread-specific data.</para><para> 406</para></description><returns><para>An actual pointer to the attribute value. It may either point to this object or another. In the latter case the returned pointer replaces the pointer used by caller to invoke this method and is considered to be a functional equivalent to the previous pointer. </para> 407</returns></method> 408<method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para> 409</para></description><returns><para>The attribute value that refers to self implementation. </para> 410</returns></method> 411<method name="get_type" cv="const" specifiers="virtual"><type>typeindex::type_index</type><description><para> 412</para></description><returns><para>The attribute value type </para> 413</returns></method> 414</method-group> 415</struct><method-group name="public member functions"> 416<method name="conversion-operator" cv="const noexcept" specifiers="explicit"><type>bool</type><description><para>The operator checks if the attribute value is empty </para></description></method> 417<method name="operator!" cv="const noexcept"><type>bool</type><description><para>The operator checks if the attribute value is empty </para></description></method> 418<method name="get_type" cv="const"><type>typeindex::type_index</type><description><para>The method returns the type information of the stored value of the attribute. The returned type info wrapper may be empty if the attribute value is empty or the information cannot be provided. If the returned value is not empty, the type can be used for value extraction. </para></description></method> 419<method name="detach_from_thread"><type>void</type><description><para>The method is called when the attribute value is passed to another thread (e.g. in case of asynchronous logging). The value should ensure it properly owns all thread-specific data.</para><para> 420</para></description><postconditions><para>The attribute value no longer refers to any thread-specific resources. </para> 421</postconditions></method> 422<method name="dispatch" cv="const"><type>bool</type><parameter name="dispatcher"><paramtype>type_dispatcher &</paramtype><description><para>The object that attempts to dispatch the stored value. </para></description></parameter><description><para>The method dispatches the value to the given object. This method is a low level interface for attribute value visitation and extraction. For typical usage these interfaces may be more convenient.</para><para> 423 424</para></description><returns><para><computeroutput>true</computeroutput> if the value is not empty and the <emphasis>dispatcher</emphasis> was capable to consume the real attribute value type and <computeroutput>false</computeroutput> otherwise. </para> 425</returns></method> 426<method name="extract" cv="const"><type><classname>result_of::extract</classname>< T, TagT >::type</type><template> 427 <template-type-parameter name="T"/> 428 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 429 </template><description><para>The method attempts to extract the stored value, assuming the value has the specified type. One can specify either a single type or an MPL type sequence, in which case the stored value is checked against every type in the sequence.</para><para><note><para>Include <computeroutput>value_extraction.hpp</computeroutput> prior to using this method.</para> 430</note> 431 432</para></description><returns><para>The extracted value, if the attribute value is not empty and the value is the same as specified. Otherwise returns an empty value. See description of the <computeroutput><classname alt="boost::log::result_of::extract">result_of::extract</classname></computeroutput> metafunction for information on the nature of the result value. </para> 433</returns></method> 434<method name="extract_or_throw" cv="const"><type><classname>result_of::extract_or_throw</classname>< T, TagT >::type</type><template> 435 <template-type-parameter name="T"/> 436 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 437 </template><description><para>The method attempts to extract the stored value, assuming the value has the specified type. One can specify either a single type or an MPL type sequence, in which case the stored value is checked against every type in the sequence.</para><para><note><para>Include <computeroutput>value_extraction.hpp</computeroutput> prior to using this method.</para> 438</note> 439 440</para></description><returns><para>The extracted value, if the attribute value is not empty and the value is the same as specified. Otherwise an exception is thrown. See description of the <computeroutput><classname alt="boost::log::result_of::extract_or_throw">result_of::extract_or_throw</classname></computeroutput> metafunction for information on the nature of the result value. </para> 441</returns></method> 442<method name="extract_or_default" cv="const"><type><classname>result_of::extract_or_default</classname>< T, T, TagT >::type</type><template> 443 <template-type-parameter name="T"/> 444 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 445 </template><parameter name="def_value"><paramtype>T const &</paramtype><description><para>Default value.</para></description></parameter><description><para>The method attempts to extract the stored value, assuming the value has the specified type. One can specify either a single type or an MPL type sequence, in which case the stored value is checked against every type in the sequence. If extraction fails, the default value is returned.</para><para><note><para>Include <computeroutput>value_extraction.hpp</computeroutput> prior to using this method.</para> 446</note> 447 448 449</para></description><returns><para>The extracted value, if the attribute value is not empty and the value is the same as specified. Otherwise returns the default value. See description of the <computeroutput><classname alt="boost::log::result_of::extract_or_default">result_of::extract_or_default</classname></computeroutput> metafunction for information on the nature of the result value. </para> 450</returns></method> 451<method name="extract_or_default" cv="const"><type><classname>result_of::extract_or_default</classname>< T, DefaultT, TagT >::type</type><template> 452 <template-type-parameter name="T"/> 453 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 454 <template-type-parameter name="DefaultT"/> 455 </template><parameter name="def_value"><paramtype>DefaultT const &</paramtype><description><para>Default value.</para></description></parameter><description><para>The method attempts to extract the stored value, assuming the value has the specified type. One can specify either a single type or an MPL type sequence, in which case the stored value is checked against every type in the sequence. If extraction fails, the default value is returned.</para><para><note><para>Include <computeroutput>value_extraction.hpp</computeroutput> prior to using this method.</para> 456</note> 457 458 459</para></description><returns><para>The extracted value, if the attribute value is not empty and the value is the same as specified. Otherwise returns the default value. See description of the <computeroutput><classname alt="boost::log::result_of::extract_or_default">result_of::extract_or_default</classname></computeroutput> metafunction for information on the nature of the result value. </para> 460</returns></method> 461<method name="visit" cv="const"><type><classname>visitation_result</classname></type><template> 462 <template-type-parameter name="T"/> 463 <template-type-parameter name="VisitorT"/> 464 </template><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A function object that will be invoked on the extracted attribute value. The visitor should be capable to be called with a single argument of any type of the specified types in <computeroutput>T</computeroutput>.</para></description></parameter><description><para>The method attempts to extract the stored value, assuming the value has the specified type, and pass it to the <emphasis>visitor</emphasis> function object. One can specify either a single type or an MPL type sequence, in which case the stored value is checked against every type in the sequence.</para><para><note><para>Include <computeroutput>value_visitation.hpp</computeroutput> prior to using this method.</para> 465</note> 466 467 468</para></description><returns><para>The result of visitation. </para> 469</returns></method> 470<method name="swap" cv="noexcept"><type>void</type><parameter name="that"><paramtype><classname>attribute_value</classname> &</paramtype></parameter><description><para>The method swaps two attribute values </para></description></method> 471</method-group> 472<constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute_value</classname> const &</paramtype></parameter><description><para>Default constructor. Creates an empty (absent) attribute value.</para><para>Copy constructor </para></description></constructor> 473<constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute_value</classname> &&</paramtype></parameter><description><para>Move constructor </para></description></constructor> 474<constructor specifiers="explicit" cv="noexcept"><parameter name="p"><paramtype>intrusive_ptr< <classname>impl</classname> ></paramtype><description><para>A pointer to the attribute value holder. </para></description></parameter><description><para>Initializing constructor. Creates an attribute value that refers to the specified holder.</para><para> 475</para></description></constructor> 476<copy-assignment cv="noexcept"><type><classname>attribute_value</classname> &</type><parameter name="that"><paramtype><classname>attribute_value</classname> const &</paramtype></parameter><description><para>Copy assignment </para></description></copy-assignment> 477<copy-assignment cv="noexcept"><type><classname>attribute_value</classname> &</type><parameter name="that"><paramtype><classname>attribute_value</classname> &&</paramtype></parameter><description><para>Move assignment </para></description></copy-assignment> 478</class> 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509<function name="swap"><type>void</type><parameter name="left"><paramtype><classname>attribute_value</classname> &</paramtype></parameter><parameter name="right"><paramtype><classname>attribute_value</classname> &</paramtype></parameter><description><para>The function swaps two attribute values </para></description></function> 510 511 512 513 514</namespace> 515</namespace> 516</header> 517<header name="boost/log/attributes/attribute_value_impl.hpp"> 518<para><para>Andrey Semashev </para> 519 520<para>24.06.2007</para> 521 522The header contains an implementation of a basic attribute value implementation class. </para><namespace name="boost"> 523<namespace name="log"> 524<namespace name="attributes"> 525<class name="attribute_value_impl"><template> 526 <template-type-parameter name="T"/> 527 </template><inherit access="public">attribute_value::impl</inherit><purpose>Basic attribute value implementation class. </purpose><description><para>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. </para></description><typedef name="value_type"><purpose>Value type. </purpose><type>T</type></typedef> 528<method-group name="public member functions"> 529<method name="dispatch" specifiers="virtual"><type>bool</type><parameter name="dispatcher"><paramtype>type_dispatcher &</paramtype><description><para>The dispatcher that receives the stored value</para></description></parameter><description><para>Attribute value dispatching method.</para><para> 530 531</para></description><returns><para><computeroutput>true</computeroutput> if the value has been dispatched, <computeroutput>false</computeroutput> otherwise </para> 532</returns></method> 533<method name="get_type" cv="const" specifiers="virtual"><type>typeindex::type_index</type><description><para> 534</para></description><returns><para>The attribute value type </para> 535</returns></method> 536<method name="get" cv="const"><type>value_type const &</type><description><para> 537</para></description><returns><para>Reference to the contained value. </para> 538</returns></method> 539</method-group> 540<constructor specifiers="explicit"><parameter name="v"><paramtype>value_type const &</paramtype></parameter><description><para>Constructor with initialization of the stored value </para></description></constructor> 541<constructor specifiers="explicit" cv="noexcept(boost::is_nothrow_move_constructible< value_type >::value))"><parameter name="v"><paramtype>value_type &&</paramtype></parameter><description><para>Constructor with initialization of the stored value </para></description></constructor> 542</class> 543 544 545<function name="make_attribute_value"><type><classname>attribute_value</classname></type><template> 546 <template-type-parameter name="T"/> 547 </template><parameter name="v"><paramtype>T &&</paramtype></parameter><description><para>The function creates an attribute value from the specified object. </para></description></function> 548</namespace> 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585</namespace> 586</namespace> 587</header> 588<header name="boost/log/attributes/attribute_value_set.hpp"> 589<para><para>Andrey Semashev </para> 590 591<para>21.04.2007</para> 592 593This header file contains definition of attribute value set. The set is constructed from three attribute sets (global, thread-specific and source-specific) and contains attribute values. </para><namespace name="boost"> 594<namespace name="log"> 595<class name="attribute_value_set"><purpose>A set of attribute values. </purpose><description><para>The set of attribute values is an associative container with attribute name as a key and a pointer to attribute value object as a mapped type. This is a collection of elements with unique keys, that is, there can be only one attribute value with a given name in the set. With respect to read-only capabilities, the set interface is close to <computeroutput>std::unordered_map</computeroutput>.</para><para>The set is designed to be only capable of adding elements to it. Once added, the attribute value cannot be removed from the set.</para><para>An instance of attribute value set can be constructed from three attribute sets. The constructor attempts to accommodate values of all attributes from the sets. The situation when a same-named attribute is found in more than one attribute set is possible. This problem is solved on construction of the value set: the three attribute sets have different priorities when it comes to solving conflicts.</para><para>From the library perspective the three source attribute sets are global, thread-specific and source-specific attributes, with the latter having the highest priority. This feature allows to override attributes of wider scopes with the more specific ones.</para><para>For sake of performance, the attribute values are not immediately acquired from attribute sets at construction. Instead, on-demand acquisition is performed either on iterator dereferencing or on call to the <computeroutput>freeze</computeroutput> method. Once acquired, the attribute value stays within the set until its destruction. This nuance does not affect other set properties, such as size or lookup ability. The logging core automatically freezes the set at the right point, so users should not be bothered unless they manually create attribute value sets.</para><para><note><para>The attribute sets that were used for the value set construction must not be modified or destroyed until the value set is frozen. Otherwise the behavior is undefined. </para> 596</note> 597</para></description><typedef name="key_type"><purpose>Key type. </purpose><type><classname>attribute_name</classname></type></typedef> 598<typedef name="mapped_type"><purpose>Mapped attribute type. </purpose><type><classname>attribute_value</classname></type></typedef> 599<typedef name="value_type"><purpose>Value type. </purpose><type>std::pair< const key_type, mapped_type ></type></typedef> 600<typedef name="reference"><purpose>Reference type. </purpose><type>value_type &</type></typedef> 601<typedef name="const_reference"><purpose>Const reference type. </purpose><type>value_type const &</type></typedef> 602<typedef name="pointer"><purpose>Pointer type. </purpose><type>value_type *</type></typedef> 603<typedef name="const_pointer"><purpose>Const pointer type. </purpose><type>value_type const *</type></typedef> 604<typedef name="size_type"><purpose>Size type. </purpose><type>std::size_t</type></typedef> 605<typedef name="difference_type"><purpose>Pointer difference type. </purpose><type>std::ptrdiff_t</type></typedef> 606<typedef name="const_iterator"><description><para>Constant iterator type with bidirectional capabilities. </para></description><type>implementation_defined</type></typedef> 607<method-group name="public member functions"> 608<method name="swap" cv="noexcept"><type>void</type><parameter name="that"><paramtype><classname>attribute_value_set</classname> &</paramtype></parameter><description><para>Swaps two sets</para><para><emphasis role="bold">Throws:</emphasis> Nothing. </para></description></method> 609<method name="begin" cv="const"><type>const_iterator</type><description><para> 610</para></description><returns><para>Iterator to the first element of the set. </para> 611</returns></method> 612<method name="end" cv="const"><type>const_iterator</type><description><para> 613</para></description><returns><para>Iterator to the after-the-last element of the set. </para> 614</returns></method> 615<method name="size" cv="const"><type>size_type</type><description><para> 616</para></description><returns><para>Number of elements in the set. </para> 617</returns></method> 618<method name="empty" cv="const"><type>bool</type><description><para> 619</para></description><returns><para><computeroutput>true</computeroutput> if there are no elements in the container, <computeroutput>false</computeroutput> otherwise. </para> 620</returns></method> 621<method name="find" cv="const"><type>const_iterator</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>The method finds the attribute value by name.</para><para> 622 623</para></description><returns><para>Iterator to the found element or <computeroutput>end()</computeroutput> if the attribute with such name is not found. </para> 624</returns></method> 625<method name="operator[]" cv="const"><type>mapped_type</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>Alternative lookup syntax.</para><para> 626 627</para></description><returns><para>A pointer to the attribute value if it is found with <emphasis>key</emphasis>, default-constructed mapped value otherwise. </para> 628</returns></method> 629<method name="operator[]" cv="const"><type><classname>result_of::extract</classname>< typename expressions::attribute_keyword< DescriptorT, ActorT >::value_type, DescriptorT >::type</type><template> 630 <template-type-parameter name="DescriptorT"/> 631 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 632 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>Attribute keyword. </para></description></parameter><description><para>Alternative lookup syntax.</para><para> 633 634</para></description><returns><para>A <computeroutput>value_ref</computeroutput> with extracted attribute value if it is found, empty <computeroutput>value_ref</computeroutput> otherwise. </para> 635</returns></method> 636<method name="count" cv="const"><type>size_type</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><description><para>The method counts the number of the attribute value occurrences in the set. Since there can be only one attribute value with a particular key, the method always return 0 or 1.</para><para> 637 638</para></description><returns><para>The number of times the attribute value is found in the container. </para> 639</returns></method> 640<method name="freeze"><type>void</type><description><para>The method acquires values of all adopted attributes.</para><para> 641</para></description><postconditions><para>The set is frozen. </para> 642</postconditions></method> 643<method name="insert"><type>std::pair< const_iterator, bool ></type><parameter name="key"><paramtype>key_type</paramtype><description><para>The attribute name. </para></description></parameter><parameter name="mapped"><paramtype>mapped_type const &</paramtype><description><para>The attribute value.</para></description></parameter><description><para>Inserts an element into the set. The complexity of the operation is amortized constant.</para><para> 644 645 646</para></description><requires><para>The set is frozen.</para> 647</requires><returns><para>An iterator to the inserted element and <computeroutput>true</computeroutput> if insertion succeeded. Otherwise, if the set already contains a same-named attribute value, iterator to the existing element and <computeroutput>false</computeroutput>. </para> 648</returns></method> 649<method name="insert"><type>std::pair< const_iterator, bool ></type><parameter name="value"><paramtype>const_reference</paramtype><description><para>The attribute name and value.</para></description></parameter><description><para>Inserts an element into the set. The complexity of the operation is amortized constant.</para><para> 650 651 652</para></description><requires><para>The set is frozen.</para> 653</requires><returns><para>An iterator to the inserted element and <computeroutput>true</computeroutput> if insertion succeeded. Otherwise, if the set already contains a same-named attribute value, iterator to the existing element and <computeroutput>false</computeroutput>. </para> 654</returns></method> 655<method name="insert"><type>void</type><template> 656 <template-type-parameter name="FwdIteratorT"/> 657 </template><parameter name="begin"><paramtype>FwdIteratorT</paramtype><description><para>A forward iterator that points to the first element to be inserted. </para></description></parameter><parameter name="end"><paramtype>FwdIteratorT</paramtype><description><para>A forward iterator that points to the after-the-last element to be inserted. </para></description></parameter><description><para>Mass insertion method. The complexity of the operation is linear to the number of elements inserted.</para><para> 658 659</para></description><requires><para>The set is frozen.</para> 660</requires></method> 661<method name="insert"><type>void</type><template> 662 <template-type-parameter name="FwdIteratorT"/> 663 <template-type-parameter name="OutputIteratorT"/> 664 </template><parameter name="begin"><paramtype>FwdIteratorT</paramtype><description><para>A forward iterator that points to the first element to be inserted. </para></description></parameter><parameter name="end"><paramtype>FwdIteratorT</paramtype><description><para>A forward iterator that points to the after-the-last element to be inserted. </para></description></parameter><parameter name="out"><paramtype>OutputIteratorT</paramtype><description><para>An output iterator that receives results of insertion of the elements. </para></description></parameter><description><para>Mass insertion method with ability to acquire iterators to the inserted elements. The complexity of the operation is linear to the number of elements inserted times the complexity of filling the <emphasis>out</emphasis> iterator.</para><para> 665 666</para></description><requires><para>The set is frozen.</para> 667</requires></method> 668</method-group> 669<constructor specifiers="explicit"><parameter name="reserve_count"><paramtype>size_type</paramtype><default>8</default><description><para>Number of elements to reserve space for. </para></description></parameter><description><para>Default constructor</para><para>The constructor creates an empty set which can be filled later by subsequent calls of <computeroutput>insert</computeroutput> method. Optionally, the amount of storage reserved for elements to be inserted may be passed to the constructor. The constructed set is frozen.</para><para> 670</para></description></constructor> 671<constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute_value_set</classname> &&</paramtype></parameter><description><para>Move constructor </para></description></constructor> 672<constructor><parameter name="source_attrs"><paramtype><classname>attribute_set</classname> const &</paramtype><description><para>A set of source-specific attributes. </para></description></parameter><parameter name="thread_attrs"><paramtype><classname>attribute_set</classname> const &</paramtype><description><para>A set of thread-specific attributes. </para></description></parameter><parameter name="global_attrs"><paramtype><classname>attribute_set</classname> const &</paramtype><description><para>A set of global attributes. </para></description></parameter><parameter name="reserve_count"><paramtype>size_type</paramtype><default>8</default><description><para>Amount of elements to reserve space for, in addition to the elements in the three attribute sets provided. </para></description></parameter><description><para>The constructor adopts three attribute sets into the value set. The <emphasis>source_attrs</emphasis> attributes have the greatest preference when a same-named attribute is found in several sets, <emphasis>global_attrs</emphasis> has the least. The constructed set is not frozen.</para><para> 673</para></description></constructor> 674<constructor><parameter name="source_attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of source-specific attributes. </para></description></parameter><parameter name="thread_attrs"><paramtype><classname>attribute_set</classname> const &</paramtype><description><para>A set of thread-specific attributes. </para></description></parameter><parameter name="global_attrs"><paramtype><classname>attribute_set</classname> const &</paramtype><description><para>A set of global attributes. </para></description></parameter><parameter name="reserve_count"><paramtype>size_type</paramtype><default>8</default><description><para>Amount of elements to reserve space for, in addition to the elements in the three attribute sets provided. </para></description></parameter><description><para>The constructor adopts three attribute sets into the value set. The <emphasis>source_attrs</emphasis> attributes have the greatest preference when a same-named attribute is found in several sets, <emphasis>global_attrs</emphasis> has the least. The constructed set is not frozen.</para><para> 675 676</para></description><requires><para>The <emphasis>source_attrs</emphasis> set is frozen.</para> 677</requires></constructor> 678<constructor><parameter name="source_attrs"><paramtype><classname>attribute_value_set</classname> &&</paramtype><description><para>A set of source-specific attributes. </para></description></parameter><parameter name="thread_attrs"><paramtype><classname>attribute_set</classname> const &</paramtype><description><para>A set of thread-specific attributes. </para></description></parameter><parameter name="global_attrs"><paramtype><classname>attribute_set</classname> const &</paramtype><description><para>A set of global attributes. </para></description></parameter><parameter name="reserve_count"><paramtype>size_type</paramtype><default>8</default><description><para>Amount of elements to reserve space for, in addition to the elements in the three attribute sets provided. </para></description></parameter><description><para>The constructor adopts three attribute sets into the value set. The <emphasis>source_attrs</emphasis> attributes have the greatest preference when a same-named attribute is found in several sets, <emphasis>global_attrs</emphasis> has the least. The constructed set is not frozen.</para><para> 679 680</para></description><requires><para>The <emphasis>source_attrs</emphasis> set is frozen.</para> 681</requires></constructor> 682<constructor><parameter name="that"><paramtype><classname>attribute_value_set</classname> const &</paramtype></parameter><description><para>Copy constructor.</para><para> 683 684</para></description><requires><para>The original set is frozen. </para> 685</requires><postconditions><para>The constructed set is frozen, <computeroutput>std::equal(begin(), end(), that.begin()) == true</computeroutput> </para> 686</postconditions></constructor> 687<destructor><description><para>Destructor. Releases all referenced attribute values. </para></description></destructor> 688<copy-assignment cv="noexcept"><type><classname>attribute_value_set</classname> &</type><parameter name="that"><paramtype><classname>attribute_value_set</classname></paramtype></parameter><description><para>Assignment operator </para></description></copy-assignment> 689</class> 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719<function name="swap"><type>void</type><parameter name="left"><paramtype><classname>attribute_value_set</classname> &</paramtype></parameter><parameter name="right"><paramtype><classname>attribute_value_set</classname> &</paramtype></parameter><description><para>Free swap overload </para></description></function> 720 721 722 723 724 725</namespace> 726</namespace> 727</header> 728<header name="boost/log/attributes/clock.hpp"> 729<para><para>Andrey Semashev </para> 730 731<para>01.12.2007</para> 732 733The header contains wall clock attribute implementation and typedefs. </para><namespace name="boost"> 734<namespace name="log"> 735<namespace name="attributes"> 736<class name="basic_clock"><template> 737 <template-type-parameter name="TimeTraitsT"/> 738 </template><inherit access="public">attribute</inherit><purpose>A class of an attribute that makes an attribute value of the current date and time. </purpose><description><para>The attribute generates current time stamp as a value. The type of the attribute value is determined with time traits passed to the class template as a template parameter. The time traits provided by the library use <computeroutput>boost::posix_time::ptime</computeroutput> as the time type.</para><para>Time traits also determine the way time is acquired. There are two types of time traits provided by the library: <computeroutput><classname alt="boost::log::attributes::utc_time_traits">utc_time_traits</classname></computeroutput> and <computeroutput><classname alt="boost::log::attributes::local_time_traits">local_time_traits</classname></computeroutput>. The first returns UTC time, the second returns local time. </para></description><struct name="impl"><inherit access="public">attribute::impl</inherit><purpose>Attribute factory implementation. </purpose><method-group name="public member functions"> 739<method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para> 740</para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para> 741</returns></method> 742</method-group> 743</struct><typedef name="value_type"><purpose>Generated value type. </purpose><type>TimeTraitsT::time_type</type></typedef> 744<method-group name="public member functions"> 745</method-group> 746<constructor><description><para>Default constructor </para></description></constructor> 747<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 748</class><typedef name="utc_clock"><purpose>Attribute that returns current UTC time. </purpose><type><classname>basic_clock</classname>< <classname>utc_time_traits</classname> ></type></typedef> 749<typedef name="local_clock"><purpose>Attribute that returns current local time. </purpose><type><classname>basic_clock</classname>< <classname>local_time_traits</classname> ></type></typedef> 750 751 752 753 754</namespace> 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791</namespace> 792</namespace> 793</header> 794<header name="boost/log/attributes/constant.hpp"> 795<para><para>Andrey Semashev </para> 796 797<para>15.04.2007</para> 798 799The header contains implementation of a constant attribute. </para><namespace name="boost"> 800<namespace name="log"> 801<namespace name="attributes"> 802<class name="constant"><template> 803 <template-type-parameter name="T"/> 804 </template><inherit access="public">attribute</inherit><purpose>A class of an attribute that holds a single constant value. </purpose><description><para>The constant is a simplest and one of the most frequently used types of attributes. It stores a constant value, which it eventually returns as its value each time requested. </para></description><class name="impl"><inherit access="public">attribute_value_impl< value_type ></inherit><purpose>Factory implementation. </purpose><method-group name="public member functions"> 805</method-group> 806<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor> 807<constructor specifiers="explicit" cv="noexcept(boost::is_nothrow_move_constructible< value_type >::value))"><parameter name="value"><paramtype>value_type &&</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor> 808</class><typedef name="value_type"><purpose>Attribute value type. </purpose><type>T</type></typedef> 809<method-group name="public member functions"> 810<method name="get" cv="const"><type>value_type const &</type><description><para> 811</para></description><returns><para>Reference to the contained value. </para> 812</returns></method> 813</method-group> 814<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor> 815<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &&</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor> 816<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 817</class> 818 819<function name="make_constant"><type><emphasis>unspecified</emphasis></type><template> 820 <template-type-parameter name="T"/> 821 </template><parameter name="val"><paramtype>BOOST_FWD_REF(T)</paramtype></parameter><description><para>The function constructs a <computeroutput>constant</computeroutput> attribute containing the provided value. The function automatically converts C string arguments to <computeroutput>std::basic_string</computeroutput> objects. </para></description></function> 822 823</namespace> 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860</namespace> 861</namespace> 862</header> 863<header name="boost/log/attributes/counter.hpp"> 864<para><para>Andrey Semashev </para> 865 866<para>01.05.2007</para> 867 868The header contains implementation of the counter attribute. </para><namespace name="boost"> 869<namespace name="log"> 870<namespace name="attributes"> 871<class name="counter"><template> 872 <template-type-parameter name="T"/> 873 </template><inherit access="public">attribute</inherit><purpose>A class of an attribute that counts an integral value. </purpose><description><para>This attribute acts as a counter - it returns a monotonously changing value each time requested. The attribute value type can be specified as a template parameter. The type must be an integral type. </para></description><class name="impl"><inherit access="public">attribute::impl</inherit><purpose>Factory implementation. </purpose><method-group name="public member functions"> 874<method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para> 875</para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para> 876</returns></method> 877</method-group> 878<constructor cv="noexcept"><parameter name="initial"><paramtype>value_type</paramtype></parameter><parameter name="step"><paramtype>value_type</paramtype></parameter></constructor> 879</class><typedef name="value_type"><purpose>A counter value type. </purpose><type>T</type></typedef> 880<method-group name="private member functions"> 881<method name="BOOST_STATIC_ASSERT_MSG"><type/><parameter name=""><paramtype>is_integral< T >::value</paramtype></parameter><parameter name=""><paramtype>"Boost.Log: Only integral types are supported by the <classname>counter</classname> <classname>attribute</classname>"</paramtype></parameter></method> 882</method-group> 883<method-group name="public member functions"> 884</method-group> 885<constructor specifiers="explicit"><parameter name="initial"><paramtype>value_type</paramtype><default>(value_type) 0</default><description><para>Initial value of the counter </para></description></parameter><parameter name="step"><paramtype>value_type</paramtype><default>(value_type) 1</default><description><para>Changing step of the counter. Each value acquired from the attribute will be greater than the previous one by this amount. </para></description></parameter><description><para>Constructor</para><para> 886</para></description></constructor> 887<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 888</class> 889 890 891 892</namespace> 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929</namespace> 930</namespace> 931</header> 932<header name="boost/log/attributes/current_process_id.hpp"> 933<para><para>Andrey Semashev </para> 934 935<para>12.09.2009</para> 936 937The header contains implementation of a current process id attribute </para><namespace name="boost"> 938<namespace name="log"> 939<namespace name="attributes"> 940<class name="current_process_id"><inherit access="public">constant< process_id ></inherit><purpose>A class of an attribute that holds the current process identifier. </purpose><method-group name="public member functions"> 941</method-group> 942<constructor><description><para>Constructor. Initializes the attribute with the current process identifier. </para></description></constructor> 943<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 944</class> 945 946 947 948</namespace> 949<typedef name="process_id"><purpose>Process identifier type used by the library. </purpose><type><emphasis>unspecified</emphasis></type></typedef> 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986</namespace> 987</namespace> 988</header> 989<header name="boost/log/attributes/current_process_name.hpp"> 990<para><para>Andrey Semashev </para> 991 992<para>29.07.2012</para> 993 994The header contains implementation of a current process name attribute </para><namespace name="boost"> 995<namespace name="log"> 996<namespace name="attributes"> 997<class name="current_process_name"><inherit access="public">constant< std::string ></inherit><purpose>A class of an attribute that holds the current process name. </purpose><method-group name="public member functions"> 998</method-group> 999<constructor><description><para>Constructor. Initializes the attribute with the current process name. </para></description></constructor> 1000<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 1001</class> 1002 1003 1004 1005</namespace> 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042</namespace> 1043</namespace> 1044</header> 1045<header name="boost/log/attributes/current_thread_id.hpp"> 1046<para><para>Andrey Semashev </para> 1047 1048<para>12.09.2009</para> 1049 1050The header contains implementation of a current thread id attribute </para><namespace name="boost"> 1051<namespace name="log"> 1052<namespace name="attributes"> 1053<class name="current_thread_id"><inherit access="public">attribute</inherit><purpose>A class of an attribute that always returns the current thread identifier. </purpose><description><para><note><para>This attribute can be registered globally, it will still return the correct thread identifier, no matter which thread emits the log record. </para> 1054</note> 1055</para></description><class name="impl"><inherit access="public">attribute_value::impl</inherit><purpose>Factory implementation. </purpose><method-group name="public member functions"> 1056<method name="dispatch" specifiers="virtual"><type>bool</type><parameter name="dispatcher"><paramtype>type_dispatcher &</paramtype><description><para>The object that attempts to dispatch the stored value. </para></description></parameter><description><para>The method dispatches the value to the given object.</para><para> 1057 1058</para></description><returns><para>true if <emphasis>dispatcher</emphasis> was capable to consume the real attribute value type and false otherwise. </para> 1059</returns></method> 1060<method name="detach_from_thread" specifiers="virtual"><type>intrusive_ptr< <classname>attribute_value::impl</classname> ></type><description><para>The method is called when the attribute value is passed to another thread (e.g. in case of asynchronous logging). The value should ensure it properly owns all thread-specific data.</para><para> 1061</para></description><returns><para>An actual pointer to the attribute value. It may either point to this object or another. In the latter case the returned pointer replaces the pointer used by caller to invoke this method and is considered to be a functional equivalent to the previous pointer. </para> 1062</returns></method> 1063<method name="get_type" cv="const" specifiers="virtual"><type>typeindex::type_index</type><description><para> 1064</para></description><returns><para>The attribute value type </para> 1065</returns></method> 1066</method-group> 1067</class><typedef name="value_type"><purpose>A held attribute value type. </purpose><type>thread_id</type></typedef> 1068<method-group name="public member functions"> 1069</method-group> 1070<constructor><description><para>Default constructor </para></description></constructor> 1071<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 1072</class> 1073 1074 1075 1076</namespace> 1077<typedef name="thread_id"><purpose>Thread identifier type. </purpose><type><emphasis>unspecified</emphasis></type></typedef> 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114</namespace> 1115</namespace> 1116</header> 1117<header name="boost/log/attributes/fallback_policy.hpp"> 1118<para><para>Andrey Semashev </para> 1119 1120<para>18.08.2012</para> 1121 1122The header contains definition of fallback policies when attribute value visitation or extraction fails. </para><namespace name="boost"> 1123<namespace name="log"> 1124<struct name="fallback_to_none"><description><para>The <computeroutput><classname alt="boost::log::fallback_to_none">fallback_to_none</classname></computeroutput> policy results in returning an empty value reference if the attribute value cannot be extracted. </para></description><enum name="@0"><enumvalue name="guaranteed_result"><default>= false</default></enumvalue></enum> 1125<method-group name="public static functions"> 1126<method name="apply_default" specifiers="static"><type>bool</type><template> 1127 <template-type-parameter name="FunT"/> 1128 </template><parameter name=""><paramtype>FunT &</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method> 1129<method name="apply_default" specifiers="static"><type>bool</type><template> 1130 <template-type-parameter name="FunT"/> 1131 </template><parameter name=""><paramtype>FunT const &</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method> 1132<method name="on_invalid_type" specifiers="static"><type>void</type><parameter name=""><paramtype>typeindex::type_index const &</paramtype></parameter><description><para>The method is called when value extraction failed because the attribute value has different type than requested. </para></description></method> 1133<method name="on_missing_value" specifiers="static"><type>void</type><description><para>The method is called when value extraction failed because the attribute value was not found. </para></description></method> 1134</method-group> 1135</struct><struct name="fallback_to_throw"><description><para>The <computeroutput><classname alt="boost::log::fallback_to_throw">fallback_to_throw</classname></computeroutput> policy results in throwing an exception if the attribute value cannot be extracted. </para></description><enum name="@1"><enumvalue name="guaranteed_result"><default>= true</default></enumvalue></enum> 1136<method-group name="public static functions"> 1137<method name="apply_default" specifiers="static"><type>bool</type><template> 1138 <template-type-parameter name="FunT"/> 1139 </template><parameter name=""><paramtype>FunT &</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method> 1140<method name="apply_default" specifiers="static"><type>bool</type><template> 1141 <template-type-parameter name="FunT"/> 1142 </template><parameter name=""><paramtype>FunT const &</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method> 1143<method name="on_invalid_type" specifiers="static"><type>void</type><parameter name="t"><paramtype>typeindex::type_index const &</paramtype></parameter><description><para>The method is called when value extraction failed because the attribute value has different type than requested. </para></description></method> 1144<method name="on_missing_value" specifiers="static"><type>void</type><description><para>The method is called when value extraction failed because the attribute value was not found. </para></description></method> 1145</method-group> 1146</struct> 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182</namespace> 1183</namespace> 1184</header> 1185<header name="boost/log/attributes/fallback_policy_fwd.hpp"> 1186<para><para>Andrey Semashev </para> 1187 1188<para>18.08.2012</para> 1189 1190The header contains forward declaration of fallback policies when attribute value visitation or extraction fails. </para><namespace name="boost"> 1191<namespace name="log"> 1192<struct name="fallback_to_default"><template> 1193 <template-type-parameter name="DefaultT"/> 1194 </template><description><para>The <computeroutput><classname alt="boost::log::fallback_to_default">fallback_to_default</classname></computeroutput> policy results in a default value if the attribute value cannot be extracted. </para></description><method-group name="public member functions"> 1195<method name="apply_default" cv="const"><type>bool</type><template> 1196 <template-type-parameter name="FunT"/> 1197 </template><parameter name="fun"><paramtype>FunT &</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method> 1198<method name="apply_default" cv="const"><type>bool</type><template> 1199 <template-type-parameter name="FunT"/> 1200 </template><parameter name="fun"><paramtype>FunT const &</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method> 1201</method-group> 1202<constructor><description><para>Default constructor. </para></description></constructor> 1203<constructor specifiers="explicit"><parameter name="def_val"><paramtype>default_type const &</paramtype></parameter><description><para>Initializing constructor. </para></description></constructor> 1204<method-group name="public static functions"> 1205<method name="on_invalid_type" specifiers="static"><type>void</type><parameter name=""><paramtype>typeindex::type_index const &</paramtype></parameter><description><para>The method is called when value extraction failed because the attribute value has different type than requested. </para></description></method> 1206<method name="on_missing_value" specifiers="static"><type>void</type><description><para>The method is called when value extraction failed because the attribute value was not found. </para></description></method> 1207</method-group> 1208</struct> 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244</namespace> 1245</namespace> 1246</header> 1247<header name="boost/log/attributes/function.hpp"> 1248<para><para>Andrey Semashev </para> 1249 1250<para>24.06.2007</para> 1251 1252The header contains implementation of an attribute that calls a third-party function on value acquisition. </para><namespace name="boost"> 1253<namespace name="log"> 1254<namespace name="attributes"> 1255<class name="function"><template> 1256 <template-type-parameter name="R"/> 1257 </template><inherit access="public">attribute</inherit><purpose>A class of an attribute that acquires its value from a third-party function object. </purpose><description><para>The attribute calls a stored nullary function object to acquire each value. The result type of the function object is the attribute value type.</para><para>It is not recommended to use this class directly. Use <computeroutput>make_function</computeroutput> convenience functions to construct the attribute instead. </para></description><class name="impl"><inherit access="public">attribute::impl</inherit><purpose>Base class for factory implementation. </purpose></class><class name="impl_template"><template> 1258 <template-type-parameter name="T"/> 1259 </template><inherit access="public">function< R >::impl</inherit><purpose>Factory implementation. </purpose><method-group name="public member functions"> 1260<method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para> 1261</para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para> 1262</returns></method> 1263</method-group> 1264<constructor specifiers="explicit"><parameter name="fun"><paramtype>T const &</paramtype></parameter><description><para>Constructor with the stored delegate initialization </para></description></constructor> 1265</class><typedef name="value_type"><purpose>The attribute value type. </purpose><type>R</type></typedef> 1266<method-group name="private member functions"> 1267<method name="BOOST_STATIC_ASSERT_MSG"><type/><parameter name=""><paramtype>!is_void< R >::value</paramtype></parameter><parameter name=""><paramtype>"Boost.Log: Function object return type must not be void"</paramtype></parameter></method> 1268</method-group> 1269<method-group name="public member functions"> 1270</method-group> 1271<constructor specifiers="explicit"><template> 1272 <template-type-parameter name="T"/> 1273 </template><parameter name="fun"><paramtype>T const &</paramtype></parameter><description><para>Initializing constructor </para></description></constructor> 1274<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 1275</class> 1276<function name="make_function"><type><classname>function</classname>< typename remove_cv< typename remove_reference< typename boost::result_of< T() >::type >::type >::type ></type><template> 1277 <template-type-parameter name="T"/> 1278 </template><parameter name="fun"><paramtype>T const &</paramtype><description><para>Nullary functional object that returns an actual stored value for an attribute value. </para></description></parameter><description><para>The function constructs <computeroutput>function</computeroutput> attribute instance with the provided function object.</para><para> 1279 1280</para></description><returns><para>Pointer to the attribute instance </para> 1281</returns></function> 1282 1283 1284</namespace> 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321</namespace> 1322</namespace> 1323</header> 1324<header name="boost/log/attributes/mutable_constant.hpp"> 1325<para><para>Andrey Semashev </para> 1326 1327<para>06.11.2007</para> 1328 1329The header contains implementation of a mutable constant attribute. </para><namespace name="boost"> 1330<namespace name="log"> 1331<namespace name="attributes"> 1332<class name="mutable_constant"><template> 1333 <template-type-parameter name="T"/> 1334 <template-type-parameter name="MutexT"><default>void</default></template-type-parameter> 1335 <template-type-parameter name="ScopedWriteLockT"><default>auto</default></template-type-parameter> 1336 <template-type-parameter name="ScopedReadLockT"><default>auto</default></template-type-parameter> 1337 </template><inherit access="public">attribute</inherit><purpose>A class of an attribute that holds a single constant value with ability to change it. </purpose><description><para>The <classname alt="boost::log::attributes::mutable_constant">mutable_constant</classname> attribute stores a single value of type, specified as the first template argument. This value is returned on each attribute value acquisition.</para><para>The attribute also allows to modify the stored value, even if the attribute is registered in an attribute set. In order to ensure thread safety of such modifications the <computeroutput><classname alt="boost::log::attributes::mutable_constant">mutable_constant</classname></computeroutput> class is also parametrized with three additional template arguments: mutex type, scoped write and scoped read lock types. If not specified, the lock types are automatically deduced based on the mutex type.</para><para>The implementation may avoid using these types to actually create and use the mutex, if a more efficient synchronization method is available (such as atomic operations on the value type). By default no synchronization is done. </para></description><class name="impl"><inherit access="public">attribute::impl</inherit><purpose>Factory implementation. </purpose><method-group name="private member functions"> 1338<method name="BOOST_STATIC_ASSERT_MSG"><type/><parameter name=""><paramtype>!</paramtype></parameter><parameter name=""><paramtype>"Boost.Log: Mutex and both lock types either must not be void or must all be void"</paramtype></parameter></method> 1339</method-group> 1340<method-group name="public member functions"> 1341<method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para> 1342</para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para> 1343</returns></method> 1344<method name="set"><type>void</type><parameter name="value"><paramtype>value_type const &</paramtype></parameter></method> 1345<method name="set"><type>void</type><parameter name="value"><paramtype>value_type &&</paramtype></parameter></method> 1346<method name="get" cv="const"><type>value_type</type></method> 1347</method-group> 1348<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &</paramtype></parameter><description><para>Initializing constructor </para></description></constructor> 1349<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &&</paramtype></parameter><description><para>Initializing constructor </para></description></constructor> 1350</class><typedef name="value_type"><purpose>The attribute value type. </purpose><type>T</type></typedef> 1351<method-group name="public member functions"> 1352<method name="set"><type>void</type><parameter name="value"><paramtype>value_type const &</paramtype></parameter><description><para>The method sets a new attribute value. The implementation exclusively locks the mutex in order to protect the value assignment. </para></description></method> 1353<method name="set"><type>void</type><parameter name="value"><paramtype>value_type &&</paramtype></parameter><description><para>The method sets a new attribute value. </para></description></method> 1354<method name="get" cv="const"><type>value_type</type><description><para>The method acquires the current attribute value. The implementation non-exclusively locks the mutex in order to protect the value acquisition. </para></description></method> 1355</method-group> 1356<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor> 1357<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &&</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor> 1358<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 1359<method-group name="protected member functions"> 1360<method name="get_impl" cv="const"><type><classname>impl</classname> *</type><description><para> 1361</para></description><returns><para>Pointer to the factory implementation </para> 1362</returns></method> 1363</method-group> 1364</class><class-specialization name="mutable_constant"><template> 1365 <template-type-parameter name="T"/> 1366 </template><specialization><template-arg>T</template-arg><template-arg>void</template-arg><template-arg>void</template-arg><template-arg>void</template-arg></specialization><inherit access="public">attribute</inherit><purpose>Specialization for unlocked case. </purpose><description><para>This version of attribute does not perform thread synchronization to access the stored value. </para></description><class name="impl"><inherit access="public">attribute::impl</inherit><purpose>Factory implementation. </purpose><method-group name="public member functions"> 1367<method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para> 1368</para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para> 1369</returns></method> 1370<method name="set"><type>void</type><parameter name="value"><paramtype>value_type const &</paramtype></parameter></method> 1371<method name="set"><type>void</type><parameter name="value"><paramtype>value_type &&</paramtype></parameter></method> 1372<method name="get" cv="const"><type>value_type</type></method> 1373</method-group> 1374<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &</paramtype></parameter><description><para>Initializing constructor </para></description></constructor> 1375<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &&</paramtype></parameter><description><para>Initializing constructor </para></description></constructor> 1376</class><typedef name="value_type"><purpose>The attribute value type. </purpose><type>T</type></typedef> 1377<method-group name="public member functions"> 1378<method name="set"><type>void</type><parameter name="value"><paramtype>value_type const &</paramtype></parameter><description><para>The method sets a new attribute value. </para></description></method> 1379<method name="set"><type>void</type><parameter name="value"><paramtype>value_type &&</paramtype></parameter><description><para>The method sets a new attribute value. </para></description></method> 1380<method name="get" cv="const"><type>value_type</type><description><para>The method acquires the current attribute value. </para></description></method> 1381</method-group> 1382<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor> 1383<constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &&</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor> 1384<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 1385<method-group name="protected member functions"> 1386<method name="get_impl" cv="const"><type><classname>impl</classname> *</type><description><para> 1387</para></description><returns><para>Pointer to the factory implementation </para> 1388</returns></method> 1389</method-group> 1390</class-specialization> 1391 1392 1393 1394</namespace> 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431</namespace> 1432</namespace> 1433</header> 1434<header name="boost/log/attributes/named_scope.hpp"> 1435<para><para>Andrey Semashev </para> 1436 1437<para>24.06.2007</para> 1438 1439The header contains implementation of named scope container and an attribute that allows to put the named scope to log. A number of convenience macros are also provided. </para><namespace name="boost"> 1440<namespace name="log"> 1441<namespace name="attributes"> 1442<class name="named_scope"><inherit access="public">attribute</inherit><purpose>A class of an attribute that holds stack of named scopes of the current thread. </purpose><description><para>The basic_named_scope attribute is essentially a hook to the thread-specific instance of scope list. This means that the attribute will generate different values if get_value is called in different threads. The attribute generates value with stored type <computeroutput>basic_named_scope_list< CharT ></computeroutput>.</para><para>The attribute class can also be used to gain access to the scope stack instance, e.g. to get its copy or to push or pop a scope entry. However, it is highly not recommended to maintain scope list manually. Use <computeroutput>BOOST_LOG_NAMED_SCOPE</computeroutput> or <computeroutput>BOOST_LOG_FUNCTION</computeroutput> macros instead. </para></description><struct name="sentry"><purpose>Sentry object class to automatically push and pop scopes. </purpose><method-group name="public member functions"> 1443</method-group> 1444<constructor cv="noexcept"><parameter name="sn"><paramtype>string_literal const &</paramtype><description><para>Scope name. </para></description></parameter><parameter name="fn"><paramtype>string_literal const &</paramtype><description><para>File name, in which the scope is located. </para></description></parameter><parameter name="ln"><paramtype>unsigned int</paramtype><description><para>Line number in the file. </para></description></parameter><parameter name="t"><paramtype>scope_entry::scope_name_type</paramtype><default>scope_entry::general</default></parameter><description><para>Constructor. Pushes the specified scope to the end of the thread-local list of scopes.</para><para> 1445</para></description></constructor> 1446<destructor><description><para>Destructor. Removes the last pushed scope from the thread-local list of scopes. </para></description></destructor> 1447<constructor cv="= delete"><parameter name=""><paramtype><classname>sentry</classname> const &</paramtype></parameter></constructor> 1448<copy-assignment cv="= delete"><type><classname>sentry</classname> &</type><parameter name=""><paramtype><classname>sentry</classname> const &</paramtype></parameter></copy-assignment> 1449</struct><typedef name="value_type"><purpose>Scope names stack (the attribute value type) </purpose><type><classname>named_scope_list</classname></type></typedef> 1450<typedef name="scope_entry"><purpose>Scope entry. </purpose><type>value_type::value_type</type></typedef> 1451<method-group name="public member functions"> 1452</method-group> 1453<constructor><description><para>Constructor. Creates an attribute. </para></description></constructor> 1454<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 1455<method-group name="public static functions"> 1456<method name="push_scope" cv="noexcept" specifiers="static"><type>void</type><parameter name="entry"><paramtype>scope_entry const &</paramtype></parameter><description><para>The method pushes the scope to the back of the current thread's scope list</para><para><emphasis role="bold">Throws:</emphasis> Nothing. </para></description></method> 1457<method name="pop_scope" cv="noexcept" specifiers="static"><type>void</type><description><para>The method pops the last pushed scope from the current thread's scope list</para><para><emphasis role="bold">Throws:</emphasis> Nothing. </para></description></method> 1458<method name="get_scopes" specifiers="static"><type>value_type const &</type><description><para> 1459<note><para>The returned reference is only valid until the current thread ends. The scopes in the returned container may change if the execution scope is changed (i.e. either <computeroutput>push_scope</computeroutput> or <computeroutput>pop_scope</computeroutput> is called). User has to copy the stack if he wants to keep it intact regardless of the execution scope. </para> 1460</note> 1461</para></description><returns><para>The current thread's list of scopes</para> 1462</returns></method> 1463</method-group> 1464</class><struct name="named_scope_entry"><purpose>The structure contains all information about a named scope. </purpose><description><para>The named scope entries are stored as elements of <computeroutput>basic_named_scope_list</computeroutput> container, which in turn can be acquired either from the <computeroutput>basic_named_scope</computeroutput> attribute value or from a thread-local instance. </para></description><enum name="scope_name_type"><enumvalue name="general"><purpose>The scope name contains some unstructured string that should not be interpreted by the library. </purpose></enumvalue><enumvalue name="function"><purpose>The scope name contains a function signature. </purpose></enumvalue><purpose>Scope entry type. </purpose><description><para>Describes scope name specifics </para></description></enum> 1465<data-member name="scope_name"><type>string_literal</type><description><para>The scope name (e.g. a function signature) </para></description></data-member> 1466<data-member name="file_name"><type>string_literal</type><description><para>The source file name </para></description></data-member> 1467<data-member name="line"><type>unsigned int</type><description><para>The line number in the source file </para></description></data-member> 1468<data-member name="type"><type>scope_name_type</type><description><para>The scope name type </para></description></data-member> 1469<method-group name="public member functions"> 1470</method-group> 1471<constructor cv="noexcept"><parameter name="sn"><paramtype>string_literal const &</paramtype></parameter><parameter name="fn"><paramtype>string_literal const &</paramtype></parameter><parameter name="ln"><paramtype>unsigned int</paramtype></parameter><parameter name="t"><paramtype>scope_name_type</paramtype><default>general</default></parameter><description><para>Initializing constructor</para><para> 1472<emphasis role="bold">Throws:</emphasis> Nothing. </para></description><postconditions><para><computeroutput>scope_name == sn && file_name == fn && line == ln</computeroutput></para> 1473</postconditions></constructor> 1474</struct><class name="named_scope_list"><purpose>The class implements the list of scopes. </purpose><description><para>The scope list provides a read-only access to a doubly-linked list of scopes. </para></description><typedef name="allocator_type"><purpose>Allocator type. </purpose><type>std::allocator< <classname>named_scope_entry</classname> ></type></typedef> 1475<typedef name="value_type"><type><emphasis>unspecified</emphasis></type></typedef> 1476<typedef name="size_type"><type><emphasis>unspecified</emphasis></type></typedef> 1477<typedef name="difference_type"><type><emphasis>unspecified</emphasis></type></typedef> 1478<typedef name="pointer"><type><emphasis>unspecified</emphasis></type></typedef> 1479<typedef name="const_pointer"><type><emphasis>unspecified</emphasis></type></typedef> 1480<typedef name="reference"><type>value_type &</type></typedef> 1481<typedef name="const_reference"><type>value_type const &</type></typedef> 1482<typedef name="const_iterator"><description><para>A constant iterator to the sequence of scopes. Complies to bidirectional iterator requirements. </para></description><type>implementation_defined</type></typedef> 1483<typedef name="iterator"><description><para>An iterator to the sequence of scopes. Complies to bidirectional iterator requirements. </para></description><type>implementation_defined</type></typedef> 1484<typedef name="const_reverse_iterator"><description><para>A constant reverse iterator to the sequence of scopes. Complies to bidirectional iterator requirements. </para></description><type>implementation_defined</type></typedef> 1485<typedef name="reverse_iterator"><description><para>A reverse iterator to the sequence of scopes. Complies to bidirectional iterator requirements. </para></description><type>implementation_defined</type></typedef> 1486<method-group name="public member functions"> 1487<method name="begin" cv="const"><type>const_iterator</type><description><para> 1488</para></description><returns><para>Constant iterator to the first element of the container. </para> 1489</returns></method> 1490<method name="end" cv="const"><type>const_iterator</type><description><para> 1491</para></description><returns><para>Constant iterator to the after-the-last element of the container. </para> 1492</returns></method> 1493<method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para> 1494</para></description><returns><para>Constant iterator to the last element of the container. </para> 1495</returns></method> 1496<method name="rend" cv="const"><type>const_reverse_iterator</type><description><para> 1497</para></description><returns><para>Constant iterator to the before-the-first element of the container. </para> 1498</returns></method> 1499<method name="size" cv="const"><type>size_type</type><description><para> 1500</para></description><returns><para>The number of elements in the container </para> 1501</returns></method> 1502<method name="empty" cv="const"><type>bool</type><description><para> 1503</para></description><returns><para>true if the container is empty and false otherwise </para> 1504</returns></method> 1505<method name="swap"><type>void</type><parameter name="that"><paramtype><classname>named_scope_list</classname> &</paramtype></parameter><description><para>Swaps two instances of the container </para></description></method> 1506<method name="back" cv="const"><type>const_reference</type><description><para> 1507</para></description><returns><para>Last pushed scope entry </para> 1508</returns></method> 1509<method name="front" cv="const"><type>const_reference</type><description><para> 1510</para></description><returns><para>First pushed scope entry </para> 1511</returns></method> 1512</method-group> 1513<constructor><description><para>Default constructor</para><para> 1514</para></description><postconditions><para><computeroutput>empty() == true</computeroutput> </para> 1515</postconditions></constructor> 1516<constructor><parameter name="that"><paramtype><classname>named_scope_list</classname> const &</paramtype></parameter><description><para>Copy constructor</para><para> 1517</para></description><postconditions><para><computeroutput>std::equal(begin(), end(), that.begin()) == true</computeroutput> </para> 1518</postconditions></constructor> 1519<destructor><description><para>Destructor. Destroys the stored entries. </para></description></destructor> 1520<copy-assignment><type><classname>named_scope_list</classname> &</type><parameter name="that"><paramtype><classname>named_scope_list</classname> const &</paramtype></parameter><description><para>Assignment operator</para><para> 1521</para></description><postconditions><para><computeroutput>std::equal(begin(), end(), that.begin()) == true</computeroutput> </para> 1522</postconditions></copy-assignment> 1523</class><function name="operator<<"><type>std::basic_ostream< CharT, TraitsT > &</type><template> 1524 <template-type-parameter name="CharT"/> 1525 <template-type-parameter name="TraitsT"/> 1526 </template><parameter name="strm"><paramtype>std::basic_ostream< CharT, TraitsT > &</paramtype></parameter><parameter name="sl"><paramtype><classname>named_scope_list</classname> const &</paramtype></parameter><purpose>Stream output operator. </purpose></function> 1527 1528 1529 1530</namespace> 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567</namespace> 1568</namespace> 1569<macro name="BOOST_LOG_NAMED_SCOPE" kind="functionlike"><macro-parameter name="name"/><description><para>Macro for scope markup. The specified scope name is pushed to the end of the current thread scope list. </para></description></macro> 1570<macro name="BOOST_LOG_FUNCTION" kind="functionlike"><macro-parameter name=""/><description><para>Macro for function scope markup. The scope name is constructed with help of compiler and contains the current function signature. The scope name is pushed to the end of the current thread scope list.</para><para>Not all compilers have support for this macro. The exact form of the scope name may vary from one compiler to another. </para></description></macro> 1571<macro name="BOOST_LOG_FUNC" kind="functionlike"><macro-parameter name=""/><description><para>Macro for function scope markup. The scope name is constructed with help of compiler and contains the current function name. It may be shorter than what <computeroutput>BOOST_LOG_FUNCTION</computeroutput> macro produces. The scope name is pushed to the end of the current thread scope list.</para><para>Not all compilers have support for this macro. The exact form of the scope name may vary from one compiler to another. </para></description></macro> 1572</header> 1573<header name="boost/log/attributes/scoped_attribute.hpp"> 1574<para><para>Andrey Semashev </para> 1575 1576<para>13.05.2007</para> 1577 1578The header contains definition of facilities to define scoped attributes. </para><namespace name="boost"> 1579<namespace name="log"> 1580<typedef name="scoped_attribute"><purpose>Scoped attribute guard type. </purpose><type><emphasis>unspecified</emphasis></type></typedef> 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609<function name="add_scoped_logger_attribute"><type><emphasis>unspecified</emphasis></type><template> 1610 <template-type-parameter name="LoggerT"/> 1611 </template><parameter name="l"><paramtype>LoggerT &</paramtype><description><para>Logger to register the attribute in </para></description></parameter><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>Attribute name </para></description></parameter><parameter name="attr"><paramtype><classname>attribute</classname> const &</paramtype><description><para>The attribute. Must not be NULL. </para></description></parameter><description><para>Registers an attribute in the logger</para><para> 1612 1613</para></description><returns><para>An unspecified guard object which may be used to initialize a <computeroutput>scoped_attribute</computeroutput> variable. </para> 1614</returns></function> 1615<function name="add_scoped_thread_attribute"><type><emphasis>unspecified</emphasis></type><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>Attribute name </para></description></parameter><parameter name="attr"><paramtype><classname>attribute</classname> const &</paramtype><description><para>The attribute. Must not be NULL. </para></description></parameter><description><para>Registers a thread-specific attribute</para><para> 1616 1617</para></description><returns><para>An unspecified guard object which may be used to initialize a <computeroutput>scoped_attribute</computeroutput> variable. </para> 1618</returns></function> 1619 1620 1621 1622 1623 1624 1625</namespace> 1626</namespace> 1627<macro name="BOOST_LOG_SCOPED_LOGGER_ATTR" kind="functionlike"><macro-parameter name="logger"/><macro-parameter name="attr_name"/><macro-parameter name="attr"/><purpose>The macro sets a scoped logger-wide attribute in a more compact way. </purpose></macro> 1628<macro name="BOOST_LOG_SCOPED_LOGGER_TAG" kind="functionlike"><macro-parameter name="logger"/><macro-parameter name="attr_name"/><macro-parameter name="attr_value"/><purpose>The macro sets a scoped logger-wide tag in a more compact way. </purpose></macro> 1629<macro name="BOOST_LOG_SCOPED_THREAD_ATTR" kind="functionlike"><macro-parameter name="attr_name"/><macro-parameter name="attr"/><purpose>The macro sets a scoped thread-wide attribute in a more compact way. </purpose></macro> 1630<macro name="BOOST_LOG_SCOPED_THREAD_TAG" kind="functionlike"><macro-parameter name="attr_name"/><macro-parameter name="attr_value"/><purpose>The macro sets a scoped thread-wide tag in a more compact way. </purpose></macro> 1631</header> 1632<header name="boost/log/attributes/time_traits.hpp"> 1633<para><para>Andrey Semashev </para> 1634 1635<para>01.12.2007</para> 1636 1637The header contains implementation of time traits that are used in various parts of the library to acquire current time. </para><namespace name="boost"> 1638<namespace name="log"> 1639<namespace name="attributes"> 1640<struct name="basic_time_traits"><purpose>Base class for time traits involving Boost.DateTime. </purpose><typedef name="time_type"><purpose>Time type. </purpose><type>posix_time::ptime</type></typedef> 1641<typedef name="clock_source"><purpose>Current time source. </purpose><type>posix_time::second_clock</type></typedef> 1642</struct><struct name="local_time_traits"><inherit access="public">basic_time_traits</inherit><purpose>Time traits that describes local time acquirement via Boost.DateTime facilities. </purpose><method-group name="public static functions"> 1643<method name="get_clock" specifiers="static"><type>time_type</type><description><para> 1644</para></description><returns><para>Current time stamp </para> 1645</returns></method> 1646</method-group> 1647</struct><struct name="utc_time_traits"><inherit access="public">basic_time_traits</inherit><purpose>Time traits that describes UTC time acquirement via Boost.DateTime facilities. </purpose><method-group name="public static functions"> 1648<method name="get_clock" specifiers="static"><type>time_type</type><description><para> 1649</para></description><returns><para>Current time stamp </para> 1650</returns></method> 1651</method-group> 1652</struct> 1653 1654 1655 1656</namespace> 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693</namespace> 1694</namespace> 1695</header> 1696<header name="boost/log/attributes/timer.hpp"> 1697<para><para>Andrey Semashev </para> 1698 1699<para>02.12.2007</para> 1700 1701The header contains implementation of a stop watch attribute. </para><namespace name="boost"> 1702<namespace name="log"> 1703<namespace name="attributes"> 1704<class name="timer"><inherit access="public">attribute</inherit><purpose>A class of an attribute that makes an attribute value of the time interval since construction. </purpose><description><para>The timer attribute calculates the time passed since its construction and returns it on value acquisition. The attribute value type is <computeroutput>boost::posix_time::time_duration</computeroutput>.</para><para>On Windows platform there are two implementations of the attribute. The default one is more precise but a bit slower. This version uses <computeroutput>QueryPerformanceFrequence</computeroutput>/<computeroutput>QueryPerformanceCounter</computeroutput> API to calculate elapsed time.</para><para>There are known problems with these functions when used with some CPUs, notably AMD Athlon with Cool'n'Quiet technology enabled. See the following links for more information and possible resolutions:</para><para><ulink url="http://support.microsoft.com/?scid=kb;en-us;895980">http://support.microsoft.com/?scid=kb;en-us;895980</ulink> <ulink url="http://support.microsoft.com/?id=896256">http://support.microsoft.com/?id=896256</ulink></para><para>In case if none of these solutions apply, you are free to define <computeroutput>BOOST_LOG_NO_QUERY_PERFORMANCE_COUNTER</computeroutput> macro to fall back to another implementation based on Boost.DateTime. </para></description><typedef name="value_type"><purpose>Attribute value type. </purpose><type>utc_time_traits::time_type::time_duration_type</type></typedef> 1705<method-group name="public member functions"> 1706</method-group> 1707<constructor><description><para>Constructor. Starts time counting. </para></description></constructor> 1708<constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor> 1709</class> 1710 1711 1712 1713</namespace> 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750</namespace> 1751</namespace> 1752</header> 1753<header name="boost/log/attributes/value_extraction.hpp"> 1754<para><para>Andrey Semashev </para> 1755 1756<para>01.03.2008</para> 1757 1758The header contains implementation of tools for extracting an attribute value from the view. </para><namespace name="boost"> 1759<namespace name="log"> 1760<namespace name="result_of"> 1761</namespace> 1762 1763 1764 1765 1766 1767 1768 1769<function name="extract"><type><classname>result_of::extract</classname>< T, TagT >::type</type><template> 1770 <template-type-parameter name="T"/> 1771 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1772 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1773 1774</para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para> 1775</returns></function> 1776<function name="extract"><type><classname>result_of::extract</classname>< T, TagT >::type</type><template> 1777 <template-type-parameter name="T"/> 1778 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1779 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1780 1781</para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para> 1782</returns></function> 1783<function name="extract"><type><classname>result_of::extract</classname>< T, TagT >::type</type><template> 1784 <template-type-parameter name="T"/> 1785 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1786 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1787 1788</para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para> 1789</returns></function> 1790<function name="extract"><type><classname>result_of::extract</classname>< T, TagT >::type</type><template> 1791 <template-type-parameter name="T"/> 1792 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1793 </template><parameter name="value"><paramtype><classname>attribute_value</classname> const &</paramtype><description><para>Attribute value. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1794 1795</para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para> 1796</returns></function> 1797<function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>< T, TagT >::type</type><template> 1798 <template-type-parameter name="T"/> 1799 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1800 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1801 1802 1803</para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para> 1804</returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function> 1805<function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>< T, TagT >::type</type><template> 1806 <template-type-parameter name="T"/> 1807 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1808 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1809 1810 1811</para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para> 1812</returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function> 1813<function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>< T, TagT >::type</type><template> 1814 <template-type-parameter name="T"/> 1815 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1816 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1817 1818 1819</para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para> 1820</returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function> 1821<function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>< T, TagT >::type</type><template> 1822 <template-type-parameter name="T"/> 1823 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1824 </template><parameter name="value"><paramtype><classname>attribute_value</classname> const &</paramtype><description><para>Attribute value. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1825 1826 1827</para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para> 1828</returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function> 1829<function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>< T, DefaultT, TagT >::type</type><template> 1830 <template-type-parameter name="T"/> 1831 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1832 <template-type-parameter name="DefaultT"/> 1833 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><parameter name="def_val"><paramtype>DefaultT const &</paramtype><description><para>The default value </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para><note><para>Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.</para> 1834</note> 1835 1836 1837</para></description><returns><para>The extracted value, if found. The default value otherwise. </para> 1838</returns></function> 1839<function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>< T, DefaultT, TagT >::type</type><template> 1840 <template-type-parameter name="T"/> 1841 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1842 <template-type-parameter name="DefaultT"/> 1843 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="def_val"><paramtype>DefaultT const &</paramtype><description><para>The default value </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para><note><para>Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.</para> 1844</note> 1845 1846 1847</para></description><returns><para>The extracted value, if found. The default value otherwise. </para> 1848</returns></function> 1849<function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>< T, DefaultT, TagT >::type</type><template> 1850 <template-type-parameter name="T"/> 1851 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1852 <template-type-parameter name="DefaultT"/> 1853 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="def_val"><paramtype>DefaultT const &</paramtype><description><para>The default value </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para><note><para>Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.</para> 1854</note> 1855 1856 1857</para></description><returns><para>The extracted value, if found. The default value otherwise. </para> 1858</returns></function> 1859<function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>< T, DefaultT, TagT >::type</type><template> 1860 <template-type-parameter name="T"/> 1861 <template-type-parameter name="TagT"><default>void</default></template-type-parameter> 1862 <template-type-parameter name="DefaultT"/> 1863 </template><parameter name="value"><paramtype><classname>attribute_value</classname> const &</paramtype><description><para>Attribute value. </para></description></parameter><parameter name="def_val"><paramtype>DefaultT const &</paramtype><description><para>The default value </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para><note><para>Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.</para> 1864</note> 1865 1866 1867</para></description><returns><para>The extracted value, if found. The default value otherwise. </para> 1868</returns></function> 1869<function name="extract"><type><classname>result_of::extract</classname>< typename DescriptorT::value_type, DescriptorT >::type</type><template> 1870 <template-type-parameter name="DescriptorT"/> 1871 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1872 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1873 1874</para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para> 1875</returns></function> 1876<function name="extract"><type><classname>result_of::extract</classname>< typename DescriptorT::value_type, DescriptorT >::type</type><template> 1877 <template-type-parameter name="DescriptorT"/> 1878 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1879 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1880 1881</para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para> 1882</returns></function> 1883<function name="extract"><type><classname>result_of::extract</classname>< typename DescriptorT::value_type, DescriptorT >::type</type><template> 1884 <template-type-parameter name="DescriptorT"/> 1885 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1886 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1887 1888</para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para> 1889</returns></function> 1890<function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>< typename DescriptorT::value_type, DescriptorT >::type</type><template> 1891 <template-type-parameter name="DescriptorT"/> 1892 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1893 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1894 1895 1896</para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para> 1897</returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function> 1898<function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>< typename DescriptorT::value_type, DescriptorT >::type</type><template> 1899 <template-type-parameter name="DescriptorT"/> 1900 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1901 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1902 1903 1904</para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para> 1905</returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function> 1906<function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>< typename DescriptorT::value_type, DescriptorT >::type</type><template> 1907 <template-type-parameter name="DescriptorT"/> 1908 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1909 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para> 1910 1911 1912</para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para> 1913</returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function> 1914<function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>< typename DescriptorT::value_type, DefaultT, DescriptorT >::type</type><template> 1915 <template-type-parameter name="DescriptorT"/> 1916 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1917 <template-type-parameter name="DefaultT"/> 1918 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><parameter name="def_val"><paramtype>DefaultT const &</paramtype><description><para>The default value </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.</para><para><note><para>Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.</para> 1919</note> 1920 1921 1922</para></description><returns><para>The extracted value, if found. The default value otherwise. </para> 1923</returns></function> 1924<function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>< typename DescriptorT::value_type, DefaultT, DescriptorT >::type</type><template> 1925 <template-type-parameter name="DescriptorT"/> 1926 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1927 <template-type-parameter name="DefaultT"/> 1928 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="def_val"><paramtype>DefaultT const &</paramtype><description><para>The default value </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para><note><para>Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.</para> 1929</note> 1930 1931 1932</para></description><returns><para>The extracted value, if found. The default value otherwise. </para> 1933</returns></function> 1934<function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>< typename DescriptorT::value_type, DefaultT, DescriptorT >::type</type><template> 1935 <template-type-parameter name="DescriptorT"/> 1936 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 1937 <template-type-parameter name="DefaultT"/> 1938 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="def_val"><paramtype>DefaultT const &</paramtype><description><para>The default value </para></description></parameter><description><para>The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para><note><para>Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.</para> 1939</note> 1940 1941 1942</para></description><returns><para>The extracted value, if found. The default value otherwise. </para> 1943</returns></function> 1944 1945 1946 1947 1948 1949 1950 1951 1952</namespace> 1953</namespace> 1954</header> 1955<header name="boost/log/attributes/value_extraction_fwd.hpp"> 1956<para><para>Andrey Semashev </para> 1957 1958<para>01.03.2008</para> 1959 1960The header contains forward declaration of tools for extracting attribute values from the view. </para><namespace name="boost"> 1961<namespace name="log"> 1962<class name="value_extractor"><template> 1963 <template-type-parameter name="T"/> 1964 <template-type-parameter name="FallbackPolicyT"/> 1965 <template-type-parameter name="TagT"/> 1966 </template><inherit access="private">FallbackPolicyT</inherit><purpose>Generic attribute value extractor. </purpose><description><para>Attribute value extractor is a functional object that attempts to find and extract the stored attribute value from the attribute values view or a log record. The extracted value is returned from the extractor. </para></description><method-group name="public member functions"> 1967<method name="operator()" cv="const"><type>result_type</type><parameter name="attr"><paramtype><classname>attribute_value</classname> const &</paramtype><description><para>The attribute value to extract from. </para></description></parameter><description><para>Extraction operator. Attempts to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.</para><para> 1968 1969</para></description><returns><para>The extracted value, if extraction succeeded, an empty value otherwise. </para> 1970</returns></method> 1971<method name="operator()" cv="const"><type>result_type</type><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><description><para>Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.</para><para> 1972 1973</para></description><returns><para>The extracted value, if extraction succeeded, an empty value otherwise. </para> 1974</returns></method> 1975<method name="operator()" cv="const"><type>result_type</type><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.</para><para> 1976 1977</para></description><returns><para>The extracted value, if extraction succeeded, an empty value otherwise. </para> 1978</returns></method> 1979<method name="operator()" cv="const"><type>result_type</type><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><description><para>Extraction operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If extraction succeeds, the extracted value is returned.</para><para> 1980 1981</para></description><returns><para>The extracted value, if extraction succeeded, an empty value otherwise. </para> 1982</returns></method> 1983<method name="get_fallback_policy" cv="const"><type>fallback_policy const &</type><description><para> 1984</para></description><returns><para>Fallback policy </para> 1985</returns></method> 1986</method-group> 1987<constructor><parameter name="that"><paramtype><classname>value_extractor</classname> const &</paramtype></parameter><description><para>Default constructor</para><para>Copy constructor </para></description></constructor> 1988<constructor specifiers="explicit"><template> 1989 <template-type-parameter name="U"/> 1990 </template><parameter name="arg"><paramtype>U const &</paramtype><description><para>Fallback policy constructor argument </para></description></parameter><description><para>Constructor</para><para> 1991</para></description></constructor> 1992</class><namespace name="result_of"> 1993<struct name="extract"><template> 1994 <template-type-parameter name="T"/> 1995 <template-type-parameter name="TagT"/> 1996 </template><purpose>A metafunction that allows to acquire the result of the value extraction. </purpose><description><para>The metafunction results in a type that is in form of <computeroutput>value_ref< T, TagT ></computeroutput>. </para></description></struct><struct name="extract_or_default"><template> 1997 <template-type-parameter name="T"/> 1998 <template-type-parameter name="DefaultT"/> 1999 <template-type-parameter name="TagT"/> 2000 </template><purpose>A metafunction that allows to acquire the result of the value extraction. </purpose><description><para>The metafunction results in a type that is in form of <computeroutput>T const&</computeroutput>, if <computeroutput>T</computeroutput> is not an MPL type sequence and <computeroutput>DefaultT</computeroutput> is the same as <computeroutput>T</computeroutput>, or <computeroutput>value_ref< TypesT, TagT ></computeroutput> otherwise, with <computeroutput>TypesT</computeroutput> being a type sequence comprising the types from sequence <computeroutput>T</computeroutput> and <computeroutput>DefaultT</computeroutput>, if it is not present in <computeroutput>T</computeroutput> already. </para></description></struct><struct name="extract_or_throw"><template> 2001 <template-type-parameter name="T"/> 2002 <template-type-parameter name="TagT"/> 2003 </template><purpose>A metafunction that allows to acquire the result of the value extraction. </purpose><description><para>The metafunction results in a type that is in form of <computeroutput>T const&</computeroutput>, if <computeroutput>T</computeroutput> is not an MPL type sequence, or <computeroutput>value_ref< T, TagT ></computeroutput> otherwise. In the latter case the value reference shall never be empty. </para></description></struct></namespace> 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040</namespace> 2041</namespace> 2042</header> 2043<header name="boost/log/attributes/value_visitation.hpp"> 2044<para><para>Andrey Semashev </para> 2045 2046<para>01.03.2008</para> 2047 2048The header contains implementation of convenience tools to apply visitors to an attribute value in the view. </para><namespace name="boost"> 2049<namespace name="log"> 2050<class name="visitation_result"><purpose>The class represents attribute value visitation result. </purpose><description><para>The main purpose of this class is to provide a convenient interface for checking whether the attribute value visitation succeeded or not. It also allows to discover the actual cause of failure, should the operation fail. </para></description><enum name="error_code"><enumvalue name="ok"><purpose>The attribute value has been visited successfully. </purpose></enumvalue><enumvalue name="value_not_found"><purpose>The attribute value is not present in the view. </purpose></enumvalue><enumvalue name="value_has_invalid_type"><purpose>The attribute value is present in the view, but has an unexpected type. </purpose></enumvalue><purpose>Error codes for attribute value visitation. </purpose></enum> 2051<method-group name="public member functions"> 2052<method name="conversion-operator" cv="const noexcept" specifiers="explicit"><type>bool</type><description><para>Checks if the visitation was successful.</para><para> 2053</para></description><returns><para><computeroutput>true</computeroutput> if the value was visited successfully, <computeroutput>false</computeroutput> otherwise. </para> 2054</returns></method> 2055<method name="operator!" cv="const noexcept"><type>bool</type><description><para>Checks if the visitation was unsuccessful.</para><para> 2056</para></description><returns><para><computeroutput>false</computeroutput> if the value was visited successfully, <computeroutput>true</computeroutput> otherwise. </para> 2057</returns></method> 2058<method name="code" cv="const noexcept"><type>error_code</type><description><para> 2059</para></description><returns><para>The actual result code of value visitation </para> 2060</returns></method> 2061</method-group> 2062<constructor cv="noexcept"><parameter name="code"><paramtype>error_code</paramtype><default>ok</default></parameter><description><para>Initializing constructor. Creates the result that is equivalent to the specified error code. </para></description></constructor> 2063</class><function name="visit"><type><classname>visitation_result</classname></type><template> 2064 <template-type-parameter name="T"/> 2065 <template-type-parameter name="VisitorT"/> 2066 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to visit. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>The function applies a visitor to an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para> 2067 2068</para></description><returns><para>The result of visitation. </para> 2069</returns></function> 2070<function name="visit"><type><classname>visitation_result</classname></type><template> 2071 <template-type-parameter name="T"/> 2072 <template-type-parameter name="VisitorT"/> 2073 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to visit. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>The function applies a visitor to an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para> 2074 2075</para></description><returns><para>The result of visitation. </para> 2076</returns></function> 2077<function name="visit"><type><classname>visitation_result</classname></type><template> 2078 <template-type-parameter name="T"/> 2079 <template-type-parameter name="VisitorT"/> 2080 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>The name of the attribute value to visit. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>The function applies a visitor to an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para> 2081 2082</para></description><returns><para>The result of visitation. </para> 2083</returns></function> 2084<function name="visit"><type><classname>visitation_result</classname></type><template> 2085 <template-type-parameter name="T"/> 2086 <template-type-parameter name="VisitorT"/> 2087 </template><parameter name="value"><paramtype><classname>attribute_value</classname> const &</paramtype><description><para>The attribute value to visit. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>The function applies a visitor to an attribute value. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para> 2088 2089</para></description><returns><para>The result of visitation. </para> 2090</returns></function> 2091<function name="visit"><type><classname>visitation_result</classname></type><template> 2092 <template-type-parameter name="DescriptorT"/> 2093 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 2094 <template-type-parameter name="VisitorT"/> 2095 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to visit. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>The function applies a visitor to an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para> 2096 2097</para></description><returns><para>The result of visitation. </para> 2098</returns></function> 2099<function name="visit"><type><classname>visitation_result</classname></type><template> 2100 <template-type-parameter name="DescriptorT"/> 2101 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 2102 <template-type-parameter name="VisitorT"/> 2103 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to visit. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>The function applies a visitor to an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para> 2104 2105</para></description><returns><para>The result of visitation. </para> 2106</returns></function> 2107<function name="visit"><type><classname>visitation_result</classname></type><template> 2108 <template-type-parameter name="DescriptorT"/> 2109 <template-nontype-parameter name="ActorT"><type>template< typename > class</type></template-nontype-parameter> 2110 <template-type-parameter name="VisitorT"/> 2111 </template><parameter name="keyword"><paramtype>expressions::attribute_keyword< DescriptorT, ActorT > const &</paramtype><description><para>The keyword of the attribute value to visit. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>The function applies a visitor to an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be visited.</para><para> 2112 2113</para></description><returns><para>The result of visitation. </para> 2114</returns></function> 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144</namespace> 2145</namespace> 2146</header> 2147<header name="boost/log/attributes/value_visitation_fwd.hpp"> 2148<para><para>Andrey Semashev </para> 2149 2150<para>01.03.2008</para> 2151 2152The header contains forward declaration of convenience tools to apply visitors to an attribute value in the view. </para><namespace name="boost"> 2153<namespace name="log"> 2154<class name="value_visitor_invoker"><template> 2155 <template-type-parameter name="T"/> 2156 <template-type-parameter name="FallbackPolicyT"/> 2157 </template><inherit access="private">FallbackPolicyT</inherit><purpose>Generic attribute value visitor invoker. </purpose><description><para>Attribute value invoker is a functional object that attempts to find and extract the stored attribute value from the attribute value view or a log record. The extracted value is passed to a unary function object (the visitor) provided by user.</para><para>The invoker can be specialized on one or several attribute value types that should be specified in the second template argument. </para></description><method-group name="public member functions"> 2158<method name="operator()" cv="const"><type>result_type</type><template> 2159 <template-type-parameter name="VisitorT"/> 2160 </template><parameter name="attr"><paramtype><classname>attribute_value</classname> const &</paramtype><description><para>An attribute value to apply the visitor to. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>Visitation operator. Attempts to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to <emphasis>visitor</emphasis>.</para><para> 2161 2162</para></description><returns><para>The result of visitation. </para> 2163</returns></method> 2164<method name="operator()" cv="const"><type>result_type</type><template> 2165 <template-type-parameter name="VisitorT"/> 2166 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &</paramtype><description><para>A set of attribute values in which to look for the specified attribute value. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>Visitation operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to <emphasis>visitor</emphasis>.</para><para> 2167 2168</para></description><returns><para>The result of visitation. </para> 2169</returns></method> 2170<method name="operator()" cv="const"><type>result_type</type><template> 2171 <template-type-parameter name="VisitorT"/> 2172 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="rec"><paramtype>record const &</paramtype><description><para>A log record. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>Visitation operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to <emphasis>visitor</emphasis>.</para><para> 2173 2174</para></description><returns><para>The result of visitation. </para> 2175</returns></method> 2176<method name="operator()" cv="const"><type>result_type</type><template> 2177 <template-type-parameter name="VisitorT"/> 2178 </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="rec"><paramtype>record_view const &</paramtype><description><para>A log record view. The attribute value will be sought among those associated with the record. </para></description></parameter><parameter name="visitor"><paramtype>VisitorT</paramtype><description><para>A receiving function object to pass the attribute value to. </para></description></parameter><description><para>Visitation operator. Looks for an attribute value with the specified name and tries to acquire the stored value of one of the supported types. If acquisition succeeds, the value is passed to <emphasis>visitor</emphasis>.</para><para> 2179 2180</para></description><returns><para>The result of visitation. </para> 2181</returns></method> 2182<method name="get_fallback_policy" cv="const"><type>fallback_policy const &</type><description><para> 2183</para></description><returns><para>Fallback policy </para> 2184</returns></method> 2185</method-group> 2186<constructor><parameter name="that"><paramtype><classname>value_visitor_invoker</classname> const &</paramtype></parameter><description><para>Default constructor</para><para>Copy constructor </para></description></constructor> 2187<constructor specifiers="explicit"><template> 2188 <template-type-parameter name="U"/> 2189 </template><parameter name="arg"><paramtype>U const &</paramtype><description><para>Fallback policy argument </para></description></parameter><description><para>Initializing constructor</para><para> 2190</para></description></constructor> 2191</class> 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227</namespace> 2228</namespace> 2229</header> 2230</library-reference>