attributes_reference.xml 158 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230
  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. <para>15.04.2007</para>
  5. The header contains attribute interface definition. </para><namespace name="boost">
  6. <namespace name="log">
  7. <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&lt; impl &gt;</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">
  8. <method name="get_value" cv="= 0" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para>
  9. </para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para>
  10. </returns></method>
  11. </method-group>
  12. <destructor><purpose>Virtual destructor. </purpose></destructor>
  13. <method-group name="public static functions">
  14. <method name="operator new" specifiers="static"><type>void *</type><parameter name="size"><paramtype>std::size_t</paramtype></parameter></method>
  15. <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>
  16. </method-group>
  17. </struct><method-group name="public member functions">
  18. <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>
  19. <method name="operator!" cv="const noexcept"><type>bool</type><description><para>Verifies that the factory is in empty state </para></description></method>
  20. <method name="get_value" cv="const"><type><classname>attribute_value</classname></type><description><para>
  21. </para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para>
  22. </returns></method>
  23. <method name="swap" cv="noexcept"><type>void</type><parameter name="that"><paramtype><classname>attribute</classname> &amp;</paramtype></parameter><description><para>The method swaps two factories (i.e. their implementations). </para></description></method>
  24. </method-group>
  25. <constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute</classname> const &amp;</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>
  26. <constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute</classname> &amp;&amp;</paramtype></parameter><description><para>Move constructor </para></description></constructor>
  27. <constructor specifiers="explicit" cv="noexcept"><parameter name="p"><paramtype>intrusive_ptr&lt; <classname>impl</classname> &gt;</paramtype><description><para>Pointer to the implementation. Must not be <computeroutput>NULL</computeroutput>. </para></description></parameter><description><para>Initializing constructor</para><para>
  28. </para></description></constructor>
  29. <copy-assignment cv="noexcept"><type><classname>attribute</classname> &amp;</type><parameter name="that"><paramtype><classname>attribute</classname> const &amp;</paramtype></parameter><description><para>Copy assignment </para></description></copy-assignment>
  30. <copy-assignment cv="noexcept"><type><classname>attribute</classname> &amp;</type><parameter name="that"><paramtype><classname>attribute</classname> &amp;&amp;</paramtype></parameter><description><para>Move assignment </para></description></copy-assignment>
  31. <method-group name="protected member functions">
  32. <method name="get_impl" cv="const noexcept"><type><classname>impl</classname> *</type><description><para>
  33. </para></description><returns><para>The pointer to the implementation </para>
  34. </returns></method>
  35. <method name="set_impl" cv="noexcept"><type>void</type><parameter name="p"><paramtype>intrusive_ptr&lt; <classname>impl</classname> &gt;</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>
  36. </para></description></method>
  37. </method-group>
  38. <method-group name="friend functions">
  39. <method name="attribute_cast"><type>friend T</type><template>
  40. <template-type-parameter name="T"/>
  41. </template><parameter name=""><paramtype><classname>attribute</classname> const &amp;</paramtype></parameter><description><para>The function casts one attribute factory to another </para></description></method>
  42. </method-group>
  43. </class>
  44. <function name="swap"><type>void</type><parameter name="left"><paramtype><classname>attribute</classname> &amp;</paramtype></parameter><parameter name="right"><paramtype><classname>attribute</classname> &amp;</paramtype></parameter><description><para>The function swaps two attribute value factories </para></description></function>
  45. </namespace>
  46. </namespace>
  47. </header>
  48. <header name="boost/log/attributes/attribute_cast.hpp">
  49. <para><para>Andrey Semashev </para>
  50. <para>06.08.2010</para>
  51. The header contains utilities for casting between attribute factories. </para><namespace name="boost">
  52. <namespace name="log">
  53. <namespace name="attributes">
  54. <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">
  55. <method name="as" cv="const"><type>T *</type><template>
  56. <template-type-parameter name="T"/>
  57. </template><description><para>The function attempts to cast the aggregated pointer to the implementation to the specified type.</para><para>
  58. </para></description><returns><para>The converted pointer or <computeroutput>NULL</computeroutput>, if the conversion fails. </para>
  59. </returns></method>
  60. </method-group>
  61. <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>
  62. </class>
  63. </namespace>
  64. <function name="attribute_cast"><type>T</type><template>
  65. <template-type-parameter name="T"/>
  66. </template><parameter name="attr"><paramtype><classname>attribute</classname> const &amp;</paramtype></parameter><description><para>The function casts one attribute factory to another </para></description></function>
  67. </namespace>
  68. </namespace>
  69. </header>
  70. <header name="boost/log/attributes/attribute_name.hpp">
  71. <para><para>Andrey Semashev </para>
  72. <para>28.06.2010</para>
  73. The header contains attribute name interface definition. </para><namespace name="boost">
  74. <namespace name="log">
  75. <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>
  76. <typedef name="id_type"><purpose>Associated identifier. </purpose><type>unspecified</type></typedef>
  77. <method-group name="public member functions">
  78. <method name="operator==" cv="const noexcept"><type>bool</type><parameter name="that"><paramtype><classname>attribute_name</classname> const &amp;</paramtype></parameter><description><para>Compares the attribute names</para><para>
  79. </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>
  80. </returns></method>
  81. <method name="operator!=" cv="const noexcept"><type>bool</type><parameter name="that"><paramtype><classname>attribute_name</classname> const &amp;</paramtype></parameter><description><para>Compares the attribute names</para><para>
  82. </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>
  83. </returns></method>
  84. <method name="operator==" cv="const"><type>bool</type><parameter name="that"><paramtype>const char *</paramtype></parameter><description><para>Compares the attribute names</para><para>
  85. </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>
  86. </returns></method>
  87. <method name="operator!=" cv="const"><type>bool</type><parameter name="that"><paramtype>const char *</paramtype></parameter><description><para>Compares the attribute names</para><para>
  88. </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>
  89. </returns></method>
  90. <method name="operator==" cv="const"><type>bool</type><parameter name="that"><paramtype>string_type const &amp;</paramtype></parameter><description><para>Compares the attribute names</para><para>
  91. </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>
  92. </returns></method>
  93. <method name="operator!=" cv="const"><type>bool</type><parameter name="that"><paramtype>string_type const &amp;</paramtype></parameter><description><para>Compares the attribute names</para><para>
  94. </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>
  95. </returns></method>
  96. <method name="conversion-operator" cv="const noexcept" specifiers="explicit"><type>bool</type><description><para>Checks if the object was default-constructed</para><para>
  97. </para></description><returns><para><computeroutput>true</computeroutput> if <computeroutput>*this</computeroutput> was constructed with an attribute name, <computeroutput>false</computeroutput> otherwise </para>
  98. </returns></method>
  99. <method name="operator!" cv="const noexcept"><type>bool</type><description><para>Checks if the object was default-constructed</para><para>
  100. </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>
  101. </returns></method>
  102. <method name="id" cv="const noexcept"><type>id_type</type><description><para>
  103. </para></description><requires><para><computeroutput>(!*this) == false</computeroutput> </para>
  104. </requires><returns><para>The associated id value </para>
  105. </returns></method>
  106. <method name="string" cv="const"><type>string_type const &amp;</type><description><para>
  107. </para></description><requires><para><computeroutput>(!*this) == false</computeroutput> </para>
  108. </requires><returns><para>The attribute name string that was used during the object construction </para>
  109. </returns></method>
  110. </method-group>
  111. <constructor cv="noexcept"><description><para>Default constructor. Creates an object that does not refer to any attribute name. </para></description></constructor>
  112. <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>
  113. </para></description><requires><para><emphasis>name</emphasis> is not NULL and points to a zero-terminated string </para>
  114. </requires></constructor>
  115. <constructor><parameter name="name"><paramtype>string_type const &amp;</paramtype><description><para>An attribute name </para></description></parameter><description><para>Constructs an attribute name from the specified string</para><para>
  116. </para></description></constructor>
  117. </class>
  118. <function name="operator&lt;&lt;"><type>std::basic_ostream&lt; CharT, TraitsT &gt; &amp;</type><template>
  119. <template-type-parameter name="CharT"/>
  120. <template-type-parameter name="TraitsT"/>
  121. </template><parameter name="strm"><paramtype>std::basic_ostream&lt; CharT, TraitsT &gt; &amp;</paramtype></parameter><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype></parameter></function>
  122. </namespace>
  123. </namespace>
  124. </header>
  125. <header name="boost/log/attributes/attribute_set.hpp">
  126. <para><para>Andrey Semashev </para>
  127. <para>08.03.2007</para>
  128. This header contains definition of the attribute set container. </para><namespace name="boost">
  129. <namespace name="log">
  130. <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>
  131. <typedef name="mapped_type"><purpose>Mapped attribute type. </purpose><type><classname>attribute</classname></type></typedef>
  132. <typedef name="value_type"><purpose>Value type. </purpose><type>std::pair&lt; const key_type, mapped_type &gt;</type></typedef>
  133. <typedef name="reference"><purpose>Reference type. </purpose><type>value_type &amp;</type></typedef>
  134. <typedef name="const_reference"><purpose>Const reference type. </purpose><type>value_type const &amp;</type></typedef>
  135. <typedef name="pointer"><purpose>Pointer type. </purpose><type>value_type *</type></typedef>
  136. <typedef name="const_pointer"><purpose>Const pointer type. </purpose><type>value_type const *</type></typedef>
  137. <typedef name="size_type"><purpose>Size type. </purpose><type>std::size_t</type></typedef>
  138. <typedef name="difference_type"><purpose>Difference type. </purpose><type>std::ptrdiff_t</type></typedef>
  139. <typedef name="iterator"><description><para>Iterator type. The iterator complies to the bidirectional iterator requirements. </para></description><type>implementation_defined</type></typedef>
  140. <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>
  141. <method-group name="public member functions">
  142. <method name="swap" cv="noexcept"><type>void</type><parameter name="that"><paramtype><classname>attribute_set</classname> &amp;</paramtype></parameter><description><para>Swaps two instances of the container.</para><para><emphasis role="bold">Throws:</emphasis> Nothing. </para></description></method>
  143. <method name="begin" cv="noexcept"><type>iterator</type><description><para>
  144. </para></description><returns><para>Iterator to the first element of the container. </para>
  145. </returns></method>
  146. <method name="end" cv="noexcept"><type>iterator</type><description><para>
  147. </para></description><returns><para>Iterator to the after-the-last element of the container. </para>
  148. </returns></method>
  149. <method name="begin" cv="const noexcept"><type>const_iterator</type><description><para>
  150. </para></description><returns><para>Constant iterator to the first element of the container. </para>
  151. </returns></method>
  152. <method name="end" cv="const noexcept"><type>const_iterator</type><description><para>
  153. </para></description><returns><para>Constant iterator to the after-the-last element of the container. </para>
  154. </returns></method>
  155. <method name="size" cv="const noexcept"><type>size_type</type><description><para>
  156. </para></description><returns><para>Number of elements in the container. </para>
  157. </returns></method>
  158. <method name="empty" cv="const noexcept"><type>bool</type><description><para>
  159. </para></description><returns><para>true if there are no elements in the container, false otherwise. </para>
  160. </returns></method>
  161. <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>
  162. </para></description><returns><para>Iterator to the found element or end() if the attribute with such name is not found. </para>
  163. </returns></method>
  164. <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>
  165. </para></description><returns><para>Iterator to the found element or <computeroutput>end()</computeroutput> if the attribute with such name is not found. </para>
  166. </returns></method>
  167. <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>
  168. </para></description><returns><para>The number of times the attribute is found in the container. </para>
  169. </returns></method>
  170. <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>
  171. <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>
  172. </listitem>
  173. <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>
  174. </listitem>
  175. </itemizedlist>
  176. </para></description><returns><para>A smart reference object of unspecified type. </para>
  177. </returns></method>
  178. <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>
  179. </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>
  180. </returns></method>
  181. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="key"><paramtype>key_type</paramtype><description><para>Attribute name. </para></description></parameter><parameter name="data"><paramtype>mapped_type const &amp;</paramtype><description><para>Pointer to the attribute. Must not be NULL. </para></description></parameter><description><para>Insertion method</para><para>
  182. </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>
  183. </returns></method>
  184. <method name="insert"><type>std::pair&lt; iterator, bool &gt;</type><parameter name="value"><paramtype>const_reference</paramtype><description><para>An element to be inserted. </para></description></parameter><description><para>Insertion method</para><para>
  185. </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>
  186. </returns></method>
  187. <method name="insert"><type>void</type><template>
  188. <template-type-parameter name="FwdIteratorT"/>
  189. </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>
  190. </para></description></method>
  191. <method name="insert"><type>void</type><template>
  192. <template-type-parameter name="FwdIteratorT"/>
  193. <template-type-parameter name="OutputIteratorT"/>
  194. </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>
  195. </para></description></method>
  196. <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>
  197. </para></description><postconditions><para>All iterators to the erased elements become invalid. </para>
  198. </postconditions><returns><para>Tne number of erased elements </para>
  199. </returns></method>
  200. <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>
  201. </para></description><postconditions><para>All iterators to the erased element become invalid. </para>
  202. </postconditions><returns><para>Tne number of erased elements </para>
  203. </returns></method>
  204. <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>
  205. </para></description><requires><para><emphasis>end</emphasis> is reachable from <emphasis>begin</emphasis> with a finite number of increments. </para>
  206. </requires><postconditions><para>All iterators to the erased elements become invalid. </para>
  207. </postconditions></method>
  208. <method name="clear" cv="noexcept"><type>void</type><description><para>The method removes all elements from the container</para><para>
  209. </para></description><postconditions><para><computeroutput>empty() == true</computeroutput> </para>
  210. </postconditions></method>
  211. </method-group>
  212. <constructor><description><para>Default constructor.</para><para>
  213. </para></description><postconditions><para><computeroutput>empty() == true</computeroutput> </para>
  214. </postconditions></constructor>
  215. <constructor><parameter name="that"><paramtype><classname>attribute_set</classname> const &amp;</paramtype></parameter><description><para>Copy constructor.</para><para>
  216. </para></description><postconditions><para><computeroutput>size() == that.size() &amp;&amp; std::equal(begin(), end(), that.begin()) == true</computeroutput> </para>
  217. </postconditions></constructor>
  218. <constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute_set</classname> &amp;&amp;</paramtype></parameter><description><para>Move constructor </para></description></constructor>
  219. <destructor><description><para>Destructor. All stored references to attributes are released. </para></description></destructor>
  220. <copy-assignment cv="noexcept"><type><classname>attribute_set</classname> &amp;</type><parameter name="that"><paramtype><classname>attribute_set</classname></paramtype></parameter><description><para>Copy assignment operator.</para><para>
  221. </para></description><postconditions><para><computeroutput>size() == that.size() &amp;&amp; std::equal(begin(), end(), that.begin()) == true</computeroutput> </para>
  222. </postconditions></copy-assignment>
  223. </class>
  224. <function name="swap"><type>void</type><parameter name="left"><paramtype><classname>attribute_set</classname> &amp;</paramtype></parameter><parameter name="right"><paramtype><classname>attribute_set</classname> &amp;</paramtype></parameter><description><para>Free swap overload </para></description></function>
  225. </namespace>
  226. </namespace>
  227. </header>
  228. <header name="boost/log/attributes/attribute_value.hpp">
  229. <para><para>Andrey Semashev </para>
  230. <para>21.05.2010</para>
  231. The header contains <computeroutput>attribute_value</computeroutput> class definition. </para><namespace name="boost">
  232. <namespace name="log">
  233. <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">
  234. <method name="dispatch" cv="= 0" specifiers="virtual"><type>bool</type><parameter name="dispatcher"><paramtype>type_dispatcher &amp;</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>
  235. </para></description><returns><para>true if <emphasis>dispatcher</emphasis> was capable to consume the real attribute value type and false otherwise. </para>
  236. </returns></method>
  237. <method name="detach_from_thread" specifiers="virtual"><type>intrusive_ptr&lt; <classname>impl</classname> &gt;</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>
  238. </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>
  239. </returns></method>
  240. <method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para>
  241. </para></description><returns><para>The attribute value that refers to self implementation. </para>
  242. </returns></method>
  243. <method name="get_type" cv="const" specifiers="virtual"><type>typeindex::type_index</type><description><para>
  244. </para></description><returns><para>The attribute value type </para>
  245. </returns></method>
  246. </method-group>
  247. </struct><method-group name="public member functions">
  248. <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>
  249. <method name="operator!" cv="const noexcept"><type>bool</type><description><para>The operator checks if the attribute value is empty </para></description></method>
  250. <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>
  251. <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>
  252. </para></description><postconditions><para>The attribute value no longer refers to any thread-specific resources. </para>
  253. </postconditions></method>
  254. <method name="dispatch" cv="const"><type>bool</type><parameter name="dispatcher"><paramtype>type_dispatcher &amp;</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>
  255. </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>
  256. </returns></method>
  257. <method name="extract" cv="const"><type><classname>result_of::extract</classname>&lt; T, TagT &gt;::type</type><template>
  258. <template-type-parameter name="T"/>
  259. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  260. </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>
  261. </note>
  262. </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>
  263. </returns></method>
  264. <method name="extract_or_throw" cv="const"><type><classname>result_of::extract_or_throw</classname>&lt; T, TagT &gt;::type</type><template>
  265. <template-type-parameter name="T"/>
  266. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  267. </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>
  268. </note>
  269. </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>
  270. </returns></method>
  271. <method name="extract_or_default" cv="const"><type><classname>result_of::extract_or_default</classname>&lt; T, T, TagT &gt;::type</type><template>
  272. <template-type-parameter name="T"/>
  273. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  274. </template><parameter name="def_value"><paramtype>T const &amp;</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>
  275. </note>
  276. </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>
  277. </returns></method>
  278. <method name="extract_or_default" cv="const"><type><classname>result_of::extract_or_default</classname>&lt; T, DefaultT, TagT &gt;::type</type><template>
  279. <template-type-parameter name="T"/>
  280. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  281. <template-type-parameter name="DefaultT"/>
  282. </template><parameter name="def_value"><paramtype>DefaultT const &amp;</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>
  283. </note>
  284. </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>
  285. </returns></method>
  286. <method name="visit" cv="const"><type><classname>visitation_result</classname></type><template>
  287. <template-type-parameter name="T"/>
  288. <template-type-parameter name="VisitorT"/>
  289. </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>
  290. </note>
  291. </para></description><returns><para>The result of visitation. </para>
  292. </returns></method>
  293. <method name="swap" cv="noexcept"><type>void</type><parameter name="that"><paramtype><classname>attribute_value</classname> &amp;</paramtype></parameter><description><para>The method swaps two attribute values </para></description></method>
  294. </method-group>
  295. <constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute_value</classname> const &amp;</paramtype></parameter><description><para>Default constructor. Creates an empty (absent) attribute value.</para><para>Copy constructor </para></description></constructor>
  296. <constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute_value</classname> &amp;&amp;</paramtype></parameter><description><para>Move constructor </para></description></constructor>
  297. <constructor specifiers="explicit" cv="noexcept"><parameter name="p"><paramtype>intrusive_ptr&lt; <classname>impl</classname> &gt;</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>
  298. </para></description></constructor>
  299. <copy-assignment cv="noexcept"><type><classname>attribute_value</classname> &amp;</type><parameter name="that"><paramtype><classname>attribute_value</classname> const &amp;</paramtype></parameter><description><para>Copy assignment </para></description></copy-assignment>
  300. <copy-assignment cv="noexcept"><type><classname>attribute_value</classname> &amp;</type><parameter name="that"><paramtype><classname>attribute_value</classname> &amp;&amp;</paramtype></parameter><description><para>Move assignment </para></description></copy-assignment>
  301. </class>
  302. <function name="swap"><type>void</type><parameter name="left"><paramtype><classname>attribute_value</classname> &amp;</paramtype></parameter><parameter name="right"><paramtype><classname>attribute_value</classname> &amp;</paramtype></parameter><description><para>The function swaps two attribute values </para></description></function>
  303. </namespace>
  304. </namespace>
  305. </header>
  306. <header name="boost/log/attributes/attribute_value_impl.hpp">
  307. <para><para>Andrey Semashev </para>
  308. <para>24.06.2007</para>
  309. The header contains an implementation of a basic attribute value implementation class. </para><namespace name="boost">
  310. <namespace name="log">
  311. <namespace name="attributes">
  312. <class name="attribute_value_impl"><template>
  313. <template-type-parameter name="T"/>
  314. </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>
  315. <method-group name="public member functions">
  316. <method name="dispatch" specifiers="virtual"><type>bool</type><parameter name="dispatcher"><paramtype>type_dispatcher &amp;</paramtype><description><para>The dispatcher that receives the stored value</para></description></parameter><description><para>Attribute value dispatching method.</para><para>
  317. </para></description><returns><para><computeroutput>true</computeroutput> if the value has been dispatched, <computeroutput>false</computeroutput> otherwise </para>
  318. </returns></method>
  319. <method name="get_type" cv="const" specifiers="virtual"><type>typeindex::type_index</type><description><para>
  320. </para></description><returns><para>The attribute value type </para>
  321. </returns></method>
  322. <method name="get" cv="const"><type>value_type const &amp;</type><description><para>
  323. </para></description><returns><para>Reference to the contained value. </para>
  324. </returns></method>
  325. </method-group>
  326. <constructor specifiers="explicit"><parameter name="v"><paramtype>value_type const &amp;</paramtype></parameter><description><para>Constructor with initialization of the stored value </para></description></constructor>
  327. <constructor specifiers="explicit"><parameter name="v"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>Constructor with initialization of the stored value </para></description></constructor>
  328. </class>
  329. <function name="make_attribute_value"><type><classname>attribute_value</classname></type><template>
  330. <template-type-parameter name="T"/>
  331. </template><parameter name="v"><paramtype>T &amp;&amp;</paramtype></parameter><description><para>The function creates an attribute value from the specified object. </para></description></function>
  332. </namespace>
  333. </namespace>
  334. </namespace>
  335. </header>
  336. <header name="boost/log/attributes/attribute_value_set.hpp">
  337. <para><para>Andrey Semashev </para>
  338. <para>21.04.2007</para>
  339. This 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">
  340. <namespace name="log">
  341. <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>
  342. </note>
  343. </para></description><typedef name="key_type"><purpose>Key type. </purpose><type><classname>attribute_name</classname></type></typedef>
  344. <typedef name="mapped_type"><purpose>Mapped attribute type. </purpose><type><classname>attribute_value</classname></type></typedef>
  345. <typedef name="value_type"><purpose>Value type. </purpose><type>std::pair&lt; const key_type, mapped_type &gt;</type></typedef>
  346. <typedef name="reference"><purpose>Reference type. </purpose><type>value_type &amp;</type></typedef>
  347. <typedef name="const_reference"><purpose>Const reference type. </purpose><type>value_type const &amp;</type></typedef>
  348. <typedef name="pointer"><purpose>Pointer type. </purpose><type>value_type *</type></typedef>
  349. <typedef name="const_pointer"><purpose>Const pointer type. </purpose><type>value_type const *</type></typedef>
  350. <typedef name="size_type"><purpose>Size type. </purpose><type>std::size_t</type></typedef>
  351. <typedef name="difference_type"><purpose>Pointer difference type. </purpose><type>std::ptrdiff_t</type></typedef>
  352. <typedef name="const_iterator"><description><para>Constant iterator type with bidirectional capabilities. </para></description><type>implementation_defined</type></typedef>
  353. <method-group name="public member functions">
  354. <method name="swap" cv="noexcept"><type>void</type><parameter name="that"><paramtype><classname>attribute_value_set</classname> &amp;</paramtype></parameter><description><para>Swaps two sets</para><para><emphasis role="bold">Throws:</emphasis> Nothing. </para></description></method>
  355. <method name="begin" cv="const"><type>const_iterator</type><description><para>
  356. </para></description><returns><para>Iterator to the first element of the set. </para>
  357. </returns></method>
  358. <method name="end" cv="const"><type>const_iterator</type><description><para>
  359. </para></description><returns><para>Iterator to the after-the-last element of the set. </para>
  360. </returns></method>
  361. <method name="size" cv="const"><type>size_type</type><description><para>
  362. </para></description><returns><para>Number of elements in the set. </para>
  363. </returns></method>
  364. <method name="empty" cv="const"><type>bool</type><description><para>
  365. </para></description><returns><para><computeroutput>true</computeroutput> if there are no elements in the container, <computeroutput>false</computeroutput> otherwise. </para>
  366. </returns></method>
  367. <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>
  368. </para></description><returns><para>Iterator to the found element or <computeroutput>end()</computeroutput> if the attribute with such name is not found. </para>
  369. </returns></method>
  370. <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>
  371. </para></description><returns><para>A pointer to the attribute value if it is found with <emphasis>key</emphasis>, default-constructed mapped value otherwise. </para>
  372. </returns></method>
  373. <method name="operator[]" cv="const"><type><classname>result_of::extract</classname>&lt; typename expressions::attribute_keyword&lt; DescriptorT, ActorT &gt;::value_type, DescriptorT &gt;::type</type><template>
  374. <template-type-parameter name="DescriptorT"/>
  375. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  376. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>Attribute keyword. </para></description></parameter><description><para>Alternative lookup syntax.</para><para>
  377. </para></description><returns><para>A <computeroutput>value_ref</computeroutput> with extracted attribute value if it is found, empty <computeroutput>value_ref</computeroutput> otherwise. </para>
  378. </returns></method>
  379. <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>
  380. </para></description><returns><para>The number of times the attribute value is found in the container. </para>
  381. </returns></method>
  382. <method name="freeze"><type>void</type><description><para>The method acquires values of all adopted attributes.</para><para>
  383. </para></description><postconditions><para>The set is frozen. </para>
  384. </postconditions></method>
  385. <method name="insert"><type>std::pair&lt; const_iterator, bool &gt;</type><parameter name="key"><paramtype>key_type</paramtype><description><para>The attribute name. </para></description></parameter><parameter name="mapped"><paramtype>mapped_type const &amp;</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>
  386. </para></description><requires><para>The set is frozen.</para>
  387. </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>
  388. </returns></method>
  389. <method name="insert"><type>std::pair&lt; const_iterator, bool &gt;</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>
  390. </para></description><requires><para>The set is frozen.</para>
  391. </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>
  392. </returns></method>
  393. <method name="insert"><type>void</type><template>
  394. <template-type-parameter name="FwdIteratorT"/>
  395. </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>
  396. </para></description><requires><para>The set is frozen.</para>
  397. </requires></method>
  398. <method name="insert"><type>void</type><template>
  399. <template-type-parameter name="FwdIteratorT"/>
  400. <template-type-parameter name="OutputIteratorT"/>
  401. </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>
  402. </para></description><requires><para>The set is frozen.</para>
  403. </requires></method>
  404. </method-group>
  405. <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>
  406. </para></description></constructor>
  407. <constructor cv="noexcept"><parameter name="that"><paramtype><classname>attribute_value_set</classname> &amp;&amp;</paramtype></parameter><description><para>Move constructor </para></description></constructor>
  408. <constructor><parameter name="source_attrs"><paramtype><classname>attribute_set</classname> const &amp;</paramtype><description><para>A set of source-specific attributes. </para></description></parameter><parameter name="thread_attrs"><paramtype><classname>attribute_set</classname> const &amp;</paramtype><description><para>A set of thread-specific attributes. </para></description></parameter><parameter name="global_attrs"><paramtype><classname>attribute_set</classname> const &amp;</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>
  409. </para></description></constructor>
  410. <constructor><parameter name="source_attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</paramtype><description><para>A set of source-specific attributes. </para></description></parameter><parameter name="thread_attrs"><paramtype><classname>attribute_set</classname> const &amp;</paramtype><description><para>A set of thread-specific attributes. </para></description></parameter><parameter name="global_attrs"><paramtype><classname>attribute_set</classname> const &amp;</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>
  411. </para></description><requires><para>The <emphasis>source_attrs</emphasis> set is frozen.</para>
  412. </requires></constructor>
  413. <constructor><parameter name="source_attrs"><paramtype><classname>attribute_value_set</classname> &amp;&amp;</paramtype><description><para>A set of source-specific attributes. </para></description></parameter><parameter name="thread_attrs"><paramtype><classname>attribute_set</classname> const &amp;</paramtype><description><para>A set of thread-specific attributes. </para></description></parameter><parameter name="global_attrs"><paramtype><classname>attribute_set</classname> const &amp;</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>
  414. </para></description><requires><para>The <emphasis>source_attrs</emphasis> set is frozen.</para>
  415. </requires></constructor>
  416. <constructor><parameter name="that"><paramtype><classname>attribute_value_set</classname> const &amp;</paramtype></parameter><description><para>Copy constructor.</para><para>
  417. </para></description><requires><para>The original set is frozen. </para>
  418. </requires><postconditions><para>The constructed set is frozen, <computeroutput>std::equal(begin(), end(), that.begin()) == true</computeroutput> </para>
  419. </postconditions></constructor>
  420. <destructor><description><para>Destructor. Releases all referenced attribute values. </para></description></destructor>
  421. <copy-assignment cv="noexcept"><type><classname>attribute_value_set</classname> &amp;</type><parameter name="that"><paramtype><classname>attribute_value_set</classname></paramtype></parameter><description><para>Assignment operator </para></description></copy-assignment>
  422. </class>
  423. <function name="swap"><type>void</type><parameter name="left"><paramtype><classname>attribute_value_set</classname> &amp;</paramtype></parameter><parameter name="right"><paramtype><classname>attribute_value_set</classname> &amp;</paramtype></parameter><description><para>Free swap overload </para></description></function>
  424. </namespace>
  425. </namespace>
  426. </header>
  427. <header name="boost/log/attributes/clock.hpp">
  428. <para><para>Andrey Semashev </para>
  429. <para>01.12.2007</para>
  430. The header contains wall clock attribute implementation and typedefs. </para><namespace name="boost">
  431. <namespace name="log">
  432. <namespace name="attributes">
  433. <class name="basic_clock"><template>
  434. <template-type-parameter name="TimeTraitsT"/>
  435. </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">
  436. <method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para>
  437. </para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para>
  438. </returns></method>
  439. </method-group>
  440. </struct><typedef name="value_type"><purpose>Generated value type. </purpose><type>TimeTraitsT::time_type</type></typedef>
  441. <method-group name="public member functions">
  442. </method-group>
  443. <constructor><description><para>Default constructor </para></description></constructor>
  444. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  445. </class><typedef name="utc_clock"><purpose>Attribute that returns current UTC time. </purpose><type><classname>basic_clock</classname>&lt; <classname>utc_time_traits</classname> &gt;</type></typedef>
  446. <typedef name="local_clock"><purpose>Attribute that returns current local time. </purpose><type><classname>basic_clock</classname>&lt; <classname>local_time_traits</classname> &gt;</type></typedef>
  447. </namespace>
  448. </namespace>
  449. </namespace>
  450. </header>
  451. <header name="boost/log/attributes/constant.hpp">
  452. <para><para>Andrey Semashev </para>
  453. <para>15.04.2007</para>
  454. The header contains implementation of a constant attribute. </para><namespace name="boost">
  455. <namespace name="log">
  456. <namespace name="attributes">
  457. <class name="constant"><template>
  458. <template-type-parameter name="T"/>
  459. </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&lt; value_type &gt;</inherit><purpose>Factory implementation. </purpose><method-group name="public member functions">
  460. </method-group>
  461. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor>
  462. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor>
  463. </class><typedef name="value_type"><purpose>Attribute value type. </purpose><type>T</type></typedef>
  464. <method-group name="public member functions">
  465. <method name="get" cv="const"><type>value_type const &amp;</type><description><para>
  466. </para></description><returns><para>Reference to the contained value. </para>
  467. </returns></method>
  468. </method-group>
  469. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor>
  470. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor>
  471. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  472. </class>
  473. <function name="make_constant"><type><emphasis>unspecified</emphasis></type><template>
  474. <template-type-parameter name="T"/>
  475. </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>
  476. </namespace>
  477. </namespace>
  478. </namespace>
  479. </header>
  480. <header name="boost/log/attributes/counter.hpp">
  481. <para><para>Andrey Semashev </para>
  482. <para>01.05.2007</para>
  483. The header contains implementation of the counter attribute. </para><namespace name="boost">
  484. <namespace name="log">
  485. <namespace name="attributes">
  486. <class name="counter"><template>
  487. <template-type-parameter name="T"/>
  488. </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">
  489. <method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para>
  490. </para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para>
  491. </returns></method>
  492. </method-group>
  493. <constructor cv="noexcept"><parameter name="initial"><paramtype>value_type</paramtype></parameter><parameter name="step"><paramtype>value_type</paramtype></parameter></constructor>
  494. </class><typedef name="value_type"><purpose>A counter value type. </purpose><type>T</type></typedef>
  495. <method-group name="private member functions">
  496. <method name="BOOST_STATIC_ASSERT_MSG"><type/><parameter name=""><paramtype>is_integral&lt; T &gt;::value</paramtype></parameter><parameter name=""><paramtype>"Boost.Log: Only integral types are supported by the <classname>counter</classname> <classname>attribute</classname>"</paramtype></parameter></method>
  497. </method-group>
  498. <method-group name="public member functions">
  499. </method-group>
  500. <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>
  501. </para></description></constructor>
  502. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  503. </class>
  504. </namespace>
  505. </namespace>
  506. </namespace>
  507. </header>
  508. <header name="boost/log/attributes/current_process_id.hpp">
  509. <para><para>Andrey Semashev </para>
  510. <para>12.09.2009</para>
  511. The header contains implementation of a current process id attribute </para><namespace name="boost">
  512. <namespace name="log">
  513. <namespace name="attributes">
  514. <class name="current_process_id"><inherit access="public">constant&lt; process_id &gt;</inherit><purpose>A class of an attribute that holds the current process identifier. </purpose><method-group name="public member functions">
  515. </method-group>
  516. <constructor><description><para>Constructor. Initializes the attribute with the current process identifier. </para></description></constructor>
  517. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  518. </class>
  519. </namespace>
  520. <typedef name="process_id"><purpose>Process identifier type used by the library. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  521. </namespace>
  522. </namespace>
  523. </header>
  524. <header name="boost/log/attributes/current_process_name.hpp">
  525. <para><para>Andrey Semashev </para>
  526. <para>29.07.2012</para>
  527. The header contains implementation of a current process name attribute </para><namespace name="boost">
  528. <namespace name="log">
  529. <namespace name="attributes">
  530. <class name="current_process_name"><inherit access="public">constant&lt; std::string &gt;</inherit><purpose>A class of an attribute that holds the current process name. </purpose><method-group name="public member functions">
  531. </method-group>
  532. <constructor><description><para>Constructor. Initializes the attribute with the current process name. </para></description></constructor>
  533. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  534. </class>
  535. </namespace>
  536. </namespace>
  537. </namespace>
  538. </header>
  539. <header name="boost/log/attributes/current_thread_id.hpp">
  540. <para><para>Andrey Semashev </para>
  541. <para>12.09.2009</para>
  542. The header contains implementation of a current thread id attribute </para><namespace name="boost">
  543. <namespace name="log">
  544. <namespace name="attributes">
  545. <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>
  546. </note>
  547. </para></description><class name="impl"><inherit access="public">attribute_value::impl</inherit><purpose>Factory implementation. </purpose><method-group name="public member functions">
  548. <method name="dispatch" specifiers="virtual"><type>bool</type><parameter name="dispatcher"><paramtype>type_dispatcher &amp;</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>
  549. </para></description><returns><para>true if <emphasis>dispatcher</emphasis> was capable to consume the real attribute value type and false otherwise. </para>
  550. </returns></method>
  551. <method name="detach_from_thread" specifiers="virtual"><type>intrusive_ptr&lt; <classname>attribute_value::impl</classname> &gt;</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>
  552. </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>
  553. </returns></method>
  554. <method name="get_type" cv="const" specifiers="virtual"><type>typeindex::type_index</type><description><para>
  555. </para></description><returns><para>The attribute value type </para>
  556. </returns></method>
  557. </method-group>
  558. </class><typedef name="value_type"><purpose>A held attribute value type. </purpose><type>thread_id</type></typedef>
  559. <method-group name="public member functions">
  560. </method-group>
  561. <constructor><description><para>Default constructor </para></description></constructor>
  562. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  563. </class>
  564. </namespace>
  565. <typedef name="thread_id"><purpose>Thread identifier type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  566. </namespace>
  567. </namespace>
  568. </header>
  569. <header name="boost/log/attributes/fallback_policy.hpp">
  570. <para><para>Andrey Semashev </para>
  571. <para>18.08.2012</para>
  572. The header contains definition of fallback policies when attribute value visitation or extraction fails. </para><namespace name="boost">
  573. <namespace name="log">
  574. <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>
  575. <method-group name="public static functions">
  576. <method name="apply_default" specifiers="static"><type>bool</type><template>
  577. <template-type-parameter name="FunT"/>
  578. </template><parameter name=""><paramtype>FunT &amp;</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method>
  579. <method name="apply_default" specifiers="static"><type>bool</type><template>
  580. <template-type-parameter name="FunT"/>
  581. </template><parameter name=""><paramtype>FunT const &amp;</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method>
  582. <method name="on_invalid_type" specifiers="static"><type>void</type><parameter name=""><paramtype>typeindex::type_index const &amp;</paramtype></parameter><description><para>The method is called when value extraction failed because the attribute value has different type than requested. </para></description></method>
  583. <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>
  584. </method-group>
  585. </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>
  586. <method-group name="public static functions">
  587. <method name="apply_default" specifiers="static"><type>bool</type><template>
  588. <template-type-parameter name="FunT"/>
  589. </template><parameter name=""><paramtype>FunT &amp;</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method>
  590. <method name="apply_default" specifiers="static"><type>bool</type><template>
  591. <template-type-parameter name="FunT"/>
  592. </template><parameter name=""><paramtype>FunT const &amp;</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method>
  593. <method name="on_invalid_type" specifiers="static"><type>void</type><parameter name="t"><paramtype>typeindex::type_index const &amp;</paramtype></parameter><description><para>The method is called when value extraction failed because the attribute value has different type than requested. </para></description></method>
  594. <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>
  595. </method-group>
  596. </struct>
  597. </namespace>
  598. </namespace>
  599. </header>
  600. <header name="boost/log/attributes/fallback_policy_fwd.hpp">
  601. <para><para>Andrey Semashev </para>
  602. <para>18.08.2012</para>
  603. The header contains forward declaration of fallback policies when attribute value visitation or extraction fails. </para><namespace name="boost">
  604. <namespace name="log">
  605. <struct name="fallback_to_default"><template>
  606. <template-type-parameter name="DefaultT"/>
  607. </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">
  608. <method name="apply_default" cv="const"><type>bool</type><template>
  609. <template-type-parameter name="FunT"/>
  610. </template><parameter name="fun"><paramtype>FunT &amp;</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method>
  611. <method name="apply_default" cv="const"><type>bool</type><template>
  612. <template-type-parameter name="FunT"/>
  613. </template><parameter name="fun"><paramtype>FunT const &amp;</paramtype></parameter><description><para>The method is called in order to apply a function object to the default value. </para></description></method>
  614. </method-group>
  615. <constructor><description><para>Default constructor. </para></description></constructor>
  616. <constructor specifiers="explicit"><parameter name="def_val"><paramtype>default_type const &amp;</paramtype></parameter><description><para>Initializing constructor. </para></description></constructor>
  617. <method-group name="public static functions">
  618. <method name="on_invalid_type" specifiers="static"><type>void</type><parameter name=""><paramtype>typeindex::type_index const &amp;</paramtype></parameter><description><para>The method is called when value extraction failed because the attribute value has different type than requested. </para></description></method>
  619. <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>
  620. </method-group>
  621. </struct>
  622. </namespace>
  623. </namespace>
  624. </header>
  625. <header name="boost/log/attributes/function.hpp">
  626. <para><para>Andrey Semashev </para>
  627. <para>24.06.2007</para>
  628. The header contains implementation of an attribute that calls a third-party function on value acquisition. </para><namespace name="boost">
  629. <namespace name="log">
  630. <namespace name="attributes">
  631. <class name="function"><template>
  632. <template-type-parameter name="R"/>
  633. </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>
  634. <template-type-parameter name="T"/>
  635. </template><inherit access="public">function&lt; R &gt;::impl</inherit><purpose>Factory implementation. </purpose><method-group name="public member functions">
  636. <method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para>
  637. </para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para>
  638. </returns></method>
  639. </method-group>
  640. <constructor specifiers="explicit"><parameter name="fun"><paramtype>T const &amp;</paramtype></parameter><description><para>Constructor with the stored delegate initialization </para></description></constructor>
  641. </class><typedef name="value_type"><purpose>The attribute value type. </purpose><type>R</type></typedef>
  642. <method-group name="private member functions">
  643. <method name="BOOST_STATIC_ASSERT_MSG"><type/><parameter name=""><paramtype>!is_void&lt; R &gt;::value</paramtype></parameter><parameter name=""><paramtype>"Boost.Log: Function object return type must not be void"</paramtype></parameter></method>
  644. </method-group>
  645. <method-group name="public member functions">
  646. </method-group>
  647. <constructor specifiers="explicit"><template>
  648. <template-type-parameter name="T"/>
  649. </template><parameter name="fun"><paramtype>T const &amp;</paramtype></parameter><description><para>Initializing constructor </para></description></constructor>
  650. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  651. </class>
  652. <function name="make_function"><type><classname>function</classname>&lt; typename remove_cv&lt; typename remove_reference&lt; typename boost::result_of&lt; T() &gt;::type &gt;::type &gt;::type &gt;</type><template>
  653. <template-type-parameter name="T"/>
  654. </template><parameter name="fun"><paramtype>T const &amp;</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>
  655. </para></description><returns><para>Pointer to the attribute instance </para>
  656. </returns></function>
  657. </namespace>
  658. </namespace>
  659. </namespace>
  660. </header>
  661. <header name="boost/log/attributes/mutable_constant.hpp">
  662. <para><para>Andrey Semashev </para>
  663. <para>06.11.2007</para>
  664. The header contains implementation of a mutable constant attribute. </para><namespace name="boost">
  665. <namespace name="log">
  666. <namespace name="attributes">
  667. <class name="mutable_constant"><template>
  668. <template-type-parameter name="T"/>
  669. <template-type-parameter name="MutexT"><default>void</default></template-type-parameter>
  670. <template-type-parameter name="ScopedWriteLockT"><default>auto</default></template-type-parameter>
  671. <template-type-parameter name="ScopedReadLockT"><default>auto</default></template-type-parameter>
  672. </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">
  673. <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>
  674. </method-group>
  675. <method-group name="public member functions">
  676. <method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para>
  677. </para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para>
  678. </returns></method>
  679. <method name="set"><type>void</type><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter></method>
  680. <method name="set"><type>void</type><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter></method>
  681. <method name="get" cv="const"><type>value_type</type></method>
  682. </method-group>
  683. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter><description><para>Initializing constructor </para></description></constructor>
  684. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>Initializing constructor </para></description></constructor>
  685. </class><typedef name="value_type"><purpose>The attribute value type. </purpose><type>T</type></typedef>
  686. <method-group name="public member functions">
  687. <method name="set"><type>void</type><parameter name="value"><paramtype>value_type const &amp;</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>
  688. <method name="set"><type>void</type><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>The method sets a new attribute value. </para></description></method>
  689. <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>
  690. </method-group>
  691. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor>
  692. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor>
  693. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  694. <method-group name="protected member functions">
  695. <method name="get_impl" cv="const"><type><classname>impl</classname> *</type><description><para>
  696. </para></description><returns><para>Pointer to the factory implementation </para>
  697. </returns></method>
  698. </method-group>
  699. </class><class-specialization name="mutable_constant"><template>
  700. <template-type-parameter name="T"/>
  701. </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">
  702. <method name="get_value" specifiers="virtual"><type><classname>attribute_value</classname></type><description><para>
  703. </para></description><returns><para>The actual attribute value. It shall not return empty values (exceptions shall be used to indicate errors). </para>
  704. </returns></method>
  705. <method name="set"><type>void</type><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter></method>
  706. <method name="set"><type>void</type><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter></method>
  707. <method name="get" cv="const"><type>value_type</type></method>
  708. </method-group>
  709. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter><description><para>Initializing constructor </para></description></constructor>
  710. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>Initializing constructor </para></description></constructor>
  711. </class><typedef name="value_type"><purpose>The attribute value type. </purpose><type>T</type></typedef>
  712. <method-group name="public member functions">
  713. <method name="set"><type>void</type><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter><description><para>The method sets a new attribute value. </para></description></method>
  714. <method name="set"><type>void</type><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>The method sets a new attribute value. </para></description></method>
  715. <method name="get" cv="const"><type>value_type</type><description><para>The method acquires the current attribute value. </para></description></method>
  716. </method-group>
  717. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type const &amp;</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor>
  718. <constructor specifiers="explicit"><parameter name="value"><paramtype>value_type &amp;&amp;</paramtype></parameter><description><para>Constructor with the stored value initialization </para></description></constructor>
  719. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  720. <method-group name="protected member functions">
  721. <method name="get_impl" cv="const"><type><classname>impl</classname> *</type><description><para>
  722. </para></description><returns><para>Pointer to the factory implementation </para>
  723. </returns></method>
  724. </method-group>
  725. </class-specialization>
  726. </namespace>
  727. </namespace>
  728. </namespace>
  729. </header>
  730. <header name="boost/log/attributes/named_scope.hpp">
  731. <para><para>Andrey Semashev </para>
  732. <para>24.06.2007</para>
  733. The 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">
  734. <namespace name="log">
  735. <namespace name="attributes">
  736. <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&lt; CharT &gt;</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">
  737. </method-group>
  738. <constructor cv="noexcept"><parameter name="sn"><paramtype>string_literal const &amp;</paramtype><description><para>Scope name. </para></description></parameter><parameter name="fn"><paramtype>string_literal const &amp;</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>
  739. </para></description></constructor>
  740. <destructor><description><para>Destructor. Removes the last pushed scope from the thread-local list of scopes. </para></description></destructor>
  741. <constructor cv="= delete"><parameter name=""><paramtype><classname>sentry</classname> const &amp;</paramtype></parameter></constructor>
  742. <copy-assignment cv="= delete"><type><classname>sentry</classname> &amp;</type><parameter name=""><paramtype><classname>sentry</classname> const &amp;</paramtype></parameter></copy-assignment>
  743. </struct><typedef name="value_type"><purpose>Scope names stack (the attribute value type) </purpose><type><classname>named_scope_list</classname></type></typedef>
  744. <typedef name="scope_entry"><purpose>Scope entry. </purpose><type>value_type::value_type</type></typedef>
  745. <method-group name="public member functions">
  746. </method-group>
  747. <constructor><description><para>Constructor. Creates an attribute. </para></description></constructor>
  748. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  749. <method-group name="public static functions">
  750. <method name="push_scope" cv="noexcept" specifiers="static"><type>void</type><parameter name="entry"><paramtype>scope_entry const &amp;</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>
  751. <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>
  752. <method name="get_scopes" specifiers="static"><type>value_type const &amp;</type><description><para>
  753. <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>
  754. </note>
  755. </para></description><returns><para>The current thread's list of scopes</para>
  756. </returns></method>
  757. </method-group>
  758. </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>
  759. <data-member name="scope_name"><type>string_literal</type><description><para>The scope name (e.g. a function signature) </para></description></data-member>
  760. <data-member name="file_name"><type>string_literal</type><description><para>The source file name </para></description></data-member>
  761. <data-member name="line"><type>unsigned int</type><description><para>The line number in the source file </para></description></data-member>
  762. <data-member name="type"><type>scope_name_type</type><description><para>The scope name type </para></description></data-member>
  763. <method-group name="public member functions">
  764. </method-group>
  765. <constructor cv="noexcept"><parameter name="sn"><paramtype>string_literal const &amp;</paramtype></parameter><parameter name="fn"><paramtype>string_literal const &amp;</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>
  766. <emphasis role="bold">Throws:</emphasis> Nothing. </para></description><postconditions><para><computeroutput>scope_name == sn &amp;&amp; file_name == fn &amp;&amp; line == ln</computeroutput></para>
  767. </postconditions></constructor>
  768. </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&lt; <classname>named_scope_entry</classname> &gt;</type></typedef>
  769. <typedef name="value_type"><type>allocator_type::value_type</type></typedef>
  770. <typedef name="reference"><type>allocator_type::reference</type></typedef>
  771. <typedef name="const_reference"><type>allocator_type::const_reference</type></typedef>
  772. <typedef name="pointer"><type>allocator_type::pointer</type></typedef>
  773. <typedef name="const_pointer"><type>allocator_type::const_pointer</type></typedef>
  774. <typedef name="size_type"><type>allocator_type::size_type</type></typedef>
  775. <typedef name="difference_type"><type>allocator_type::difference_type</type></typedef>
  776. <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>
  777. <typedef name="iterator"><description><para>An iterator to the sequence of scopes. Complies to bidirectional iterator requirements. </para></description><type>implementation_defined</type></typedef>
  778. <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>
  779. <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>
  780. <method-group name="public member functions">
  781. <method name="begin" cv="const"><type>const_iterator</type><description><para>
  782. </para></description><returns><para>Constant iterator to the first element of the container. </para>
  783. </returns></method>
  784. <method name="end" cv="const"><type>const_iterator</type><description><para>
  785. </para></description><returns><para>Constant iterator to the after-the-last element of the container. </para>
  786. </returns></method>
  787. <method name="rbegin" cv="const"><type>const_reverse_iterator</type><description><para>
  788. </para></description><returns><para>Constant iterator to the last element of the container. </para>
  789. </returns></method>
  790. <method name="rend" cv="const"><type>const_reverse_iterator</type><description><para>
  791. </para></description><returns><para>Constant iterator to the before-the-first element of the container. </para>
  792. </returns></method>
  793. <method name="size" cv="const"><type>size_type</type><description><para>
  794. </para></description><returns><para>The number of elements in the container </para>
  795. </returns></method>
  796. <method name="empty" cv="const"><type>bool</type><description><para>
  797. </para></description><returns><para>true if the container is empty and false otherwise </para>
  798. </returns></method>
  799. <method name="swap"><type>void</type><parameter name="that"><paramtype><classname>named_scope_list</classname> &amp;</paramtype></parameter><description><para>Swaps two instances of the container </para></description></method>
  800. <method name="back" cv="const"><type>const_reference</type><description><para>
  801. </para></description><returns><para>Last pushed scope entry </para>
  802. </returns></method>
  803. <method name="front" cv="const"><type>const_reference</type><description><para>
  804. </para></description><returns><para>First pushed scope entry </para>
  805. </returns></method>
  806. </method-group>
  807. <constructor><description><para>Default constructor</para><para>
  808. </para></description><postconditions><para><computeroutput>empty() == true</computeroutput> </para>
  809. </postconditions></constructor>
  810. <constructor><parameter name="that"><paramtype><classname>named_scope_list</classname> const &amp;</paramtype></parameter><description><para>Copy constructor</para><para>
  811. </para></description><postconditions><para><computeroutput>std::equal(begin(), end(), that.begin()) == true</computeroutput> </para>
  812. </postconditions></constructor>
  813. <destructor><description><para>Destructor. Destroys the stored entries. </para></description></destructor>
  814. <copy-assignment><type><classname>named_scope_list</classname> &amp;</type><parameter name="that"><paramtype><classname>named_scope_list</classname> const &amp;</paramtype></parameter><description><para>Assignment operator</para><para>
  815. </para></description><postconditions><para><computeroutput>std::equal(begin(), end(), that.begin()) == true</computeroutput> </para>
  816. </postconditions></copy-assignment>
  817. </class><function name="operator&lt;&lt;"><type>std::basic_ostream&lt; CharT, TraitsT &gt; &amp;</type><template>
  818. <template-type-parameter name="CharT"/>
  819. <template-type-parameter name="TraitsT"/>
  820. </template><parameter name="strm"><paramtype>std::basic_ostream&lt; CharT, TraitsT &gt; &amp;</paramtype></parameter><parameter name="sl"><paramtype><classname>named_scope_list</classname> const &amp;</paramtype></parameter><purpose>Stream output operator. </purpose></function>
  821. </namespace>
  822. </namespace>
  823. </namespace>
  824. <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>
  825. <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>
  826. <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>
  827. </header>
  828. <header name="boost/log/attributes/scoped_attribute.hpp">
  829. <para><para>Andrey Semashev </para>
  830. <para>13.05.2007</para>
  831. The header contains definition of facilities to define scoped attributes. </para><namespace name="boost">
  832. <namespace name="log">
  833. <typedef name="scoped_attribute"><purpose>Scoped attribute guard type. </purpose><type><emphasis>unspecified</emphasis></type></typedef>
  834. <function name="add_scoped_logger_attribute"><type><emphasis>unspecified</emphasis></type><template>
  835. <template-type-parameter name="LoggerT"/>
  836. </template><parameter name="l"><paramtype>LoggerT &amp;</paramtype><description><para>Logger to register the attribute in </para></description></parameter><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>Attribute name </para></description></parameter><parameter name="attr"><paramtype><classname>attribute</classname> const &amp;</paramtype><description><para>The attribute. Must not be NULL. </para></description></parameter><description><para>Registers an attribute in the logger</para><para>
  837. </para></description><returns><para>An unspecified guard object which may be used to initialize a <computeroutput>scoped_attribute</computeroutput> variable. </para>
  838. </returns></function>
  839. <function name="add_scoped_thread_attribute"><type><emphasis>unspecified</emphasis></type><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>Attribute name </para></description></parameter><parameter name="attr"><paramtype><classname>attribute</classname> const &amp;</paramtype><description><para>The attribute. Must not be NULL. </para></description></parameter><description><para>Registers a thread-specific attribute</para><para>
  840. </para></description><returns><para>An unspecified guard object which may be used to initialize a <computeroutput>scoped_attribute</computeroutput> variable. </para>
  841. </returns></function>
  842. </namespace>
  843. </namespace>
  844. <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>
  845. <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>
  846. <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>
  847. <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>
  848. </header>
  849. <header name="boost/log/attributes/time_traits.hpp">
  850. <para><para>Andrey Semashev </para>
  851. <para>01.12.2007</para>
  852. The header contains implementation of time traits that are used in various parts of the library to acquire current time. </para><namespace name="boost">
  853. <namespace name="log">
  854. <namespace name="attributes">
  855. <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>
  856. <typedef name="clock_source"><purpose>Current time source. </purpose><type>posix_time::second_clock</type></typedef>
  857. </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">
  858. <method name="get_clock" specifiers="static"><type>time_type</type><description><para>
  859. </para></description><returns><para>Current time stamp </para>
  860. </returns></method>
  861. </method-group>
  862. </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">
  863. <method name="get_clock" specifiers="static"><type>time_type</type><description><para>
  864. </para></description><returns><para>Current time stamp </para>
  865. </returns></method>
  866. </method-group>
  867. </struct>
  868. </namespace>
  869. </namespace>
  870. </namespace>
  871. </header>
  872. <header name="boost/log/attributes/timer.hpp">
  873. <para><para>Andrey Semashev </para>
  874. <para>02.12.2007</para>
  875. The header contains implementation of a stop watch attribute. </para><namespace name="boost">
  876. <namespace name="log">
  877. <namespace name="attributes">
  878. <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>
  879. <method-group name="public member functions">
  880. </method-group>
  881. <constructor><description><para>Constructor. Starts time counting. </para></description></constructor>
  882. <constructor specifiers="explicit"><parameter name="source"><paramtype><classname>cast_source</classname> const &amp;</paramtype></parameter><description><para>Constructor for casting support </para></description></constructor>
  883. </class>
  884. </namespace>
  885. </namespace>
  886. </namespace>
  887. </header>
  888. <header name="boost/log/attributes/value_extraction.hpp">
  889. <para><para>Andrey Semashev </para>
  890. <para>01.03.2008</para>
  891. The header contains implementation of tools for extracting an attribute value from the view. </para><namespace name="boost">
  892. <namespace name="log">
  893. <namespace name="result_of">
  894. </namespace>
  895. <function name="extract"><type><classname>result_of::extract</classname>&lt; T, TagT &gt;::type</type><template>
  896. <template-type-parameter name="T"/>
  897. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  898. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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>
  899. </para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para>
  900. </returns></function>
  901. <function name="extract"><type><classname>result_of::extract</classname>&lt; T, TagT &gt;::type</type><template>
  902. <template-type-parameter name="T"/>
  903. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  904. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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>
  905. </para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para>
  906. </returns></function>
  907. <function name="extract"><type><classname>result_of::extract</classname>&lt; T, TagT &gt;::type</type><template>
  908. <template-type-parameter name="T"/>
  909. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  910. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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>
  911. </para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para>
  912. </returns></function>
  913. <function name="extract"><type><classname>result_of::extract</classname>&lt; T, TagT &gt;::type</type><template>
  914. <template-type-parameter name="T"/>
  915. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  916. </template><parameter name="value"><paramtype><classname>attribute_value</classname> const &amp;</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>
  917. </para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para>
  918. </returns></function>
  919. <function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>&lt; T, TagT &gt;::type</type><template>
  920. <template-type-parameter name="T"/>
  921. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  922. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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>
  923. </para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para>
  924. </returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function>
  925. <function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>&lt; T, TagT &gt;::type</type><template>
  926. <template-type-parameter name="T"/>
  927. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  928. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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>
  929. </para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para>
  930. </returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function>
  931. <function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>&lt; T, TagT &gt;::type</type><template>
  932. <template-type-parameter name="T"/>
  933. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  934. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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>
  935. </para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para>
  936. </returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function>
  937. <function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>&lt; T, TagT &gt;::type</type><template>
  938. <template-type-parameter name="T"/>
  939. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  940. </template><parameter name="value"><paramtype><classname>attribute_value</classname> const &amp;</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>
  941. </para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para>
  942. </returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function>
  943. <function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>&lt; T, DefaultT, TagT &gt;::type</type><template>
  944. <template-type-parameter name="T"/>
  945. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  946. <template-type-parameter name="DefaultT"/>
  947. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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 &amp;</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>
  948. </note>
  949. </para></description><returns><para>The extracted value, if found. The default value otherwise. </para>
  950. </returns></function>
  951. <function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>&lt; T, DefaultT, TagT &gt;::type</type><template>
  952. <template-type-parameter name="T"/>
  953. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  954. <template-type-parameter name="DefaultT"/>
  955. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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 &amp;</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>
  956. </note>
  957. </para></description><returns><para>The extracted value, if found. The default value otherwise. </para>
  958. </returns></function>
  959. <function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>&lt; T, DefaultT, TagT &gt;::type</type><template>
  960. <template-type-parameter name="T"/>
  961. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  962. <template-type-parameter name="DefaultT"/>
  963. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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 &amp;</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>
  964. </note>
  965. </para></description><returns><para>The extracted value, if found. The default value otherwise. </para>
  966. </returns></function>
  967. <function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>&lt; T, DefaultT, TagT &gt;::type</type><template>
  968. <template-type-parameter name="T"/>
  969. <template-type-parameter name="TagT"><default>void</default></template-type-parameter>
  970. <template-type-parameter name="DefaultT"/>
  971. </template><parameter name="value"><paramtype><classname>attribute_value</classname> const &amp;</paramtype><description><para>Attribute value. </para></description></parameter><parameter name="def_val"><paramtype>DefaultT const &amp;</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>
  972. </note>
  973. </para></description><returns><para>The extracted value, if found. The default value otherwise. </para>
  974. </returns></function>
  975. <function name="extract"><type><classname>result_of::extract</classname>&lt; typename DescriptorT::value_type, DescriptorT &gt;::type</type><template>
  976. <template-type-parameter name="DescriptorT"/>
  977. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  978. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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>
  979. </para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para>
  980. </returns></function>
  981. <function name="extract"><type><classname>result_of::extract</classname>&lt; typename DescriptorT::value_type, DescriptorT &gt;::type</type><template>
  982. <template-type-parameter name="DescriptorT"/>
  983. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  984. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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>
  985. </para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para>
  986. </returns></function>
  987. <function name="extract"><type><classname>result_of::extract</classname>&lt; typename DescriptorT::value_type, DescriptorT &gt;::type</type><template>
  988. <template-type-parameter name="DescriptorT"/>
  989. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  990. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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>
  991. </para></description><returns><para>A <computeroutput>value_ref</computeroutput> that refers to the extracted value, if found. An empty value otherwise. </para>
  992. </returns></function>
  993. <function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>&lt; typename DescriptorT::value_type, DescriptorT &gt;::type</type><template>
  994. <template-type-parameter name="DescriptorT"/>
  995. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  996. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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>
  997. </para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para>
  998. </returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function>
  999. <function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>&lt; typename DescriptorT::value_type, DescriptorT &gt;::type</type><template>
  1000. <template-type-parameter name="DescriptorT"/>
  1001. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  1002. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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>
  1003. </para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para>
  1004. </returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function>
  1005. <function name="extract_or_throw"><type><classname>result_of::extract_or_throw</classname>&lt; typename DescriptorT::value_type, DescriptorT &gt;::type</type><template>
  1006. <template-type-parameter name="DescriptorT"/>
  1007. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  1008. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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>
  1009. </para></description><returns><para>The extracted value or a non-empty <computeroutput>value_ref</computeroutput> that refers to the value. </para>
  1010. </returns><throws><simpara><classname>An</classname> exception is thrown if the requested value cannot be extracted. </simpara></throws></function>
  1011. <function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>&lt; typename DescriptorT::value_type, DefaultT, DescriptorT &gt;::type</type><template>
  1012. <template-type-parameter name="DescriptorT"/>
  1013. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  1014. <template-type-parameter name="DefaultT"/>
  1015. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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 &amp;</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>
  1016. </note>
  1017. </para></description><returns><para>The extracted value, if found. The default value otherwise. </para>
  1018. </returns></function>
  1019. <function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>&lt; typename DescriptorT::value_type, DefaultT, DescriptorT &gt;::type</type><template>
  1020. <template-type-parameter name="DescriptorT"/>
  1021. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  1022. <template-type-parameter name="DefaultT"/>
  1023. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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 &amp;</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>
  1024. </note>
  1025. </para></description><returns><para>The extracted value, if found. The default value otherwise. </para>
  1026. </returns></function>
  1027. <function name="extract_or_default"><type><classname>result_of::extract_or_default</classname>&lt; typename DescriptorT::value_type, DefaultT, DescriptorT &gt;::type</type><template>
  1028. <template-type-parameter name="DescriptorT"/>
  1029. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  1030. <template-type-parameter name="DefaultT"/>
  1031. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to extract. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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 &amp;</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>
  1032. </note>
  1033. </para></description><returns><para>The extracted value, if found. The default value otherwise. </para>
  1034. </returns></function>
  1035. </namespace>
  1036. </namespace>
  1037. </header>
  1038. <header name="boost/log/attributes/value_extraction_fwd.hpp">
  1039. <para><para>Andrey Semashev </para>
  1040. <para>01.03.2008</para>
  1041. The header contains forward declaration of tools for extracting attribute values from the view. </para><namespace name="boost">
  1042. <namespace name="log">
  1043. <class name="value_extractor"><template>
  1044. <template-type-parameter name="T"/>
  1045. <template-type-parameter name="FallbackPolicyT"/>
  1046. <template-type-parameter name="TagT"/>
  1047. </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">
  1048. <method name="operator()" cv="const"><type>result_type</type><parameter name="attr"><paramtype><classname>attribute_value</classname> const &amp;</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>
  1049. </para></description><returns><para>The extracted value, if extraction succeeded, an empty value otherwise. </para>
  1050. </returns></method>
  1051. <method name="operator()" cv="const"><type>result_type</type><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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>
  1052. </para></description><returns><para>The extracted value, if extraction succeeded, an empty value otherwise. </para>
  1053. </returns></method>
  1054. <method name="operator()" cv="const"><type>result_type</type><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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>
  1055. </para></description><returns><para>The extracted value, if extraction succeeded, an empty value otherwise. </para>
  1056. </returns></method>
  1057. <method name="operator()" cv="const"><type>result_type</type><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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>
  1058. </para></description><returns><para>The extracted value, if extraction succeeded, an empty value otherwise. </para>
  1059. </returns></method>
  1060. <method name="get_fallback_policy" cv="const"><type>fallback_policy const &amp;</type><description><para>
  1061. </para></description><returns><para>Fallback policy </para>
  1062. </returns></method>
  1063. </method-group>
  1064. <constructor><parameter name="that"><paramtype><classname>value_extractor</classname> const &amp;</paramtype></parameter><description><para>Default constructor</para><para>Copy constructor </para></description></constructor>
  1065. <constructor specifiers="explicit"><template>
  1066. <template-type-parameter name="U"/>
  1067. </template><parameter name="arg"><paramtype>U const &amp;</paramtype><description><para>Fallback policy constructor argument </para></description></parameter><description><para>Constructor</para><para>
  1068. </para></description></constructor>
  1069. </class><namespace name="result_of">
  1070. <struct name="extract"><template>
  1071. <template-type-parameter name="T"/>
  1072. <template-type-parameter name="TagT"/>
  1073. </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&lt; T, TagT &gt;</computeroutput>. </para></description></struct><struct name="extract_or_default"><template>
  1074. <template-type-parameter name="T"/>
  1075. <template-type-parameter name="DefaultT"/>
  1076. <template-type-parameter name="TagT"/>
  1077. </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&amp;</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&lt; TypesT, TagT &gt;</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>
  1078. <template-type-parameter name="T"/>
  1079. <template-type-parameter name="TagT"/>
  1080. </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&amp;</computeroutput>, if <computeroutput>T</computeroutput> is not an MPL type sequence, or <computeroutput>value_ref&lt; T, TagT &gt;</computeroutput> otherwise. In the latter case the value reference shall never be empty. </para></description></struct></namespace>
  1081. </namespace>
  1082. </namespace>
  1083. </header>
  1084. <header name="boost/log/attributes/value_visitation.hpp">
  1085. <para><para>Andrey Semashev </para>
  1086. <para>01.03.2008</para>
  1087. The header contains implementation of convenience tools to apply visitors to an attribute value in the view. </para><namespace name="boost">
  1088. <namespace name="log">
  1089. <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>
  1090. <method-group name="public member functions">
  1091. <method name="conversion-operator" cv="const noexcept" specifiers="explicit"><type>bool</type><description><para>Checks if the visitation was successful.</para><para>
  1092. </para></description><returns><para><computeroutput>true</computeroutput> if the value was visited successfully, <computeroutput>false</computeroutput> otherwise. </para>
  1093. </returns></method>
  1094. <method name="operator!" cv="const noexcept"><type>bool</type><description><para>Checks if the visitation was unsuccessful.</para><para>
  1095. </para></description><returns><para><computeroutput>false</computeroutput> if the value was visited successfully, <computeroutput>true</computeroutput> otherwise. </para>
  1096. </returns></method>
  1097. <method name="code" cv="const noexcept"><type>error_code</type><description><para>
  1098. </para></description><returns><para>The actual result code of value visitation </para>
  1099. </returns></method>
  1100. </method-group>
  1101. <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>
  1102. </class><function name="visit"><type><classname>visitation_result</classname></type><template>
  1103. <template-type-parameter name="T"/>
  1104. <template-type-parameter name="VisitorT"/>
  1105. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to visit. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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>
  1106. </para></description><returns><para>The result of visitation. </para>
  1107. </returns></function>
  1108. <function name="visit"><type><classname>visitation_result</classname></type><template>
  1109. <template-type-parameter name="T"/>
  1110. <template-type-parameter name="VisitorT"/>
  1111. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to visit. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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>
  1112. </para></description><returns><para>The result of visitation. </para>
  1113. </returns></function>
  1114. <function name="visit"><type><classname>visitation_result</classname></type><template>
  1115. <template-type-parameter name="T"/>
  1116. <template-type-parameter name="VisitorT"/>
  1117. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>The name of the attribute value to visit. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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>
  1118. </para></description><returns><para>The result of visitation. </para>
  1119. </returns></function>
  1120. <function name="visit"><type><classname>visitation_result</classname></type><template>
  1121. <template-type-parameter name="T"/>
  1122. <template-type-parameter name="VisitorT"/>
  1123. </template><parameter name="value"><paramtype><classname>attribute_value</classname> const &amp;</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>
  1124. </para></description><returns><para>The result of visitation. </para>
  1125. </returns></function>
  1126. <function name="visit"><type><classname>visitation_result</classname></type><template>
  1127. <template-type-parameter name="DescriptorT"/>
  1128. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  1129. <template-type-parameter name="VisitorT"/>
  1130. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to visit. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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>
  1131. </para></description><returns><para>The result of visitation. </para>
  1132. </returns></function>
  1133. <function name="visit"><type><classname>visitation_result</classname></type><template>
  1134. <template-type-parameter name="DescriptorT"/>
  1135. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  1136. <template-type-parameter name="VisitorT"/>
  1137. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to visit. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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>
  1138. </para></description><returns><para>The result of visitation. </para>
  1139. </returns></function>
  1140. <function name="visit"><type><classname>visitation_result</classname></type><template>
  1141. <template-type-parameter name="DescriptorT"/>
  1142. <template-nontype-parameter name="ActorT"><type>template&lt; typename &gt; class</type></template-nontype-parameter>
  1143. <template-type-parameter name="VisitorT"/>
  1144. </template><parameter name="keyword"><paramtype>expressions::attribute_keyword&lt; DescriptorT, ActorT &gt; const &amp;</paramtype><description><para>The keyword of the attribute value to visit. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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>
  1145. </para></description><returns><para>The result of visitation. </para>
  1146. </returns></function>
  1147. </namespace>
  1148. </namespace>
  1149. </header>
  1150. <header name="boost/log/attributes/value_visitation_fwd.hpp">
  1151. <para><para>Andrey Semashev </para>
  1152. <para>01.03.2008</para>
  1153. The header contains forward declaration of convenience tools to apply visitors to an attribute value in the view. </para><namespace name="boost">
  1154. <namespace name="log">
  1155. <class name="value_visitor_invoker"><template>
  1156. <template-type-parameter name="T"/>
  1157. <template-type-parameter name="FallbackPolicyT"/>
  1158. </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">
  1159. <method name="operator()" cv="const"><type>result_type</type><template>
  1160. <template-type-parameter name="VisitorT"/>
  1161. </template><parameter name="attr"><paramtype><classname>attribute_value</classname> const &amp;</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>
  1162. </para></description><returns><para>The result of visitation. </para>
  1163. </returns></method>
  1164. <method name="operator()" cv="const"><type>result_type</type><template>
  1165. <template-type-parameter name="VisitorT"/>
  1166. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="attrs"><paramtype><classname>attribute_value_set</classname> const &amp;</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>
  1167. </para></description><returns><para>The result of visitation. </para>
  1168. </returns></method>
  1169. <method name="operator()" cv="const"><type>result_type</type><template>
  1170. <template-type-parameter name="VisitorT"/>
  1171. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="rec"><paramtype>record const &amp;</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>
  1172. </para></description><returns><para>The result of visitation. </para>
  1173. </returns></method>
  1174. <method name="operator()" cv="const"><type>result_type</type><template>
  1175. <template-type-parameter name="VisitorT"/>
  1176. </template><parameter name="name"><paramtype><classname>attribute_name</classname> const &amp;</paramtype><description><para>Attribute value name. </para></description></parameter><parameter name="rec"><paramtype>record_view const &amp;</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>
  1177. </para></description><returns><para>The result of visitation. </para>
  1178. </returns></method>
  1179. <method name="get_fallback_policy" cv="const"><type>fallback_policy const &amp;</type><description><para>
  1180. </para></description><returns><para>Fallback policy </para>
  1181. </returns></method>
  1182. </method-group>
  1183. <constructor><parameter name="that"><paramtype><classname>value_visitor_invoker</classname> const &amp;</paramtype></parameter><description><para>Default constructor</para><para>Copy constructor </para></description></constructor>
  1184. <constructor specifiers="explicit"><template>
  1185. <template-type-parameter name="U"/>
  1186. </template><parameter name="arg"><paramtype>U const &amp;</paramtype><description><para>Fallback policy argument </para></description></parameter><description><para>Initializing constructor</para><para>
  1187. </para></description></constructor>
  1188. </class>
  1189. </namespace>
  1190. </namespace>
  1191. </header>
  1192. </library-reference>