Main MRPT website > C++ reference for MRPT 1.9.9
lib_mrpt_rtti.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 /** \defgroup mrpt_rtti_grp [mrpt-rtti]
11 
12 Runtime Type Information (RTTI) library, providing compiler-independent class registry, class factory, and inheritance information.
13 
14 <small> <a href="index.html#libs">Back to list of all libraries</a> | <a href="modules.html" >See all modules</a> </small>
15 <br>
16 
17 # Library `mrpt-rtti`
18 <small> [New in MRPT 2.0.0] </small>
19 
20 This library is part of MRPT and can be installed in Debian-based systems with:
21 
22  sudo apt install libmrpt-rtti-dev
23 
24 Any class with RTTI support has to be derived from mrpt::rtti::CObject, either
25 directly or via a hierarchy of inheriting classes.
26 Class factory by name enables deserialization of polymorphic classes in the
27 library \ref mrpt_serialization_grp.
28 
29 All classes defined in each MRPT module are automatically registered when loading
30 the module (if dynamically linked).
31 
32 ## Example #1: defining new user classes
33 
34 See: \ref rtti_example1/test.cpp
35 \snippet rtti_example1/test.cpp example-define-class
36 \snippet rtti_example1/test.cpp example-define-class-test
37 Output:
38 \include rtti_example1/console.out
39 
40 ## Example #2: using the class factory
41 
42 See: \ref rtti_example1/test.cpp
43 \snippet rtti_example1/test.cpp example-define-class
44 \snippet rtti_example1/test.cpp example-factory
45 Output:
46 \include rtti_example1/console.out
47 
48 */



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST