9ca7993cc5429e9e1e180cf2aa7b9a1dfe701f2c
[platform/upstream/libsigc++.git] / docs / reference / html / structsigc_1_1visitor.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.9.1"/>
7 <title>libsigc++: sigc::visitor&lt; T_functor &gt; Struct Template Reference</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <script type="text/javascript" src="jquery.js"></script>
10 <script type="text/javascript" src="dynsections.js"></script>
11 <link href="doxygen.css" rel="stylesheet" type="text/css" />
12 <link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
13 </head>
14 <body>
15 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
16 <div id="titlearea">
17 <table cellspacing="0" cellpadding="0">
18  <tbody>
19  <tr style="height: 56px;">
20   <td style="padding-left: 0.5em;">
21    <div id="projectname">libsigc++
22    &#160;<span id="projectnumber">2.9.1</span>
23    </div>
24   </td>
25  </tr>
26  </tbody>
27 </table>
28 </div>
29 <!-- end header part -->
30 <!-- Generated by Doxygen 1.8.9.1 -->
31   <div id="navrow1" class="tabs">
32     <ul class="tablist">
33       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
34       <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
35       <li><a href="modules.html"><span>Modules</span></a></li>
36       <li><a href="namespaces.html"><span>Namespaces</span></a></li>
37       <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
38     </ul>
39   </div>
40   <div id="navrow2" class="tabs2">
41     <ul class="tablist">
42       <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
43       <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
44       <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
45       <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
46     </ul>
47   </div>
48 <div id="nav-path" class="navpath">
49   <ul>
50 <li class="navelem"><a class="el" href="namespacesigc.html">sigc</a></li><li class="navelem"><a class="el" href="structsigc_1_1visitor.html">visitor</a></li>  </ul>
51 </div>
52 </div><!-- top -->
53 <div class="header">
54   <div class="summary">
55 <a href="#pub-static-methods">Static Public Member Functions</a> &#124;
56 <a href="structsigc_1_1visitor-members.html">List of all members</a>  </div>
57   <div class="headertitle">
58 <div class="title">sigc::visitor&lt; T_functor &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__sigcfunctors.html">Functors</a></div></div>  </div>
59 </div><!--header-->
60 <div class="contents">
61
62 <p><a class="el" href="structsigc_1_1visitor.html#a9fe5d6be845e622a99a0db5d3621d4b3">sigc::visitor&lt;T_functor&gt;::do_visit_each()</a> performs a functor on each of the targets of a functor.  
63  <a href="structsigc_1_1visitor.html#details">More...</a></p>
64
65 <p><code>#include &lt;sigc++/visit_each.h&gt;</code></p>
66 <table class="memberdecls">
67 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
68 Static Public Member Functions</h2></td></tr>
69 <tr class="memitem:a9fe5d6be845e622a99a0db5d3621d4b3"><td class="memTemplParams" colspan="2">template&lt;class T_action &gt; </td></tr>
70 <tr class="memitem:a9fe5d6be845e622a99a0db5d3621d4b3"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structsigc_1_1visitor.html#a9fe5d6be845e622a99a0db5d3621d4b3">do_visit_each</a> (const T_action&amp; _A_action, const T_functor&amp; _A_functor)</td></tr>
71 <tr class="separator:a9fe5d6be845e622a99a0db5d3621d4b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
72 </table>
73 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
74 <div class="textblock"><h3>template&lt;class T_functor&gt;<br />
75 struct sigc::visitor&lt; T_functor &gt;</h3>
76
77 <p><a class="el" href="structsigc_1_1visitor.html#a9fe5d6be845e622a99a0db5d3621d4b3">sigc::visitor&lt;T_functor&gt;::do_visit_each()</a> performs a functor on each of the targets of a functor. </p>
78 <p>All unknown types just call <em>_A_action</em> on them. Add specializations that specialize the <em>T_functor</em> argument for your own functor types, so that subobjects get visited. This is needed to enable auto-disconnection support for your functor types.</p>
79 <dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><span class="keyword">namespace </span>some_ns</div>
80 <div class="line">{</div>
81 <div class="line">  <span class="keyword">struct </span>some_functor</div>
82 <div class="line">  {</div>
83 <div class="line">    <span class="keywordtype">void</span> operator()() {}</div>
84 <div class="line">    some_possibly_sigc_trackable_derived_type some_data_member;</div>
85 <div class="line">    some_other_functor_type some_other_functor;</div>
86 <div class="line">  };</div>
87 <div class="line">}</div>
88 <div class="line"></div>
89 <div class="line"><span class="keyword">namespace </span><a class="code" href="namespacesigc.html">sigc</a></div>
90 <div class="line">{</div>
91 <div class="line">  <span class="keyword">template</span> &lt;&gt;</div>
92 <div class="line">  <span class="keyword">struct </span>visitor&lt;some_ns::some_functor&gt;</div>
93 <div class="line">  {</div>
94 <div class="line">    <span class="keyword">template</span> &lt;<span class="keyword">class</span> T_action&gt;</div>
95 <div class="line">    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="structsigc_1_1visitor.html#a9fe5d6be845e622a99a0db5d3621d4b3">do_visit_each</a>(<span class="keyword">const</span> T_action&amp; _A_action,</div>
96 <div class="line">                              <span class="keyword">const</span> some_ns::some_functor&amp; _A_target)</div>
97 <div class="line">    {</div>
98 <div class="line">      <a class="code" href="group__sigcfunctors.html#ga64cb7832acc1e58efb5ffe0b4f5e9404">sigc::visit_each</a>(_A_action, _A_target.some_data_member);</div>
99 <div class="line">      <a class="code" href="group__sigcfunctors.html#ga64cb7832acc1e58efb5ffe0b4f5e9404">sigc::visit_each</a>(_A_action, _A_target.some_other_functor);</div>
100 <div class="line">    }</div>
101 <div class="line">  };</div>
102 <div class="line">}</div>
103 </div><!-- fragment --> </dd></dl>
104 </div><h2 class="groupheader">Member Function Documentation</h2>
105 <a class="anchor" id="a9fe5d6be845e622a99a0db5d3621d4b3"></a>
106 <div class="memitem">
107 <div class="memproto">
108 <div class="memtemplate">
109 template &lt;class T_functor &gt; </div>
110 <div class="memtemplate">
111 template &lt;class T_action &gt; </div>
112 <table class="mlabels">
113   <tr>
114   <td class="mlabels-left">
115       <table class="memname">
116         <tr>
117           <td class="memname">static void <a class="el" href="structsigc_1_1visitor.html">sigc::visitor</a>&lt; T_functor &gt;::do_visit_each </td>
118           <td>(</td>
119           <td class="paramtype">const T_action &amp;&#160;</td>
120           <td class="paramname"><em>_A_action</em>, </td>
121         </tr>
122         <tr>
123           <td class="paramkey"></td>
124           <td></td>
125           <td class="paramtype">const T_functor &amp;&#160;</td>
126           <td class="paramname"><em>_A_functor</em>&#160;</td>
127         </tr>
128         <tr>
129           <td></td>
130           <td>)</td>
131           <td></td><td></td>
132         </tr>
133       </table>
134   </td>
135   <td class="mlabels-right">
136 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
137   </tr>
138 </table>
139 </div><div class="memdoc">
140
141 </div>
142 </div>
143 </div><!-- contents -->
144 <!-- start footer part -->
145 <hr class="footer"/><address class="footer"><small>
146 Generated on Wed Mar 16 2016 13:54:33 for libsigc++ by &#160;<a href="http://www.doxygen.org/index.html">
147 <img class="footer" src="doxygen.png" alt="doxygen"/>
148 </a> 1.8.9.1
149 </small></address>
150 </body>
151 </html>