OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
PrimitiveTypes.hpp
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2021 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 #ifndef OMG_DDS_CORE_XTYPES_DETAIL_PRIMITIVE_TYPES_HPP_
21 #define OMG_DDS_CORE_XTYPES_DETAIL_PRIMITIVE_TYPES_HPP_
22 
24 
25 // This template specialization have the intent to provide guidelines
26 // implementors of this specification. Notice that this define only a subset
27 // of primitive types, thus more work for you to do...
28 namespace dds {
29  namespace core {
30  namespace xtypes {
31  // Notice that const char* const is used instead of std::string
32  // to limit initialization issues with ctors.
33  template<>
34  struct dynamic_type_traits<uint8_t> {
35  static const TypeKind TYPE_ID = TypeKind::UINT_8_TYPE;
36  static const char* const NAME; // "uint8_t"
37  };
38 
39  template<>
40  struct dynamic_type_traits<int16_t> {
41  static const TypeKind TYPE_ID = TypeKind::INT_16_TYPE;
42  static const char* const NAME; // "uint16_t"
43  };
44 
45 
46  template<>
47  struct dynamic_type_traits<uint16_t> {
48  static const TypeKind TYPE_ID = TypeKind::UINT_16_TYPE;
49  static const char* const NAME; // "int16_t"
50  };
51 
52  template<>
53  struct dynamic_type_traits<int32_t> {
54  static const TypeKind TYPE_ID = TypeKind::INT_32_TYPE;
55  static const char* const NAME; // "int16_t"
56  };
57 
58  template<>
59  struct dynamic_type_traits<uint32_t> {
60  static const TypeKind TYPE_ID = TypeKind::UINT_32_TYPE;
61  static const char* const NAME; // "uint32_t"
62  };
63 
64  }
65  }
66 }
67 
68 
69 #endif /* OMG_DDS_CORE_XTYPES_DETAIL_PRIMITIVE_TYPES_HPP_ */
Definition: array.hpp:23