Main MRPT website > C++ reference for MRPT 1.4.0
CStartUpClassesRegister.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-2016, 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 #ifndef CStartUpClassesRegister_H
10 #define CStartUpClassesRegister_H
11 
12 #include <mrpt/base/link_pragmas.h>
13 
14 namespace mrpt
15 {
16  namespace utils
17  {
18  /** A helper class that automatically register at start up a custom function to register all the CObject-derived classes in a given MRPT library or user application.
19  * Usage:
20  * \code
21  * void registerAllMyClasses()
22  * {
23  * registerClass(CLASS_ID( CMyClass1 ) );
24  * ...
25  * }
26  *
27  * CStartUpClassesRegister doReg( &registerAllMyClasses );
28  *
29  * \endcode
30  * \ingroup mrpt_base_grp
31  */
33  {
34  public:
35  /** Read the global description of mrpt::utils::CStartUpClassesRegister */
36  CStartUpClassesRegister(void (*ptr_register_func)() );
38 
39  int do_nothing(); //!<< dummy method to allow introducing dependences and avoid the compiler removing the class in static linking
40 
41  private:
42  void (*m_ptr_register_func)(); //!< An internal copy of the functor.
43 
45  };
46 
47 
48  } // End of namespace
49 } // End of namespace
50 
51 #endif
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:16
mrpt::utils::CStartUpClassesRegister::m_dummy_var
int m_dummy_var
Definition: CStartUpClassesRegister.h:44
mrpt::utils::CStartUpClassesRegister
A helper class that automatically register at start up a custom function to register all the CObject-...
Definition: CStartUpClassesRegister.h:32



Page generated by Doxygen 1.8.16 for MRPT 1.4.0 SVN: at Mon Oct 14 23:11:08 UTC 2019