Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > d8d30ad953f2dbe7e871721325480315 > files > 341

librttr-devel-0.9.6-1.mga7.armv7hl.rpm

<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.15"/>
        <script type="text/javascript" src="jquery.min.js"></script>
        <title>rttr: Parameter Names</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link rel = "shortcut icon" type = "image/x-icon" href = "favicon.ico">
        <link rel = "stylesheet" href = "fonts/ptsans_regular_macroman/stylesheet.css">
        <link rel = "stylesheet" href = "fonts/source_code_pro_regular/stylesheet.css">
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="custom-doxygen.css" rel="stylesheet" type="text/css"/>
        <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" href="custom-bootstrap.css">
        <script src="bootstrap/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="doxy-boot.js"></script>
    </head>
    <body>
     <!--
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">rttr 0.9.6</a>
                </div>
            </div>
        </nav>
        -->
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel panel-default" style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Parameter Names </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>As additional meta information it is possible to provide the names of arguments for <a class="el" href="classrttr_1_1method.html">methods</a> or <a class="el" href="classrttr_1_1constructor.html">constructors</a>. This information is then accessible via an object of type <a class="el" href="classrttr_1_1parameter__info.html">parameter_info</a>.</p>
<p>Please take a look at following example:</p>
<div class="fragment"><div class="line"><span class="keyword">using namespace </span><a class="code" href="namespacerttr.html">rttr</a>;</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> set_window_geometry(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">int</span> w, <span class="keywordtype">int</span> h) {...}</div><div class="line"></div><div class="line"><a class="code" href="registration_8h.html#ac6326400f16225ee15b52eabcaae8130">RTTR_REGISTRATION</a></div><div class="line">{</div><div class="line">    <a class="code" href="classrttr_1_1registration.html#a5da1c6eb947d700681faa7fec0bf23b7">registration::method</a>(<span class="stringliteral">&quot;set_window_geometry&quot;</span>, &amp;set_window_geometry)</div><div class="line">    (</div><div class="line">        <a class="code" href="namespacerttr.html#ab708b3893cbd5a10e8782f3825052ea6">parameter_names</a>(<span class="stringliteral">&quot;window name&quot;</span>, <span class="stringliteral">&quot;width&quot;</span>, <span class="stringliteral">&quot;height&quot;</span>)</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --><p>The names has to a string literal (i.e. const char*) and provided via the function: <a class="el" href="namespacerttr.html#ab708b3893cbd5a10e8782f3825052ea6">parameter_names()</a>. Place the call in the <code>()</code> operator of the returned <a class="el" href="classrttr_1_1registration_1_1bind.html">bind</a> object. </p><dl class="section remark"><dt>Remarks</dt><dd>It is not possible to provide just one name, when you use this function, you have to provide names for <b>all</b> arguments.</dd></dl>
<p>The function has following synopsis: </p><div class="fragment"><div class="line"><span class="keyword">template</span>&lt;<span class="keyword">typename</span>...TArgs&gt;</div><div class="line">detail::parameter_names&lt;detail::decay_t&lt;TArgs&gt;...&gt; <a class="code" href="namespacerttr.html#ab708b3893cbd5a10e8782f3825052ea6">parameter_names</a>(TArgs&amp;&amp;...args)</div></div><!-- fragment --><p> The names can be retrieved via the <a class="el" href="classrttr_1_1parameter__info.html">parameter_info</a> class. Take a look at the following example:</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">    method meth = type::get_global_method(<span class="stringliteral">&quot;set_window_geometry&quot;</span>);</div><div class="line">    std::vector&lt;parameter_info&gt; param_list = meth.get_parameter_infos();</div><div class="line">    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; info : param_list)</div><div class="line">    {</div><div class="line">        <span class="comment">// print all names of the parameter types and its position in the paramter list</span></div><div class="line">        std::cout &lt;&lt; <span class="stringliteral">&quot; name: &#39;&quot;</span> &lt;&lt; info.get_type().get_name() &lt;&lt; <span class="stringliteral">&quot;&#39;\n&quot;</span></div><div class="line">                  &lt;&lt; <span class="stringliteral">&quot;index: &quot;</span> &lt;&lt; info.get_index()</div><div class="line">                               &lt;&lt; std::endl;</div><div class="line">    }</div><div class="line">}</div></div><!-- fragment --><p>Output: </p><pre class="fragment"> name: 'window name'
index: 0
 name: 'width'
index: 1
 name: 'height'
index: 2
</pre><hr/>
<div type="button" class="btn btn-default doxy-button"><a class="el" href="default_arguments_page.html">previous</a></div><div class="btn btn-default doxy-button"><a class="el" href="register_policies_page.html">next</a></div> </div></div><!-- PageDoc -->
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- start footer part -->
<hr class="footer"/>
<address class="footer">
<small>
Generated on Thu Apr 11 2019 20:05:57 for rttr - 0.9.6 by 
<a href="http://www.doxygen.org/index.html">doxygen</a>.
</small>
</address>
</body>
</html>