RTI Connext DDS Micro  Version 2.4.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dds_c_type.h
Go to the documentation of this file.
1 /*
2  * FILE: dds_c_type.h - DDS type module
3  *
4  * (c) Copyright, Real-Time Innovations, 2011-2015.
5  *
6  * All rights reserved.
7  *
8  * No duplications, whole or partial, manual or electronic, may be made
9  * without express written permission. Any such copies, or
10  * revisions thereof, must display this notice unaltered.
11  * This code contains trade secrets of Real-Time Innovations, Inc.
12  *
13  * Modification History
14  * --------------------
15  * 25Mar2015,as MICRO-908: Removed unused PluginHelper functions
16  * 19jul2013,as Added support for C++
17  * 11jun2011 Created
18  */
19 /*ce
20  * \file
21  * \brief DDS type module
22  */
23 /*e
24 */
25 #ifndef dds_c_type_h
26 #define dds_c_type_h
27 
28 #ifndef cdr_cdr_type_h
29 #include "cdr/cdr_cdr_type.h"
30 #endif
31 #ifndef cdr_stream_h
32 #include "cdr/cdr_stream.h"
33 #endif
34 #ifndef cdr_encapsulation_h
35 #include "cdr/cdr_encapsulation.h"
36 #endif
37 #ifndef reda_buffer_h
38 #include "reda/reda_buffer.h"
39 #endif
40 #ifndef rtps_rtps_h
41 #include "rtps/rtps_rtps.h"
42 #endif
43 #ifndef dds_c_dll_h
44 #include "dds_c/dds_c_dll.h"
45 #endif
46 #ifndef dds_c_infrastructure_h
48 #endif
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54 
55 /* ================================================================= */
56 /* Type Plugin Interface */
57 /* ================================================================= */
58 /*ce @ingroup DDSMicroTypesModule
59  */
60 
61 /*i \dref_Type
62  */
63 typedef struct DDS_TypeImpl DDS_Type;
64 
65 struct NDDS_Type_Plugin;
66 
67 /*i \dref_UserDataKeyHolder_t
68  */
69 typedef void *UserDataKeyHolder_t;
70 
71 /*i \dref_KeyHash_t
72  */
73 typedef struct RTPS_KeyHash DDS_KeyHash_t;
74 
75 /*i \dref_KeyHash_DEFAULT
76  */
77 #define DDS_KEY_HASH_DEFAULT RTPS_KEY_HASH_DEFAULT
78 
79 /*e \dref_NDDS_Type_PluginVersion
80  */
82 {
83  /*e \dref_NDDS_Type_PluginVersion_majorRev */
84  char majorRev;
85 
86  /*e \dref_NDDS_Type_PluginVersion_minorRev */
87  char minorRev;
89 
90 /*e \dref_NDDS_TypePluginKeyKind
91 */
92 typedef enum
93 {
94  /*e \dref_NDDS_TypePluginKeyKind_TYPEPLUGIN_NO_KEY
95  */
97 
98  /*i \dref_NDDS_TypePluginKeyKind_TYPEPLUGIN_GUID_KEY
99  */
100  NDDS_TYPEPLUGIN_GUID_KEY,
101 
102  /*e \dref_NDDS_TypePluginKeyKind_TYPEPLUGIN_USER_KEY
103  */
106 
107 /*ce \dref_NDDS_Type_GetSerializedSizeFunc
108  */
109 FUNCTION_MUST_TYPEDEF(
110 RTI_UINT32
112  struct NDDS_Type_Plugin *plugin,
113  RTI_UINT32 current_alignment,
114  void *param)
115 )
116 
117 /*ce \dref_NDDS_Type_CreateSampleFunc
118  */
119 FUNCTION_MUST_TYPEDEF(
120 RTI_BOOL
122  struct NDDS_Type_Plugin *plugin,
123  void **sample,
124  void *param)
125 )
126 
127 /*ce \dref_NDDS_Type_DeleteSampleFunc
128  */
129 FUNCTION_MUST_TYPEDEF(
130 RTI_BOOL
132  struct NDDS_Type_Plugin *plugin,
133  void *sample,
134  void *param)
135 )
136 
137 /*ce \dref_NDDS_Type_CopySampleFunc
138  */
139 FUNCTION_MUST_TYPEDEF(
140 RTI_BOOL
142  struct NDDS_Type_Plugin *plugin,
143  void *dst,
144  const void *src,
145  void *param)
146 )
147 
148 /*ce \dref_NDDS_Type_GetKeyKindFunc
149  */
150 FUNCTION_MUST_TYPEDEF(
153  struct NDDS_Type_Plugin *plugin,
154  void *param)
155 )
156 
157 /*ce \dref_NDDS_Type_InstanceToKeyHashFunc
158  */
159 FUNCTION_MUST_TYPEDEF(
160 RTI_BOOL
162  struct NDDS_Type_Plugin *plugin,
163  struct CDR_Stream_t *stream,
164  DDS_KeyHash_t *keyHash,
165  const void *instance,
166  void *param)
167 )
168 
169 /*ce \dref_NDDS_Type_CreateTypedDataWriterFunc
170  */
171 typedef void*
172 (*NDDS_PluginHelper_CreateTypedDataWriterFunc)(void *writer);
173 
174 /*ce \dref_NDDS_Type_DeleteTypedDataWriterFunc
175  */
176 typedef void
178 
179 /*ce \dref_NDDS_Type_CreateTypedDataReaderFunc
180  */
181 typedef void*
182 (*NDDS_PluginHelper_CreateTypedDataReaderFunc)(void *reader);
183 
184 /*ce \dref_NDDS_Type_DeleteTypedDataReaderFunc
185  */
186 typedef void
188 
189 /* **************************** end plugin function prototypes *********** */
190 
191 /* anonymous declaration of TypeCode */
192 struct DDS_TypeCode;
193 
194 /*i \dref_TypeCode_t
195  */
196 typedef struct DDS_TypeCode DDS_TypeCode_t;
197 
198 /*ce \dref_NDDS_Type_Plugin
199  */
201 {
202  /* constants */
203 
204  /*ce \dref_NDDS_Type_Plugin_version
205  */
207 
208  /*ci \dref_NDDS_Type_Plugin_type_code
209  */
210  DDS_TypeCode_t* type_code;
211 
212  /*ci \dref_NDDS_Type_Plugin_encapsulationKind
213  */
214  NDDSCDREncapsulation* encapsulationKind;
215 
216  /*ce \dref_NDDS_Type_Plugin_key_kind
217  */
219 
220  /* function pointers for type specific functions */
221 
222  /*ce \dref_NDDS_Type_Plugin_serialize_data
223  */
224  CDR_Stream_SerializeFunction serialize_data;
225 
226  /*ce \dref_NDDS_Type_Plugin_deserialize_data
227  */
228  CDR_Stream_DeserializeFunction deserialize_data;
229 
230  /*ce \dref_NDDS_Type_Plugin_get_serialized_sample_max_size
231  */
233 
234  /*i \dref_NDDS_Type_Plugin_serialize_key
235  */
236  CDR_Stream_SerializeFunction serialize_key;
237 
238  /*i \dref_NDDS_Type_Plugin_deserialize_key
239  */
240  CDR_Stream_DeserializeFunction deserialize_key;
241 
242  /*ce \dref_NDDS_Type_Plugin_get_serializedKeyMaxSize
243  */
245 
246  /*ce \dref_NDDS_Type_Plugin_create_sample
247  */
249 
250  /*ce \dref_NDDS_Type_Plugin_delete_sample
251  */
253 
254  /*ce \dref_NDDS_Type_Plugin_copy_sample
255  */
257 
258  /*i \dref_NDDS_Type_Plugin_get_key_kind
259  */
261 
262  /*i \dref_NDDS_Type_Plugin_instance_to_keyhash
263  */
264  NDDS_PluginHelper_InstanceToKeyHashFunc instance_to_keyhash;
265 
266  /*i \dref_NDDS_Type_Plugin_create_typed_datawriter
267  */
268  NDDS_PluginHelper_CreateTypedDataWriterFunc create_typed_datawriter;
269 
270  /*i \dref_NDDS_Type_Plugin_delete_typed_datawriter
271  */
272  NDDS_PluginHelper_DeleteTypedDataWriterFunc delete_typed_datawriter;
273 
274  /*i \dref_NDDS_Type_Plugin_create_typed_datareader
275  */
276  NDDS_PluginHelper_CreateTypedDataReaderFunc create_typed_datareader;
277 
278  /*i \dref_NDDS_Type_Plugin_delete_typed_datareader
279  */
280  NDDS_PluginHelper_DeleteTypedDataReaderFunc delete_typed_datareader;
281 
282 };
283 
284 /* ================================================================= */
285 /* Non-Type Specific Type Support Functions */
286 /* ================================================================= */
287 
288 /*ce \dref_PluginHelper_instance_to_keyhash
289  */
290 MUST_CHECK_RETURN DDSCDllExport RTI_BOOL
292  struct CDR_Stream_t *stream,
293  DDS_KeyHash_t *keyHash,
294  const void *instance,
295  void *param);
296 
297 /*ce \dref_PluginHelper_get_key_kind
298  */
299 MUST_CHECK_RETURN DDSCDllExport NDDS_TypePluginKeyKind
300 PluginHelper_get_key_kind(struct NDDS_Type_Plugin *plugin,void *param);
301 
302 #ifdef __cplusplus
303 } /* extern "C" */
304 #endif
305 
306 
307 #endif /* dds_c_type_h */

RTI Connext DDS Micro Version 2.4.10 Copyright © Fri Jun 30 2017 Real-Time Innovations, Inc