RTI Connext Micro  Version 2.4.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
dds_c_data.h
1 /*
2  * FILE: dds_c_data.h - DDS typed interface definitions
3  *
4  * (c) Copyright, Real-Time Innovations, 2012-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  * 21spe2012,eh Written
16  */
17 
18 /*i @file
19  * @ingroup DDSUserDataModule
20  * @brief Defines the \dds user data type support.
21  */
22 
23 #ifndef dds_c_data_h
24 #define dds_c_data_h
25 
26 #ifndef dds_c_common_h
27 #include "dds_c/dds_c_common.h"
28 #endif
29 #ifndef dds_c_infrastructure_h
31 #endif
32 #ifndef dds_c_topic_h
33 #include "dds_c/dds_c_topic.h"
34 #endif
35 #ifndef dds_c_publication_h
37 #endif
38 #ifndef dds_c_subscription_h
40 #endif
41 #ifndef dds_c_domain_h
42 #include "dds_c/dds_c_domain.h"
43 #endif
44 
45 #ifdef __cplusplus
46  extern "C" {
47 #endif
48 
49 /* ================================================================= */
50 /* DATA TYPE */
51 /* ================================================================= */
52 
53 
54 #ifdef DOXYGEN_DOCUMENTATION_ONLY
55 /*i \dref_Foo
56  */
57 struct Foo {
58  RTI_INT32 undocumented_dummy;
59 };
60 #endif
61 
62 
63 #ifndef NDDSUSERDllExport
64 #define NDDSUSERDllExport
65 #endif
66 
67 /*ce \dref_DATAWRITER
68  */
69 #define DDS_DATAWRITER_C(TDataWriter, TData) \
70  typedef struct TDataWriter TDataWriter; \
71  NDDSUSERDllExport DDSCDllExport TDataWriter* TDataWriter ## _narrow( \
72  DDS_DataWriter* writer); \
73  NDDSUSERDllExport DDSCDllExport DDS_DataWriter* TDataWriter ## _as_datawriter( \
74  TDataWriter* writer); \
75  NDDSUSERDllExport DDSCDllExport \
76  DDS_InstanceHandle_t TDataWriter ## _register_instance( \
77  TDataWriter* self, const TData* instance_data); \
78  NDDSUSERDllExport DDSCDllExport \
79  DDS_InstanceHandle_t TDataWriter ## _register_instance_w_timestamp( \
80  TDataWriter* self, const TData* instance_data, \
81  const struct DDS_Time_t* source_timestamp); \
82  NDDSUSERDllExport DDSCDllExport \
83  DDS_ReturnCode_t TDataWriter ## _unregister_instance( \
84  TDataWriter* self, const TData* instance_data, \
85  const DDS_InstanceHandle_t* handle); \
86  NDDSUSERDllExport DDSCDllExport \
87  DDS_ReturnCode_t TDataWriter ## _unregister_instance_w_timestamp( \
88  TDataWriter* self, const TData* instance_data, \
89  const DDS_InstanceHandle_t* handle, \
90  const struct DDS_Time_t* source_timestamp); \
91  NDDSUSERDllExport DDSCDllExport \
92  DDS_ReturnCode_t TDataWriter ## _write( \
93  TDataWriter* self, const TData* instance_data, \
94  const DDS_InstanceHandle_t* handle); \
95  NDDSUSERDllExport DDSCDllExport \
96  DDS_ReturnCode_t TDataWriter ## _write_w_timestamp( \
97  TDataWriter* self, const TData* instance_data, \
98  const DDS_InstanceHandle_t* handle, \
99  const struct DDS_Time_t* source_timestamp); \
100  NDDSUSERDllExport DDSCDllExport \
101  DDS_ReturnCode_t TDataWriter ## _write_w_params( \
102  TDataWriter* self, const TData* instance_data, \
103  struct DDS_WriteParams_t* params); \
104  NDDSUSERDllExport DDSCDllExport \
105  DDS_ReturnCode_t TDataWriter ## _dispose( \
106  TDataWriter* self, const TData* instance_data, \
107  const DDS_InstanceHandle_t* instance_handle); \
108  NDDSUSERDllExport DDSCDllExport \
109  DDS_ReturnCode_t TDataWriter ## _dispose_w_timestamp( \
110  TDataWriter* self, const TData* instance_data, \
111  const DDS_InstanceHandle_t* instance_handle, \
112  const struct DDS_Time_t* source_timestamp)
113 
114 
115 
116 #ifdef DOXYGEN_DOCUMENTATION_ONLY
117 /****************** Typed DataWriter APIs **************************/
118 
119 /* Needed so DOXYGEN generates the hyperlinks to TSeq */
120 typedef TSeq FooSeq;
121 
122 /*ce \dref_FooDataWriter
123  */
124 struct FooDataWriter {};
125 
126 /*ce \dref_FooDataWriter_narrow
127  */
130 
131 /*ce \dref_FooDataWriter_as_datawriter
132  */
135 
136 /*ce \dref_FooDataWriter_register_instance
137  */
140  FooDataWriter * self,
141  const void *instance_data);
142 
143 /*ce \dref_FooDataWriter_register_instance_w_timestamp
144  */
147  FooDataWriter * self,
148  const void *instance_data,
149  const struct DDS_Time_t *source_timestamp);
150 
151 /*ce \dref_FooDataWriter_unregister_instance
152  */
155  FooDataWriter *self,
156  const void *instance_data,
157  const DDS_InstanceHandle_t *handle);
158 
159 /*ce \dref_FooDataWriter_unregister_instance_w_timestamp
160  */
163  FooDataWriter *self,
164  const void *instance_data,
165  const DDS_InstanceHandle_t *handle,
166  const struct DDS_Time_t *source_timestamp);
167 
168 /*ce \dref_FooDataWriter_dispose
169  */
172  FooDataWriter *self,
173  const void *instance_data,
174  const DDS_InstanceHandle_t *handle);
175 
176 /*ce \dref_FooDataWriter_dispose_w_timestamp
177  */
180  FooDataWriter *self,
181  const void *instance_data,
182  const DDS_InstanceHandle_t *handle,
183  const struct DDS_Time_t *source_timestamp);
184 
185 /*ce \dref_FooDataWriter_write
186  */
189  FooDataWriter *self,
190  const void *instance_data,
191  const DDS_InstanceHandle_t * handle);
192 
193 /*ce \dref_FooDataWriter_write_w_timestamp
194  */
197  FooDataWriter *self,
198  const void *instance_data,
199  const DDS_InstanceHandle_t *handle,
200  const struct DDS_Time_t *source_timestamp);
201 
202 /*ce \dref_FooDataWriter_write_w_params
203  */
205 FooDataWriter_write_w_params(
206  FooDataWriter *self,
207  const void *instance_data,
208  struct DDS_WriteParams_t *params);
209 
210 #endif /* DOXYGEN_DOCUMENTATION_ONLY */
211 
212 /* ----------------------------------------------------------------- */
213 
214 /*ce \dref_DATAREADER
215  */
216 #define DDS_DATAREADER_C(TDataReader, TDataSeq, TData) \
217  typedef struct TDataReader TDataReader; \
218  \
219  NDDSUSERDllExport DDSCDllExport TDataReader* TDataReader ## _narrow( \
220  DDS_DataReader* reader); \
221  NDDSUSERDllExport DDSCDllExport DDS_DataReader* TDataReader ## _as_datareader( \
222  TDataReader* reader); \
223  NDDSUSERDllExport DDSCDllExport \
224  DDS_ReturnCode_t TDataReader ## _read(TDataReader* self, \
225  struct TDataSeq* received_data, struct DDS_SampleInfoSeq* info_seq, \
226  DDS_Long max_samples, \
227  DDS_SampleStateMask sample_states, DDS_ViewStateMask view_states, \
228  DDS_InstanceStateMask instance_states); \
229  \
230  NDDSUSERDllExport DDSCDllExport \
231  DDS_ReturnCode_t TDataReader ## _take(TDataReader* self, \
232  struct TDataSeq* received_data, struct DDS_SampleInfoSeq* info_seq, \
233  DDS_Long max_samples, \
234  DDS_SampleStateMask sample_mask, DDS_ViewStateMask view_mask, \
235  DDS_InstanceStateMask instance_mask); \
236  \
237  NDDSUSERDllExport DDSCDllExport \
238  DDS_ReturnCode_t TDataReader ## _read_next_sample( \
239  TDataReader* self, TData* received_data, \
240  struct DDS_SampleInfo* sample_info); \
241  \
242  NDDSUSERDllExport DDSCDllExport \
243  DDS_ReturnCode_t TDataReader ## _take_next_sample( \
244  TDataReader* self, TData* received_data, \
245  struct DDS_SampleInfo* sample_info); \
246  \
247  NDDSUSERDllExport DDSCDllExport \
248  DDS_ReturnCode_t TDataReader ## _read_instance( \
249  TDataReader* self, \
250  struct TDataSeq* received_data, struct DDS_SampleInfoSeq* info_seq, \
251  DDS_Long max_samples, \
252  const DDS_InstanceHandle_t* a_handle, \
253  DDS_SampleStateMask sample_states, DDS_ViewStateMask view_states, \
254  DDS_InstanceStateMask instance_states); \
255  \
256  NDDSUSERDllExport DDSCDllExport \
257  DDS_ReturnCode_t TDataReader ## _take_instance( \
258  TDataReader* self, \
259  struct TDataSeq* received_data, struct DDS_SampleInfoSeq* info_seq, \
260  DDS_Long max_samples, \
261  const DDS_InstanceHandle_t* a_handle, \
262  DDS_SampleStateMask sample_states, DDS_ViewStateMask view_states, \
263  DDS_InstanceStateMask instance_states); \
264  \
265  NDDSUSERDllExport DDSCDllExport \
266  DDS_ReturnCode_t TDataReader ## _return_loan( \
267  TDataReader* self, \
268  struct TDataSeq* received_data, struct DDS_SampleInfoSeq* info_seq); \
269  \
270  NDDSUSERDllExport DDSCDllExport \
271  DDS_InstanceHandle_t TDataReader ## _lookup_instance( \
272  TDataReader* self, \
273  const TData* key_holder)
274 
275 
276 #ifdef DOXYGEN_DOCUMENTATION_ONLY
277 
278 /*ce \dref_FooDataReader
279  */
280 struct FooDataReader {};
281 
282 /*ce \dref_FooDataReader_narrow
283  */
286 
287 /*ce \dref_FooDataReader_as_datareader
288  */
291 
292 /*ce \dref_FooDataReader_read
293  */
296  struct FooSeq* received_data,
297  struct DDS_SampleInfoSeq* info_seq,
298  DDS_Long max_samples,
299  DDS_SampleStateMask sample_states,
300  DDS_ViewStateMask view_states,
301  DDS_InstanceStateMask instance_states);
302 
303 /*ce \dref_FooDataReader_take
304  */
307  struct FooSeq* received_data,
308  struct DDS_SampleInfoSeq* info_seq,
309  DDS_Long max_samples,
310  DDS_SampleStateMask sample_states,
311  DDS_ViewStateMask view_states,
312  DDS_InstanceStateMask instance_states);
313 
314 /*ce \dref_FooDataReader_read_next_sample
315  */
318  struct Foo* received_data,
319  struct DDS_SampleInfo* sample_info);
320 
321 /*ce \dref_FooDataReader_take_next_sample
322  */
325  struct Foo* received_data,
326  struct DDS_SampleInfo* sample_info);
327 
328 /*ce \dref_FooDataReader_read_instance
329  */
332  struct FooSeq* received_data,
333  struct DDS_SampleInfoSeq* info_seq,
334  DDS_Long max_samples,
335  const DDS_InstanceHandle_t* a_handle,
336  DDS_SampleStateMask sample_states,
337  DDS_ViewStateMask view_states,
338  DDS_InstanceStateMask instance_states);
339 
340 /*ce \dref_FooDataReader_take_instance
341  */
344  struct FooSeq* received_data,
345  struct DDS_SampleInfoSeq* info_seq,
346  DDS_Long max_samples,
347  const DDS_InstanceHandle_t* a_handle,
348  DDS_SampleStateMask sample_states,
349  DDS_ViewStateMask view_states,
350  DDS_InstanceStateMask instance_states);
351 
352 /*ce \dref_FooDataReader_return_loan
353  */
356  FooSeq* received_data,
357  struct DDS_SampleInfoSeq* info_seq);
358 
359 /*ce \dref_FooDataReader_lookup_instance
360  */
363  const Foo* key_holder);
364 
365 #endif /* DOXYGEN_DOCUMENTATION_ONLY */
366 
367 
368 #ifdef __cplusplus
369  } /* extern "C" */
370 #endif
371 
372 #endif /* dds_c_data_h */

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