RTI Connext Micro  Version 2.4.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
dds_c_tdatareader_gen.h
1 /*
2  * FILE: dds_c_tdatareader_gen.h - DDS typed datareader template
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  * 06jun2014,as Added compiler error on incorrect use of template header;
16  * source files do not need to undefine dds_c_tdatareader_gen_h
17  * before including this header.
18  * 16sep2012,eh Created
19  */
20 /*ci
21  * \file
22  * \brief DDS subscription module
23  * @ingroup DDSSubscriptionModule
24  */
25 #ifndef dds_c_tdatareader_gen_h
26 #define dds_c_tdatareader_gen_h
27 
28 #ifndef dds_c_common_h
29 #include "dds_c/dds_c_common.h"
30 #endif
31 #ifndef dds_c_infrastructure_h
33 #endif
34 #ifndef dds_c_subscription_h
36 #endif
37 
38 
39 /*** SOURCE_BEGIN ***/
40 
41 #if defined(TDataReader) && defined(TDataSeq ) && defined(TData)
42 
43 #define concatenate(A, B) A ## B
44 
45 #define TDataReader_narrow_c(TDataReader) concatenate(TDataReader, _narrow)
46 #define TDataReader_narrow TDataReader_narrow_c(TDataReader)
47 
48 #define TDataReader_as_datareader_c(TDataReader) concatenate(TDataReader, _as_datareader)
49 #define TDataReader_as_datareader TDataReader_as_datareader_c(TDataReader)
50 
51 #define TDataReader_read_c(TDataReader) concatenate(TDataReader, _read)
52 #define TDataReader_read TDataReader_read_c(TDataReader)
53 
54 #define TDataReader_take_c(TDataReader) concatenate(TDataReader, _take)
55 #define TDataReader_take TDataReader_take_c(TDataReader)
56 
57 #define TDataReader_read_next_sample_c(TDataReader) concatenate(TDataReader, _read_next_sample)
58 #define TDataReader_read_next_sample TDataReader_read_next_sample_c(TDataReader)
59 
60 #define TDataReader_take_next_sample_c(TDataReader) concatenate(TDataReader, _take_next_sample)
61 #define TDataReader_take_next_sample TDataReader_take_next_sample_c(TDataReader)
62 
63 #define TDataReader_read_instance_c(TDataReader) concatenate(TDataReader, _read_instance)
64 #define TDataReader_read_instance TDataReader_read_instance_c(TDataReader)
65 
66 #define TDataReader_take_instance_c(TDataReader) concatenate(TDataReader, _take_instance)
67 #define TDataReader_take_instance TDataReader_take_instance_c(TDataReader)
68 
69 #define TDataReader_return_loan_c(TDataReader) concatenate(TDataReader, _return_loan)
70 #define TDataReader_return_loan TDataReader_return_loan_c(TDataReader)
71 
72 #define TDataReader_lookup_instance_c(TDataReader) concatenate(TDataReader, _lookup_instance)
73 #define TDataReader_lookup_instance TDataReader_lookup_instance_c(TDataReader)
74 
75 /* ---------------------------------------------------------------------
76  Public Methods
77  --------------------------------------------------------------------- */
78 
79 TDataReader*
80 TDataReader_narrow(DDS_DataReader* reader)
81 {
82  return (TDataReader *)reader;
83 }
84 
86 TDataReader_as_datareader(TDataReader* reader)
87 {
88  return (DDS_DataReader *)reader;
89 }
90 
92 TDataReader_read(TDataReader* self,
93  struct TDataSeq * received_data,
94  struct DDS_SampleInfoSeq* info_seq,
95  DDS_Long max_samples,
96  DDS_SampleStateMask sample_states,
97  DDS_ViewStateMask view_states,
98  DDS_InstanceStateMask instance_states)
99 {
100  return DDS_DataReader_read((DDS_DataReader *)self,
101  (struct DDS_UntypedSampleSeq *)received_data,
102  info_seq, max_samples,
103  sample_states, view_states, instance_states);
104 }
105 
107 TDataReader_take(TDataReader* self,
108  struct TDataSeq * received_data,
109  struct DDS_SampleInfoSeq* info_seq,
110  DDS_Long max_samples,
111  DDS_SampleStateMask sample_states,
112  DDS_ViewStateMask view_states,
113  DDS_InstanceStateMask instance_states)
114 {
115  return DDS_DataReader_take((DDS_DataReader *)self,
116  (struct DDS_UntypedSampleSeq *)received_data,
117  info_seq, max_samples,
118  sample_states, view_states, instance_states);
119 }
120 
122 TDataReader_read_next_sample(TDataReader* self,
123  TData* received_data,
124  struct DDS_SampleInfo* sample_info)
125 {
127  received_data, sample_info);
128 }
129 
131 TDataReader_take_next_sample(TDataReader* self,
132  TData* received_data,
133  struct DDS_SampleInfo* sample_info)
134 {
136  received_data, sample_info);
137 }
138 
140 TDataReader_read_instance(TDataReader* self,
141  struct TDataSeq * received_data,
142  struct DDS_SampleInfoSeq* info_seq,
143  DDS_Long max_samples,
144  const DDS_InstanceHandle_t* a_handle,
145  DDS_SampleStateMask sample_states,
146  DDS_ViewStateMask view_states,
147  DDS_InstanceStateMask instance_states)
148 {
150  (struct DDS_UntypedSampleSeq *)received_data,
151  info_seq, max_samples, a_handle,
152  sample_states, view_states, instance_states);
153 }
154 
156 TDataReader_take_instance(TDataReader* self,
157  struct TDataSeq * received_data,
158  struct DDS_SampleInfoSeq* info_seq,
159  DDS_Long max_samples,
160  const DDS_InstanceHandle_t* a_handle,
161  DDS_SampleStateMask sample_states,
162  DDS_ViewStateMask view_states,
163  DDS_InstanceStateMask instance_states)
164 {
166  (struct DDS_UntypedSampleSeq *)received_data,
167  info_seq, max_samples, a_handle,
168  sample_states, view_states, instance_states);
169 }
170 
172 TDataReader_return_loan(TDataReader* self,
173  struct TDataSeq * received_data,
174  struct DDS_SampleInfoSeq* info_seq)
175 {
177  (struct DDS_UntypedSampleSeq *)received_data,
178  info_seq);
179 }
180 
182 TDataReader_lookup_instance(TDataReader* self,
183  const TData *key_holder)
184 {
186  (const void *)key_holder);
187 }
188 
189 #undef concatenate
190 
191 #undef TDataReader_narrow_c
192 #undef TDataReader_narrow
193 
194 #undef TDataReader_as_datareader_c
195 #undef TDataReader_as_datareader
196 
197 #undef TDataReader_read_c
198 #undef TDataReader_read
199 
200 #undef TDataReader_take_c
201 #undef TDataReader_take
202 
203 #undef TDataReader_read_next_sample_c
204 #undef TDataReader_read_next_sample
205 
206 #undef TDataReader_take_next_sample_c
207 #undef TDataReader_take_next_sample
208 
209 #undef TDataReader_read_instance_c
210 #undef TDataReader_read_instance
211 
212 #undef TDataReader_take_instance_c
213 #undef TDataReader_take_instance
214 
215 #undef TDataReader_return_loan_c
216 #undef TDataReader_return_loan
217 
218 #undef TDataReader_lookup_instance_c
219 #undef TDataReader_lookup_instance
220 
221 #else
222 #error "Incorrect use of dds_c_tdatareader_gen.h: TDataReader, TData, and TDataSeq must be defined"
223 #endif /* defined(TDataReader) && defined(TDataSeq ) && defined(TData) */
224 
225 #undef dds_c_tdatareader_gen_h
226 
227 #endif /* dds_c_tdatareader_gen_h */

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