MRPT  2.0.4
Classes | Namespaces
TTypeName.h File Reference
#include <mrpt/typemeta/static_string.h>
#include <cstdint>
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 90 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:46

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 104 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:46

Definition at line 111 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:46

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

See also
MRPT_DECLARE_TTYPENAME_NO_NAMESPACE

Definition at line 119 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:46

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

See also
MRPT_DECLARE_TTYPENAME_NAMESPACE

Definition at line 128 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 135 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 142 of file TTypeName.h.




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020