Lely core libraries 2.3.4
type.hpp
Go to the documentation of this file.
1
23#ifndef LELY_CO_TYPE_HPP_
24#define LELY_CO_TYPE_HPP_
25
26#if !defined(__cplusplus) || LELY_NO_CXX
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
35namespace lely {
36
38template <co_unsigned16_t N, class T>
41 static const co_unsigned16_t index = N;
43 typedef T type;
44};
45
47template <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
58template <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
67template <::std::size_t N>
69 : co_type_traits<CO_DEFTYPE_VISIBLE_STRING, char[N]> {};
70
71template <::std::size_t N>
72struct 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 CANopen value.
Definition val.hpp:42
A class template mapping CANopen types to C++ types.
Definition type.hpp:48
A class template mapping CANopen types to C++ types.
Definition type.hpp:59
A class template mapping CANopen types to C++ types.
Definition type.hpp:39
T type
The C++ type.
Definition type.hpp:43
static const co_unsigned16_t index
The CANopen object index of the type definition.
Definition type.hpp:41
This header file is part of the CANopen library; it contains the CANopen type definitions.