RefleX
Build DDS Applications in Modern C++ without IDL
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
dd_traits.h
Go to the documentation of this file.
1 /*********************************************************************************************
2 (c) 2005-2014 Copyright, Real-Time Innovations, Inc. All rights reserved.
3 RTI grants Licensee a license to use, modify, compile, and create derivative works
4 of the Software. Licensee has the right to distribute object form only for use with RTI
5 products. The Software is provided "as is", with no warranty of any type, including
6 any warranty for fitness for any purpose. RTI is under no obligation to maintain or
7 support the Software. RTI shall not be liable for any incidental or consequential
8 damages arising out of the use or inability to use the software.
9 **********************************************************************************************/
10 
11 #ifndef RTIREFLEX_DD_TRAITS_H
12 #define RTIREFLEX_DD_TRAITS_H
13 
14 #include "ndds/ndds_cpp.h"
15 
16 #define DYNAMIC_DATA_SEQ_TRAITS(BASIC_TYPE,DDS_SEQ_TYPE) \
17 template <> \
18 struct DynamicDataSeqTraits<BASIC_TYPE> { \
19  typedef DDS_SEQ_TYPE type; \
20 };
21 
22 namespace reflex {
23 
24  namespace match {
25  typedef unsigned char octet_t;
26  }
27 
28  namespace detail {
29 
30  template <class T> // when T is an enum
31  struct DynamicDataSeqTraits
32  {
33  typedef DDS_LongSeq type;
34  };
35 
36  DYNAMIC_DATA_SEQ_TRAITS(match::octet_t, DDS_OctetSeq) // also uint8_t
37  DYNAMIC_DATA_SEQ_TRAITS(bool, DDS_BooleanSeq)
38  DYNAMIC_DATA_SEQ_TRAITS(int8_t, DDS_CharSeq)
39  DYNAMIC_DATA_SEQ_TRAITS(char, DDS_CharSeq)
40  DYNAMIC_DATA_SEQ_TRAITS(int16_t, DDS_ShortSeq)
41  DYNAMIC_DATA_SEQ_TRAITS(uint16_t, DDS_UnsignedShortSeq)
42  DYNAMIC_DATA_SEQ_TRAITS(int32_t, DDS_LongSeq)
43  DYNAMIC_DATA_SEQ_TRAITS(uint32_t, DDS_UnsignedLongSeq)
44  DYNAMIC_DATA_SEQ_TRAITS(int64_t, DDS_LongLongSeq)
45  DYNAMIC_DATA_SEQ_TRAITS(uint64_t, DDS_UnsignedLongLongSeq)
46  DYNAMIC_DATA_SEQ_TRAITS(float, DDS_FloatSeq)
47  DYNAMIC_DATA_SEQ_TRAITS(double, DDS_DoubleSeq)
48  DYNAMIC_DATA_SEQ_TRAITS(long double, DDS_LongDoubleSeq)
49 #ifndef RTI_WIN32
50  DYNAMIC_DATA_SEQ_TRAITS(char32_t, DDS_WcharSeq)
51 #endif
52 
53  } // namespace detail
54 
55 } // namespace reflex
56 
57 #undef DYNAMIC_DATA_SEQ_TRAITS
58 
59 #endif // RTIREFLEX_DD_TRAITS_H
60 
unsigned char octet_t
Definition: dd_extra.h:48
#define DYNAMIC_DATA_SEQ_TRAITS(BASIC_TYPE, DDS_SEQ_TYPE)
Definition: dd_traits.h:16