<!-- 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: rttr_enable.h File Reference</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&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="header"> <div class="summary"> <a href="#namespaces">Namespaces</a> | <a href="#define-members">Macros</a> </div> <div class="headertitle"> <div class="title">rttr_enable.h File Reference</div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><code>#include <type_traits></code><br /> <code>#include "<a class="el" href="type_8h_source.html">rttr/type.h</a>"</code><br /> <code>#include "rttr/detail/misc/misc_type_traits.h"</code><br /> </div> <p><a href="rttr__enable_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a> Namespaces</h2></td></tr> <tr class="memitem:namespacerttr"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacerttr.html">rttr</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:a848bcae21d3a54e07ca6450689820a59"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="rttr__enable_8h.html#a848bcae21d3a54e07ca6450689820a59">RTTR_ENABLE</a>(...)</td></tr> <tr class="memdesc:a848bcae21d3a54e07ca6450689820a59"><td class="mdescLeft"> </td><td class="mdescRight">This macro is necessary in order to retrieve type information about the inheritance graph of a class. <a href="#a848bcae21d3a54e07ca6450689820a59">More...</a><br /></td></tr> <tr class="separator:a848bcae21d3a54e07ca6450689820a59"><td class="memSeparator" colspan="2"> </td></tr> </table> <h2 class="groupheader">Macro Definition Documentation</h2> <a id="a848bcae21d3a54e07ca6450689820a59"></a> <h2 class="memtitle"><span class="permalink"><a href="#a848bcae21d3a54e07ca6450689820a59">◆ </a></span>RTTR_ENABLE</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define RTTR_ENABLE</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>...</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This macro is necessary in order to retrieve type information about the inheritance graph of a class. </p> <p>When there is no inheritance graph, the macro is <b>not</b> needed, e.g. for POD types.</p> <p>Put the macro inside every class, where you need the complete inheritance information about the class type.</p> <div class="fragment"><div class="line"><span class="keyword">struct </span>Base</div><div class="line">{</div><div class="line"> <a class="code" href="rttr__enable_8h.html#a848bcae21d3a54e07ca6450689820a59">RTTR_ENABLE</a>()</div><div class="line">};</div></div><!-- fragment --><p>Place the macro <a class="el" href="rttr__enable_8h.html#a848bcae21d3a54e07ca6450689820a59">RTTR_ENABLE()</a> somewhere in the class, it doesn't matter if its under the public, protected or private class accessor section.</p> <p>Into the derived class you put the same macro, but now as argument the name of the parent class. Which is in this case <code>Base</code>. </p><div class="fragment"><div class="line"><span class="keyword">struct </span>Derived : Base</div><div class="line">{</div><div class="line"> <a class="code" href="rttr__enable_8h.html#a848bcae21d3a54e07ca6450689820a59">RTTR_ENABLE</a>(Base)</div><div class="line">};</div></div><!-- fragment --><p>When you use multiple inheritance you simply separate every class with a comma. </p><div class="fragment"><div class="line"><span class="keyword">struct </span>MultipleDerived : Base, Other</div><div class="line">{</div><div class="line"> <a class="code" href="rttr__enable_8h.html#a848bcae21d3a54e07ca6450689820a59">RTTR_ENABLE</a>(Base, Other)</div><div class="line">};</div></div><!-- fragment --><dl class="section remark"><dt>Remarks</dt><dd>Without this macro, it will not be possible to use <a class="el" href="namespacerttr.html#ab3dd8b62e5ddca4c1d57cc572ba6bb81">rttr_cast</a> or meta information in the type class, like: <a class="el" href="classrttr_1_1type.html#aed9b001581881e62aaf794f456e405e7">get_base_classes()</a> or <a class="el" href="classrttr_1_1type.html#a579391b0b9fdb6d4d001efd1c409bad7">get_derived_classes()</a>. </dd></dl> </div> </div> </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>