summaryrefslogtreecommitdiff
path: root/src/bindings/cxx/eet_cxx/eet_type.hh
blob: e12bc982cf7d77aa2c047b27618348f8aaf10e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef _EET_TYPE_HH
#define _EET_TYPE_HH

#include <Eet.h>
#include <Eina.hh>

#include <type_traits>

namespace efl { namespace eet {

template <typename T>
struct _eet_type;

template <>
struct _eet_type<char> : std::integral_constant<int, EET_T_CHAR>
{};

template <>
struct _eet_type<short> : std::integral_constant<int, EET_T_SHORT>
{};

template <>
struct _eet_type<int> : std::integral_constant<int, EET_T_INT>
{};

template <>
struct _eet_type<long long> : std::integral_constant<int, EET_T_LONG_LONG>
{};

template <>
struct _eet_type<float> : std::integral_constant<int, EET_T_FLOAT>
{};

template <>
struct _eet_type<double> : std::integral_constant<int, EET_T_DOUBLE>
{};

template <>
struct _eet_type<unsigned char> : std::integral_constant<int, EET_T_UCHAR>
{};

template <>
struct _eet_type<unsigned short> : std::integral_constant<int, EET_T_USHORT>
{};

template <>
struct _eet_type<unsigned int> : std::integral_constant<int, EET_T_UINT>
{};

template <>
struct _eet_type<unsigned long long> : std::integral_constant<int, EET_T_ULONG_LONG>
{};

template <>
struct _eet_type<char*> : std::integral_constant<int, EET_T_STRING>
{};

template <>
struct _eet_type<void*> : std::integral_constant<int, EET_T_NULL>
{};

template <>
struct _eet_type<eina::value> : std::integral_constant<int, EET_T_VALUE>
{};

template <typename T>
struct _void { typedef void type; };

template <typename T, typename Enabler = void>
struct is_eet_primitive : std::false_type {};

template <typename T>
struct is_eet_primitive<T, typename _void<typename _eet_type<T>::type>::type>
  : std::true_type {};

} }

#endif