Main MRPT website > C++ reference for MRPT 1.9.9
TTypeName_impl.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-2017, 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 TTYPENAME_IMPL_H
10 #define TTYPENAME_IMPL_H
11 
12 #include <mrpt/utils/TTypeName.h>
13 #include <list>
14 #include <vector>
15 #include <deque>
16 #include <set>
17 #include <map>
18 
19 // This file extends TTypeName.h for STL C++ types.
20 
21 namespace mrpt
22 {
23 namespace utils
24 {
25 /** @name Conversion of type to string at compile time
26 @{ */
27 
29 
30 #define MRPT_DECLARE_TTYPENAME_CONTAINER(_CONTAINER) \
31  template <typename V> \
32  struct TTypeName<_CONTAINER<V>> \
33  { \
34  static std::string get() \
35  { \
36  return std::string(#_CONTAINER) + std::string("<") + \
37  std::string(TTypeName<V>::get()) + std::string(">"); \
38  } \
39  };
40 
45 
46 #define MRPT_DECLARE_TTYPENAME_CONTAINER_ASSOC(_CONTAINER) \
47  template <typename K, typename V> \
48  struct TTypeName<_CONTAINER<K, V>> \
49  { \
50  static std::string get() \
51  { \
52  return std::string(#_CONTAINER) + std::string("<") + \
53  std::string(TTypeName<K>::get()) + std::string(",") + \
54  std::string(TTypeName<V>::get()) + std::string(">"); \
55  } \
56  };
57 
60 
61 template <typename T1, typename T2>
62 struct TTypeName<std::pair<T1, T2>>
63 {
64  static std::string get()
65  {
66  return std::string("std::pair<") + std::string(TTypeName<T1>::get()) +
68  std::string(">");
69  }
70 };
71 
72 /** @} */
73 
74 } // End of namespace
75 } // End of namespace
76 
77 #endif
A template to obtain the type of its argument as a string at compile time.
Definition: TTypeName.h:55
STL namespace.
#define MRPT_DECLARE_TTYPENAME_CONTAINER(_CONTAINER)
GLsizei const GLchar ** string
Definition: glext.h:4101
#define MRPT_DECLARE_TTYPENAME_CONTAINER_ASSOC(_CONTAINER)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define MRPT_DECLARE_TTYPENAME(_TYPE)
Definition: TTypeName.h:72



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019