| QxOrm 1.1.9 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

Classes | Namespaces | Defines
get_class_name.h File Reference
QxTraits : QxOrm library traits (template metaprogramming) not available in 'boost::type_traits' library

qx::trait::get_class_name<T>::get() : return class name of type T under const char * format, T must be registered with QX_REGISTER_CLASS_NAME(T) macro More...

`#include <typeinfo>`
`#include <boost/algorithm/string.hpp>`
`#include <QxTraits/remove_attr.h>`

Go to the source code of this file.

## Classes
struct | qx::trait::get_class_name< T >
| qx::trait::get_class_name<T>::get() : return class name of type T under const char * format, T must be registered with QX_REGISTER_CLASS_NAME(T) macro More...
## Namespaces
namespace | qx

| Root namespace for all QxOrm library features.
namespace | qx::trait

| QxOrm library traits (template metaprogramming) not available in boost::type_traits library.
## Defines
#define | QX_REGISTER_CLASS_NAME_SEP_INF std::string("<")
#define | QX_REGISTER_CLASS_NAME_SEP_SUP std::string(">")
#define | QX_REGISTER_CLASS_NAME_SEP_NXT std::string(", ")
#define | QX_REGISTER_CLASS_NAME_SEP_INF_XML_TAG std::string("-")
#define | QX_REGISTER_CLASS_NAME_SEP_SUP_XML_TAG std::string("-")
#define | QX_REGISTER_CLASS_NAME_SEP_NXT_XML_TAG std::string("_")
#define | QX_GET_CLASS_NAME(TYPE) qx::trait::get_class_name< qx::trait::remove_attr< TYPE >::type >::get()
#define | QX_GET_CLASS_NAME_STD_STR(TYPE) std::string(qx::trait::get_class_name< qx::trait::remove_attr< TYPE >::type >::get())
#define | QX_GET_CLASS_NAME_XML_TAG(TYPE) qx::trait::get_class_name< qx::trait::remove_attr< TYPE >::type >::get_xml_tag()
#define | QX_GET_CLASS_NAME_XML_TAG_STD_STR(TYPE) std::string(qx::trait::get_class_name< qx::trait::remove_attr< TYPE >::type >::get_xml_tag())
#define | QX_GET_CLASS_NAME_WITH_TYPENAME(TYPE) qx::trait::get_class_name< typename qx::trait::remove_attr< TYPE >::type >::get()
#define | QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(TYPE) std::string(qx::trait::get_class_name< typename qx::trait::remove_attr< TYPE >::type >::get())
#define | QX_GET_CLASS_NAME_XML_TAG_WITH_TYPENAME(TYPE) qx::trait::get_class_name< typename qx::trait::remove_attr< TYPE >::type >::get_xml_tag()
#define | QX_GET_CLASS_NAME_XML_TAG_STD_STR_WITH_TYPENAME(TYPE) std::string(qx::trait::get_class_name< typename qx::trait::remove_attr< TYPE >::type >::get_xml_tag())
#define | QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG()
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className)
#define | QX_REGISTER_CLASS_NAME(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_1(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_2(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_3(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_4(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_5(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_6(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_7(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_8(className)
#define | QX_REGISTER_CLASS_NAME_TEMPLATE_9(className)

## Detailed Description

qx::trait::get_class_name<T>::get() : return class name of type T under const char * format, T must be registered with QX_REGISTER_CLASS_NAME(T) macro

Author:
  Lionel Marty

Definition in file get_class_name.h.

## Define Documentation

#define QX_GET_CLASS_NAME | ( |  | TYPE | ) | qx::trait::get_class_name< qx::trait::remove_attr< TYPE >::type >::get()

Definition at line 54 of file get_class_name.h.

#define QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG | ( |  | ) |

Value:

    static inline const char * get_xml_tag() \
    { \
       static std::string result_xml; \
       if (! result_xml.empty()) { return result_xml.c_str(); } \
       result_xml = std::string(get_class_name::get()); \
       boost::replace_all(result_xml, QX_REGISTER_CLASS_NAME_SEP_INF, QX_REGISTER_CLASS_NAME_SEP_INF_XML_TAG); \
       boost::replace_all(result_xml, QX_REGISTER_CLASS_NAME_SEP_SUP, QX_REGISTER_CLASS_NAME_SEP_SUP_XML_TAG); \
       boost::replace_all(result_xml, QX_REGISTER_CLASS_NAME_SEP_NXT, QX_REGISTER_CLASS_NAME_SEP_NXT_XML_TAG); \
       boost::replace_all(result_xml, "::", "."); \
       boost::replace_all(result_xml, " ", ""); \
       return result_xml.c_str(); \
    }

Definition at line 78 of file get_class_name.h.

#define QX_GET_CLASS_NAME_STD_STR | ( |  | TYPE | ) | std::string(qx::trait::get_class_name< qx::trait::remove_attr< TYPE >::type >::get())

Definition at line 57 of file get_class_name.h.

#define QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME | ( |  | TYPE | ) | std::string(qx::trait::get_class_name< typename qx::trait::remove_attr< TYPE >::type >::get())

Definition at line 69 of file get_class_name.h.

#define QX_GET_CLASS_NAME_WITH_TYPENAME | ( |  | TYPE | ) | qx::trait::get_class_name< typename qx::trait::remove_attr< TYPE >::type >::get()

Definition at line 66 of file get_class_name.h.

#define QX_GET_CLASS_NAME_XML_TAG | ( |  | TYPE | ) | qx::trait::get_class_name< qx::trait::remove_attr< TYPE >::type >::get_xml_tag()

Definition at line 60 of file get_class_name.h.

#define QX_GET_CLASS_NAME_XML_TAG_STD_STR | ( |  | TYPE | ) | std::string(qx::trait::get_class_name< qx::trait::remove_attr< TYPE >::type >::get_xml_tag())

Definition at line 63 of file get_class_name.h.

#define QX_GET_CLASS_NAME_XML_TAG_STD_STR_WITH_TYPENAME | ( |  | TYPE | ) | std::string(qx::trait::get_class_name< typename qx::trait::remove_attr< TYPE >::type >::get_xml_tag())

Definition at line 75 of file get_class_name.h.

#define QX_GET_CLASS_NAME_XML_TAG_WITH_TYPENAME | ( |  | TYPE | ) | qx::trait::get_class_name< typename qx::trait::remove_attr< TYPE >::type >::get_xml_tag()

Definition at line 72 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <> \
    struct get_class_name< className > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 126 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_SEP_INF std::string("<")

Definition at line 46 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_SEP_INF_XML_TAG std::string("-")

Definition at line 50 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_SEP_NXT std::string(", ")

Definition at line 48 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_SEP_NXT_XML_TAG std::string("_")

Definition at line 52 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_SEP_SUP std::string(">")

Definition at line 47 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_SEP_SUP_XML_TAG std::string("-")

Definition at line 51 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_1 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T> \
    struct get_class_name< className<T> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 140 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_2 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T1, typename T2> \
    struct get_class_name< className<T1, T2> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T1) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T2) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 155 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_3 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T1, typename T2, typename T3> \
    struct get_class_name< className<T1, T2, T3> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T1) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T2) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T3) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 171 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_4 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T1, typename T2, typename T3, typename T4> \
    struct get_class_name< className<T1, T2, T3, T4> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T1) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T2) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T3) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T4) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 188 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_5 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T1, typename T2, typename T3, typename T4, typename T5> \
    struct get_class_name< className<T1, T2, T3, T4, T5> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T1) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T2) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T3) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T4) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T5) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 206 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_6 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> \
    struct get_class_name< className<T1, T2, T3, T4, T5, T6> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T1) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T2) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T3) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T4) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T5) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T6) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 225 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_7 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \
    struct get_class_name< className<T1, T2, T3, T4, T5, T6, T7> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T1) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T2) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T3) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T4) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T5) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T6) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T7) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 245 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_8 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \
    struct get_class_name< className<T1, T2, T3, T4, T5, T6, T7, T8> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T1) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T2) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T3) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T4) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T5) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T6) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T7) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T8) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 266 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_9 | ( |  | className | ) |

Value:

    namespace qx { namespace trait { \
    template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> \
    struct get_class_name< className<T1, T2, T3, T4, T5, T6, T7, T8, T9> > \
    { \
       static inline const char * get() \
       { \
          QX_REGISTER_CLASS_NAME_TEMPLATE_INIT(className); \
          result += QX_REGISTER_CLASS_NAME_SEP_INF + QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T1) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T2) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T3) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T4) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T5) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T6) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T7) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T8) + QX_REGISTER_CLASS_NAME_SEP_NXT; \
          result += QX_GET_CLASS_NAME_STD_STR_WITH_TYPENAME(T9) + QX_REGISTER_CLASS_NAME_SEP_SUP; \
          return result.c_str(); \
       } \
       QX_GET_CLASS_NAME_IMPLEMENT_FCT_GET_XML_TAG(); \
    }; \
    } }

Definition at line 288 of file get_class_name.h.

#define QX_REGISTER_CLASS_NAME_TEMPLATE_INIT | ( |  | className | ) |

Value:

    static std::string result; \
    if (! result.empty()) { return result.c_str(); } \
    result = std::string(#className);

Definition at line 121 of file get_class_name.h.

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines