1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
// $Id$
#ifndef CCM_DDS_PSAT_IDL
#define CCM_DDS_PSAT_IDL
#pragma dds4ccm impl "DDS_PSAT_Connector_T.h"
#if defined (__TAO_IDL)
#include <ccm_dds.idl>
#endif
/**
* @namespace CCM_DDS_PSAT
*
* Module containing all @ref PSAT related entities. Non-typed constructs are
* directly defined in this module, while typed constructs are in a templated
* sub-module.
*/
module CCM_DDS_PSAT
{
// ---------------------------
// Enums, structs and Typedefs
// ---------------------------
const long FIXED_STRING_SIZE = 50;
typedef char FixedString[FIXED_STRING_SIZE];
typedef sequence<string> StrSeq;
enum EndianType
{
PSAT_AD_LITTLE_ENDIAN,
PSAT_AD_BIG_ENDIAN
};
struct DataShape
{
long long num_blocks;
long long block_length;
long long stride;
};
struct SubscriberSideInfo
{
long long transferred_length;
long long sample_incomplete_deadline_usec;
boolean deliver_sample;
long long destination_offset;
};
struct ConnectorPrivateInfo
{
FixedString publisher_connector_id;
long long internal_buffer_id;
};
struct PSAT_Header
{
long long sample_start_address;
long long ad_buffer_id;
long long source_offset;
DataShape psat_view;
EndianType source_endian;
boolean sample_complete;
SubscriberSideInfo subscriber_side_info;
ConnectorPrivateInfo connector_only_info;
};
struct BasicUDM
{
PSAT_Header psatHeader;
};
struct AsynchErrorInfo
{
string get_rid_of_this; // TEMPORARY FIELD SO THE STRUCT COMPILES
};
struct SharedMemoryConfig
{
string name;
long long size;
long long alignment;
};
struct BufferPoolConfig
{
long long buffer_start_offset;
long long num_buffers;
long long buffer_size;
};
struct TransportConfig
{
StrSeq allowed_interfaces;
StrSeq denied_interfaces;
StrSeq transport_preference;
};
// ----------
// Exceptions
// ----------
exception SharedMemoryInitError
{
string explanation;
};
exception InvalidConnectorAttributes
{
string explanation;
};
exception NoAvailableAD_Buffer
{
string explanation;
};
exception InvalidAD_BufferState
{
string explanation;
};
exception InvalidUDM
{
string explanation;
};
exception UnsucessfulFlush
{
string explanation;
};
module Typed_PSAT<typename T, sequence<T> TSeq>
{
alias CCM_DDS::Typed<T, TSeq> DDS_Typed;
typedef DDS_Typed::DataReader DataReader;
typedef DDS_Typed::DataWriter DataWriter;
local interface PSAT_BufferControl
{
void release_buffer(in T datum)
raises(InvalidAD_BufferState, InvalidUDM);
void flush() raises(UnsucessfulFlush);
};
local interface PSAT_Writer : PSAT_BufferControl
{
void create_data(out T datum)
raises(CCM_DDS::InternalError, NoAvailableAD_Buffer);
void create_data_override(out T datum)
raises(CCM_DDS::InternalError);
void create_data_w_existing(in T existing_datum, out T datum)
raises(CCM_DDS::InternalError, InvalidAD_BufferState);
void notify_on_buffer_available(in long long timeoutUsec);
void write_one(in T datum)
raises(CCM_DDS::InternalError, InvalidUDM);
};
local interface PSAT_WriterStatusListener
{
void on_buffer_available();
void on_buffer_wait_timeout();
};
local interface PSAT_Interceptor
{
void on_metadata_intercept(inout T datum);
};
local interface PSAT_ReaderStatusListener : CCM_DDS::PortStatusListener
{
void on_copy_unsupported(in T datum, in AsynchErrorInfo info);
void on_data_corruption(in T datum, in AsynchErrorInfo info);
void on_incomplete_transfer(in T datum, in AsynchErrorInfo info);
void on_invalid_UDM(in T datum, in AsynchErrorInfo info);
};
// --------------
// DDS PSAT Ports
// --------------
porttype DDS_PSAT_Write
{
uses PSAT_Writer data;
uses DDS::DataWriter dds_entity;
provides PSAT_WriterStatusListener status;
};
porttype DDS_PSAT_Listen
{
uses DDS_Typed::Reader data;
provides DDS_Typed::Listener data_listener;
uses CCM_DDS::DataListenerControl data_control;
provides PSAT_ReaderStatusListener status;
uses DDS::DataReader dds_entity;
provides PSAT_Interceptor interceptor;
uses PSAT_BufferControl buffer_control;
};
// ------------------
// DDS PSAT Connector
// ------------------
connector DDS_PSAT_Event : CCM_DDS::DDS_TopicBase
{
mirrorport DDS_PSAT_Write supplier;
mirrorport DDS_PSAT_Listen consumer;
attribute SharedMemoryConfig shared_memory_config
setraises(CCM_DDS::NonChangeable);
attribute BufferPoolConfig attach_buffer_config
setraises(CCM_DDS::NonChangeable);
attribute TransportConfig transports_config
setraises(CCM_DDS::NonChangeable);
};
};
};
#endif // CCM_DDS_PSAT_IDL
|