MRPT  1.9.9
TTypeName.h File Reference
#include <cstdint>
#include <mrpt/typemeta/static_string.h>
Include dependency graph for TTypeName.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  std::shared_ptr< T >
 
struct  mrpt::typemeta::TTypeName< T >
 A template to obtain the type of its argument as a string at compile time. More...
 
struct  mrpt::typemeta::TTypeName< std::shared_ptr< T > >
 Specialization for shared_ptr<T> More...
 

Namespaces

 mrpt
 This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
 
 mrpt::typemeta
 

Macros

Conversion of type to string at compile time
#define DECLARE_CUSTOM_TTYPENAME(_TYPE)
 Identical to MRPT_DECLARE_TTYPENAME but intended for user code. More...
 
#define DECLARE_TTYPENAME_CLASSNAME(_CLASSNAME)
 Like DECLARE_CUSTOM_TTYPENAME(), but for use within the class declaration body. More...
 
#define MRPT_DECLARE_TTYPENAME(_TYPE)
 
#define MRPT_DECLARE_TTYPENAME_NAMESPACE(_TYPE, __NS)
 Declares a typename to be "namespace::type". More...
 
#define MRPT_DECLARE_TTYPENAME_NO_NAMESPACE(_TYPE, __NS)
 Declares a typename to be "type" (without the NS prefix) More...
 
#define MRPT_DECLARE_TTYPENAME_PTR(_TYPE)
 
#define MRPT_DECLARE_TTYPENAME_PTR_NAMESPACE(_TYPE, __NS)
 

Macro Definition Documentation

◆ DECLARE_CUSTOM_TTYPENAME

#define DECLARE_CUSTOM_TTYPENAME (   _TYPE)
Value:
namespace mrpt \
{ \
namespace typemeta \
{ \
MRPT_DECLARE_TTYPENAME(_TYPE) \
} \
}
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.

Identical to MRPT_DECLARE_TTYPENAME but intended for user code.

MUST be placed at the GLOBAL namespace. Can be used for types declared at the global or within some namespace. Just write the full namespace path as _TYPE argument here.

See also
TTypeName, DECLARE_TTYPENAME_CLASSNAME
Examples:
typemeta_TTypeName/test.cpp.

Definition at line 86 of file TTypeName.h.

◆ DECLARE_TTYPENAME_CLASSNAME

#define DECLARE_TTYPENAME_CLASSNAME (   _CLASSNAME)
Value:
public: \
static constexpr auto getClassName() \
{ \
return mrpt::typemeta::literal(#_CLASSNAME); \
}
constexpr auto literal(const char(&lit)[N_PLUS_1]) -> string_literal< N_PLUS_1 - 1 >
Definition: static_string.h:43

Like DECLARE_CUSTOM_TTYPENAME(), but for use within the class declaration body.

It has the advantage of not requiring macros/definitions out of the original class namespace.

See also
TTypeName
Examples:
typemeta_TTypeName/test.cpp.

Definition at line 100 of file TTypeName.h.

◆ MRPT_DECLARE_TTYPENAME

#define MRPT_DECLARE_TTYPENAME (   _TYPE)
Value:
template <> \
struct TTypeName<_TYPE> \
{ \
constexpr static auto get() { return literal(#_TYPE); } \
};
constexpr auto literal(const char(&lit)[N_PLUS_1]) -> string_literal< N_PLUS_1 - 1 >
Definition: static_string.h:43

Definition at line 107 of file TTypeName.h.

◆ MRPT_DECLARE_TTYPENAME_NAMESPACE

#define MRPT_DECLARE_TTYPENAME_NAMESPACE (   _TYPE,
  __NS 
)
Value:
template <> \
struct TTypeName<__NS::_TYPE> \
{ \
constexpr static auto get() { return literal(#__NS "::" #_TYPE); } \
};
constexpr auto literal(const char(&lit)[N_PLUS_1]) -> string_literal< N_PLUS_1 - 1 >
Definition: static_string.h:43

Declares a typename to be "namespace::type".

See also
MRPT_DECLARE_TTYPENAME_NO_NAMESPACE

Definition at line 115 of file TTypeName.h.

◆ MRPT_DECLARE_TTYPENAME_NO_NAMESPACE

#define MRPT_DECLARE_TTYPENAME_NO_NAMESPACE (   _TYPE,
  __NS 
)
Value:
template <> \
struct TTypeName<__NS::_TYPE> \
{ \
constexpr static auto get() { return literal(#_TYPE); } \
};
constexpr auto literal(const char(&lit)[N_PLUS_1]) -> string_literal< N_PLUS_1 - 1 >
Definition: static_string.h:43

Declares a typename to be "type" (without the NS prefix)

See also
MRPT_DECLARE_TTYPENAME_NAMESPACE

Definition at line 124 of file TTypeName.h.

◆ MRPT_DECLARE_TTYPENAME_PTR

#define MRPT_DECLARE_TTYPENAME_PTR (   _TYPE)
Value:
template <> \
struct TTypeName<_TYPE::Ptr> \
{ \
static auto get() { return TTypeName<_TYPE>::get(); } \
};

Definition at line 131 of file TTypeName.h.

◆ MRPT_DECLARE_TTYPENAME_PTR_NAMESPACE

#define MRPT_DECLARE_TTYPENAME_PTR_NAMESPACE (   _TYPE,
  __NS 
)
Value:
template <> \
struct TTypeName<__NS::_TYPE::Ptr> \
{ \
static auto get() { return TTypeName<__NS::_TYPE>::get(); } \
};

Definition at line 138 of file TTypeName.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020