RTI Connext Micro  Version 2.4.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
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-2014.
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  * 19jul2013,as Added support for C++
16  * 11jun2011 Created
17  */
18 /*ce
19  * \file
20  * \brief DDS type module
21  */
22 /*e
23 */
24 #ifndef dds_c_type_h
25 #define dds_c_type_h
26 
27 #ifndef cdr_cdr_type_h
28 #include "cdr/cdr_cdr_type.h"
29 #endif
30 #ifndef cdr_stream_h
31 #include "cdr/cdr_stream.h"
32 #endif
33 #ifndef cdr_encapsulation_h
34 #include "cdr/cdr_encapsulation.h"
35 #endif
36 #ifndef reda_buffer_h
37 #include "reda/reda_buffer.h"
38 #endif
39 #ifndef rtps_rtps_h
40 #include "rtps/rtps_rtps.h"
41 #endif
42 #ifndef dds_c_dll_h
43 #include "dds_c/dds_c_dll.h"
44 #endif
45 #ifndef dds_c_infrastructure_h
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 /* ================================================================= */
55 /* Type Plugin Interface */
56 /* ================================================================= */
57 /*ce @ingroup DDSMicroTypesModule
58  */
59 
60 /*i \dref_Type
61  */
62 typedef struct DDS_TypeImpl DDS_Type;
63 
64 struct NDDS_Type_Plugin;
65 
66 /*i \dref_UserDataKeyHolder_t
67  */
68 typedef void *UserDataKeyHolder_t;
69 
70 /*i \dref_KeyHash_t
71  */
72 typedef struct RTPS_KeyHash DDS_KeyHash_t;
73 
74 /*e \dref_NDDS_Type_PluginVersion
75  */
77 {
78  /*e \dref_NDDS_Type_PluginVersion_majorRev */
79  char majorRev;
80  /*e \dref_NDDS_Type_PluginVersion_minorRev */
81  char minorRev;
83 
84 /*e \dref_NDDS_TypePluginKeyKind
85 */
86 typedef enum
87 {
88  /*e \dref_NDDS_TypePluginKeyKind_TYPEPLUGIN_NO_KEY
89  */
91 
92  /*i \dref_NDDS_TypePluginKeyKind_TYPEPLUGIN_GUID_KEY
93  */
94  NDDS_TYPEPLUGIN_GUID_KEY,
95 
96  /*e \dref_NDDS_TypePluginKeyKind_TYPEPLUGIN_USER_KEY
97  */
100 
101 /*ce \dref_NDDS_Type_GetSerializedSizeFunc
102  */
103 FUNCTION_MUST_TYPEDEF(
104 RTI_UINT32
106  struct NDDS_Type_Plugin *plugin,
107  RTI_UINT32 current_alignment,
108  void *param)
109 )
110 
111 /*ce \dref_NDDS_Type_CreateSampleFunc
112  */
113 FUNCTION_MUST_TYPEDEF(
114 RTI_BOOL
116  struct NDDS_Type_Plugin *plugin,
117  void **sample,
118  void *param)
119 )
120 
121 /*ce \dref_NDDS_Type_DeleteSampleFunc
122  */
123 FUNCTION_MUST_TYPEDEF(
124 RTI_BOOL
126  struct NDDS_Type_Plugin *plugin,
127  void *sample,
128  void *param)
129 )
130 
131 /*ce \dref_NDDS_Type_CopySampleFunc
132  */
133 FUNCTION_MUST_TYPEDEF(
134 RTI_BOOL
136  struct NDDS_Type_Plugin *plugin,
137  void *dst,
138  const void *src,
139  void *param)
140 )
141 
142 /*ce \dref_NDDS_Type_GetSampleFunc
143  */
144 FUNCTION_MUST_TYPEDEF(
145 RTI_BOOL
147  struct NDDS_Type_Plugin *plugin,
148  void **sample,
149  void *param)
150 )
151 
152 /*ce \dref_NDDS_Type_ReturnSampleFunc
153  */
154 FUNCTION_MUST_TYPEDEF(
155 RTI_BOOL
157  struct NDDS_Type_Plugin *plugin,
158  void *sample,
159  void *param)
160 )
161 
162 /*ce \dref_NDDS_Type_GetStreamBufferFunc
163  */
164 FUNCTION_MUST_TYPEDEF(
165 RTI_BOOL
167  struct NDDS_Type_Plugin *plugin,
168  struct REDA_Buffer **stream_buffer,
169  void *param)
170 )
171 
172 /*ce \dref_NDDS_Type_ReturnStreamBufferFunc
173  */
174 FUNCTION_MUST_TYPEDEF(
175 RTI_BOOL
177  struct NDDS_Type_Plugin *plugin,
178  struct REDA_Buffer *stream_buffer,
179  void *param)
180 )
181 
182 
183 /*ce \dref_NDDS_PluginHelper_OnParticipantAttachedFunc
184  */
185 FUNCTION_MUST_TYPEDEF(
186 RTI_BOOL
188  struct NDDS_Type_Plugin *plugin,
189  void *param)
190 )
191 
192 /*ce \dref_NDDS_PluginHelper_OnParticipantDetachedFunc
193  */
194 FUNCTION_MUST_TYPEDEF(
195 RTI_BOOL
197  struct NDDS_Type_Plugin *plugin,
198  void *param)
199 )
200 
201 /*ce \dref_NDDS_PluginHelper_OnEndpointAttachedFunc
202  */
203 FUNCTION_MUST_TYPEDEF(
204 RTI_BOOL
206  struct NDDS_Type_Plugin *plugin,
207  void *param)
208 )
209 
210 /*ce \dref_NDDS_PluginHelper_OnEndpointDetachedFunc
211  */
212 FUNCTION_MUST_TYPEDEF(
213 RTI_BOOL
215  struct NDDS_Type_Plugin *plugin,
216  void *param)
217 )
218 
219 /*ce \dref_NDDS_Type_GetKeyKindFunc
220  */
221 FUNCTION_MUST_TYPEDEF(
224  struct NDDS_Type_Plugin *plugin,
225  void *param)
226 )
227 
228 /*ce \dref_NDDS_Type_InstanceToKeyHashFunc
229  */
230 FUNCTION_MUST_TYPEDEF(
231 RTI_BOOL
233  struct NDDS_Type_Plugin *plugin,
234  struct CDR_Stream_t *stream,
235  DDS_KeyHash_t *keyHash,
236  const void *instance,
237  void *param)
238 )
239 
240 /*ce \dref_NDDS_Type_CreateTypedDataWriterFunc
241  */
242 typedef void*
243 (*NDDS_PluginHelper_CreateTypedDataWriterFunc)(
244  void *writer);
245 
246 /*ce \dref_NDDS_Type_DeleteTypedDataWriterFunc
247  */
248 typedef void
250  void *wrapper);
251 
252 /*ce \dref_NDDS_Type_CreateTypedDataReaderFunc
253  */
254 typedef void*
255 (*NDDS_PluginHelper_CreateTypedDataReaderFunc)(
256  void *reader);
257 
258 /*ce \dref_NDDS_Type_DeleteTypedDataReaderFunc
259  */
260 typedef void
262  void *wrapper);
263 
264 /* **************************** end plugin function prototypes *********** */
265 
266 /* anonymous declaration of TypeCode */
267 struct DDS_TypeCode;
268 
269 /*i \dref_TypeCode_t
270  */
271 typedef struct DDS_TypeCode DDS_TypeCode_t;
272 
273 /*ce \dref_NDDS_Type_Plugin
274  */
276 {
277  /* constants */
278 
279  /*ce \dref_NDDS_Type_Plugin_version
280  */
282 
283  /*ci \dref_NDDS_Type_Plugin_type_code
284  */
285  DDS_TypeCode_t* type_code;
286 
287  /*ci \dref_NDDS_Type_Plugin_encapsulationKind
288  */
289  NDDSCDREncapsulation* encapsulationKind;
290 
291  /*ce \dref_NDDS_Type_Plugin_key_kind
292  */
294 
295  /* function pointers for type specific functions */
296 
297  /*ce \dref_NDDS_Type_Plugin_serialize_data
298  */
299  CDR_Stream_SerializeFunction serialize_data;
300 
301  /*ce \dref_NDDS_Type_Plugin_deserialize_data
302  */
303  CDR_Stream_DeserializeFunction deserialize_data;
304 
305  /*ce \dref_NDDS_Type_Plugin_get_serialized_sample_max_size
306  */
308 
309  /*i \dref_NDDS_Type_Plugin_serialize_key
310  */
311  CDR_Stream_SerializeFunction serialize_key;
312 
313  /*i \dref_NDDS_Type_Plugin_deserialize_key
314  */
315  CDR_Stream_DeserializeFunction deserialize_key;
316 
317  /*ce \dref_NDDS_Type_Plugin_get_serializedKeyMaxSize
318  */
320 
321  /*ce \dref_NDDS_Type_Plugin_create_sample
322  */
324 
325  /*ce \dref_NDDS_Type_Plugin_delete_sample
326  */
328 
329  /*ce \dref_NDDS_Type_Plugin_copy_sample
330  */
332 
333  /*ce \dref_NDDS_Type_Plugin_get_sample
334  */
336 
337  /*ce \dref_NDDS_Type_Plugin_return_sample
338  */
340 
341  /*ce \dref_NDDS_Type_Plugin_get_buffer
342  */
344 
345  /*ce \dref_NDDS_Type_Plugin_return_buffer
346  */
348 
349  /* function pointers for common replaceable components */
350 
351  /*i \dref_NDDS_Type_Plugin_on_participant_attached
352  */
353  NDDS_PluginHelper_OnParticipantAttachedFunc on_participant_attached;
354 
355  /*i \dref_NDDS_Type_Plugin_on_participant_detached
356  */
357  NDDS_PluginHelper_OnParticipantDetachedFunc on_participant_detached;
358 
359  /*i \dref_NDDS_Type_Plugin_on_endpoint_attached
360  */
361  NDDS_PluginHelper_OnEndpointAttachedFunc on_endpoint_attached;
362 
363  /*i \dref_NDDS_Type_Plugin_on_endpoint_detached
364  */
365  NDDS_PluginHelper_OnEndpointDetachedFunc on_endpoint_detached;
366 
367  /*i \dref_NDDS_Type_Plugin_get_key_kind
368  */
370 
371  /*i \dref_NDDS_Type_Plugin_instance_to_keyhash
372  */
373  NDDS_PluginHelper_InstanceToKeyHashFunc instance_to_keyhash;
374 
375  /*i \dref_NDDS_Type_Plugin_create_typed_datawriter
376  */
377  NDDS_PluginHelper_CreateTypedDataWriterFunc create_typed_datawriter;
378 
379  /*i \dref_NDDS_Type_Plugin_delete_typed_datawriter
380  */
381  NDDS_PluginHelper_DeleteTypedDataWriterFunc delete_typed_datawriter;
382 
383  /*i \dref_NDDS_Type_Plugin_create_typed_datareader
384  */
385  NDDS_PluginHelper_CreateTypedDataReaderFunc create_typed_datareader;
386 
387  /*i \dref_NDDS_Type_Plugin_delete_typed_datareader
388  */
389  NDDS_PluginHelper_DeleteTypedDataReaderFunc delete_typed_datareader;
390 
391 };
392 
393 /* ================================================================= */
394 /* Non-Type Specific Type Support Functions */
395 /* ================================================================= */
396 
397 /*ce \dref_PluginHelper_get_sample
398  */
399 MUST_CHECK_RETURN DDSCDllExport RTI_BOOL
401  void **sample,void *param);
402 
403 /*ce \dref_PluginHelper_return_sample
404  */
405 SHOULD_CHECK_RETURN DDSCDllExport RTI_BOOL
407  void *sample,void *param);
408 
409 /*ce \dref_PluginHelper_get_buffer
410  */
411 MUST_CHECK_RETURN DDSCDllExport RTI_BOOL
413  struct REDA_Buffer **stream_buffer,
414  void *param);
415 
416 /*ce \dref_PluginHelper_return_buffer
417  */
418 SHOULD_CHECK_RETURN DDSCDllExport RTI_BOOL
420  struct REDA_Buffer *stream_buffer,
421  void *param);
422 
423 /*ce \dref_PluginHelper_on_participant_attached
424  */
425 MUST_CHECK_RETURN DDSCDllExport RTI_BOOL
426 PluginHelper_on_participant_attached(struct NDDS_Type_Plugin *plugin,void *param);
427 
428 /*ce \dref_PluginHelper_on_participant_detached
429  */
430 MUST_CHECK_RETURN DDSCDllExport RTI_BOOL
431 PluginHelper_on_participant_detached(struct NDDS_Type_Plugin *plugin,void *param);
432 
433 /*ce \dref_PluginHelper_on_endpoint_attached
434  */
435 MUST_CHECK_RETURN DDSCDllExport RTI_BOOL
436 PluginHelper_on_endpoint_attached(struct NDDS_Type_Plugin *plugin,void *param);
437 
438 /*ce \dref_PluginHelper_on_endpoint_detached
439  */
440 MUST_CHECK_RETURN DDSCDllExport RTI_BOOL
441 PluginHelper_on_endpoint_detached(struct NDDS_Type_Plugin *plugin,void *param);
442 
443 /*ce \dref_PluginHelper_instance_to_keyhash
444  */
445 MUST_CHECK_RETURN DDSCDllExport RTI_BOOL
447  struct CDR_Stream_t *stream,
448  DDS_KeyHash_t *keyHash,
449  const void *instance,
450  void *param);
451 
452 /*ce \dref_PluginHelper_get_key_kind
453  */
454 MUST_CHECK_RETURN DDSCDllExport NDDS_TypePluginKeyKind
455 PluginHelper_get_key_kind(struct NDDS_Type_Plugin *plugin,void *param);
456 
457 #ifdef __cplusplus
458 } /* extern "C" */
459 #endif
460 
461 
462 #endif /* dds_c_type_h */

RTI Connext Micro Version 2.4.1.0 Copyright © Thu Nov 20 2014 Real-Time Innovations, Inc