| 1 |
#ifndef QQMLHELPERSCOMMON_H |
| 2 |
#define QQMLHELPERSCOMMON_H |
| 3 |
|
| 4 |
#include <QtGlobal> |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
template<typename T> struct CheapestType { typedef const T & type_def; }; |
| 9 |
template<> struct CheapestType<bool> { typedef bool type_def; }; |
| 10 |
template<> struct CheapestType<quint8> { typedef quint8 type_def; }; |
| 11 |
template<> struct CheapestType<quint16> { typedef quint16 type_def; }; |
| 12 |
template<> struct CheapestType<quint32> { typedef quint32 type_def; }; |
| 13 |
template<> struct CheapestType<quint64> { typedef quint64 type_def; }; |
| 14 |
template<> struct CheapestType<qint8> { typedef qint8 type_def; }; |
| 15 |
template<> struct CheapestType<qint16> { typedef qint16 type_def; }; |
| 16 |
template<> struct CheapestType<qint32> { typedef qint32 type_def; }; |
| 17 |
template<> struct CheapestType<qint64> { typedef qint64 type_def; }; |
| 18 |
template<> struct CheapestType<float> { typedef float type_def; }; |
| 19 |
template<> struct CheapestType<double> { typedef double type_def; }; |
| 20 |
template<typename T> struct CheapestType<T *> { typedef T * type_def; }; |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#ifdef QTQMLTRICKS_NO_PREFIX_ON_GETTERS |
| 25 |
# define MAKE_GETTER_NAME(name) name |
| 26 |
#else |
| 27 |
# define MAKE_GETTER_NAME(name) get_##name |
| 28 |
#endif |
| 29 |
|
| 30 |
#endif |