Lely core libraries  2.2.5
type.hpp
Go to the documentation of this file.
1 
23 #ifndef LELY_CO_TYPE_HPP_
24 #define LELY_CO_TYPE_HPP_
25 
26 #ifndef __cplusplus
27 #error "include <lely/co/type.h> for the C interface"
28 #endif
29 
30 #include <lely/co/type.h>
31 
32 #include <string>
33 #include <vector>
34 
35 namespace lely {
36 
38 template <co_unsigned16_t N, class T>
41  static const co_unsigned16_t index = N;
43  typedef T type;
44 };
45 
47 template <co_unsigned16_t N>
49 
50 #define LELY_CO_DEFINE_TYPE(a, b, c, d) \
51  template <> \
52  struct co_type_traits_N<CO_DEFTYPE_##a> \
53  : co_type_traits<CO_DEFTYPE_##a, co_##b##_t> {};
54 #include <lely/co/def/type.def>
55 #undef LELY_CO_DEFINE_TYPE
56 
58 template <class T>
60 
61 #define LELY_CO_DEFINE_TYPE(a, b, c, d) \
62  template <> \
63  struct co_type_traits_T<d> : co_type_traits<CO_DEFTYPE_##a, d> {};
64 #include <lely/co/def/cxx.def>
65 #undef LELY_CO_DEFINE_TYPE
66 
67 template <::std::size_t N>
68 struct co_type_traits_T<char[N]>
69  : co_type_traits<CO_DEFTYPE_VISIBLE_STRING, char[N]> {};
70 
71 template <::std::size_t N>
72 struct co_type_traits_T<char16_t[N]>
73  : co_type_traits<CO_DEFTYPE_UNICODE_STRING, char16_t[N]> {};
74 
75 } // namespace lely
76 
77 #endif // !LELY_CO_TYPE_HPP_
A class template mapping CANopen types to C++ types.
Definition: type.hpp:59
static const co_unsigned16_t index
The CANopen object index of the type definition.
Definition: type.hpp:41
A class template mapping CANopen types to C++ types.
Definition: type.hpp:39
T type
The C++ type.
Definition: type.hpp:43
A class template mapping CANopen types to C++ types.
Definition: type.hpp:48
Definition: buf.hpp:32
This header file is part of the CANopen library; it contains the CANopen type definitions.