summaryrefslogtreecommitdiff
path: root/TAO/tao/RTCORBA/RTCORBA.pidl
blob: 47554523c2d1a14cc391b25eb45c4ade70ce8ac4 (plain)
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
/**
 * @file RTCORBA.pidl
 *
 * $Id$
 *
 * @brief Pre-compiled IDL source for the RTCORBA module.
 *
 * The RTCORBA module specified in CORBA v2.4.2 Chapter 24 (February,
 * 2001).
 *
 * Changes to the original OMG idl:
 *
 *     1.  Two TAO-specific interfaces, UnixDomainProtocolProperties
 *         and SharedMemoryProtocolProperties, have been added to allow
 *         configuration of TAO's UIOP and SHMEM pluggable protocols
 *         through RTCORBA Protocol Policies.
 *     2.  TAO-specific support for named mutexes has been added.
 *     3.  Added RT_ORB::create_tcp_protocol_properties which seems
 *         to come and go from the formal specification, but is needed.
 *
 *   This file was used to generate the code in RTCORBAC.{h,i,cpp}.
 *   The steps to regenerate the code are as follows:
 *
 *   1. Run the tao_idl compiler on the pidl file.  The command used for
 *   this is:
 *
 *     tao_idl -o orig -Gp -Gd -Ge 1 -GT -I../..
 *          -Wb,export_macro=TAO_RTCORBA_Export
 *          -Wb,export_include="rtcorba_export.h"
 *          -Wb,pre_include="ace/pre.h"
 *          -Wb,post_include="ace/post.h"
 *          RTCORBA.pidl
 *
 *   2. Then apply the patches in tao/RTCORBA/diffs to the generated code.
 *   The patches provide the following fixes: 1) remove several unnecessary
 *   includes, e.g., corba.h, stream.h, Policy.h, 3) add anything else we
 *   need into the namespace, i.e., TAO_Priority_Mapping, and 4) fix
 *   "nested_class" occurrences in the .cpp.
 *
 * Apply patches using the following commands:
 *
 *   patch < diffs/RTCORBA.diff
 *
 * Note: The diffs were generated with these commands:
 *
 *   for i in RTCORBAC.{h,i,cpp}; do
 *     diff -wBbu orig/$i $i
 *   done > diffs/RTCORBA.diff
 *
 */

#ifndef _RT_CORBA_IDL_
#define _RT_CORBA_IDL_

#include <orb.idl>
#include <IOP.pidl>
#include <TimeBase.pidl>

#pragma prefix "omg.org"

module RTCORBA
{
  // Priorities.
  typedef short NativePriority;
  typedef short Priority;
  const Priority minPriority = 0;
  const Priority maxPriority = 32767;

  native PriorityMapping;
  native PriorityTransform;

  typedef long NetworkPriority;
  native NetworkPriorityMapping;

  // Threadpool types.
  typedef unsigned long ThreadpoolId;

  struct ThreadpoolLane
  {
    Priority lane_priority;
    unsigned long static_threads;
    unsigned long dynamic_threads;
  };
  typedef sequence <ThreadpoolLane> ThreadpoolLanes;

  // RT Policies.

  // Priority Model Policy.
  const CORBA::PolicyType PRIORITY_MODEL_POLICY_TYPE = 40;
  enum PriorityModel
  {
    CLIENT_PROPAGATED,
    SERVER_DECLARED
  };

  local interface PriorityModelPolicy : CORBA::Policy
  {
      readonly attribute PriorityModel priority_model;
      readonly attribute Priority server_priority;
  };

  // Threadpool Policy.
  const CORBA::PolicyType THREADPOOL_POLICY_TYPE = 41;
  local interface ThreadpoolPolicy : CORBA::Policy
  {
      readonly attribute ThreadpoolId threadpool;
  };

  // Protocol Properties.
  local interface ProtocolProperties {};

  struct Protocol
  {
      IOP::ProfileId protocol_type;
      ProtocolProperties orb_protocol_properties;
      ProtocolProperties transport_protocol_properties;
  };

  typedef sequence <Protocol> ProtocolList;

  // Server Protocol Policy
  const CORBA::PolicyType SERVER_PROTOCOL_POLICY_TYPE = 42;

  // Locality constrained interface
  local interface ServerProtocolPolicy : CORBA::Policy
  {
    readonly attribute ProtocolList protocols;
  };

  // Client Protocol Policy
  const CORBA::PolicyType CLIENT_PROTOCOL_POLICY_TYPE = 43;

  // Locality constrained interface
  local interface ClientProtocolPolicy : CORBA::Policy
  {
    readonly attribute ProtocolList protocols;
  };

  // Private Connection Policy
  const CORBA::PolicyType PRIVATE_CONNECTION_POLICY_TYPE = 44;

  // Locality constrained interface
  local interface PrivateConnectionPolicy : CORBA::Policy {};

  local interface TCPProtocolProperties : ProtocolProperties
  {
    attribute long send_buffer_size;
    attribute long recv_buffer_size;
    attribute boolean keep_alive;
    attribute boolean dont_route;
    attribute boolean no_delay;
    attribute boolean enable_network_priority;
  };

  local interface GIOPProtocolProperties : ProtocolProperties {};

  // Properties for TAO-specific protocols (these protocols &
  // interfaces are not specified by the OMG).

  // Communication over Unix Domain Sockets (Local IPC).
  local interface UnixDomainProtocolProperties : ProtocolProperties
  {
    attribute long send_buffer_size;
    attribute long recv_buffer_size;
  };

  // Communication over Shared Memory.
  local interface SharedMemoryProtocolProperties : ProtocolProperties
  {
    attribute long preallocate_buffer_size;
    attribute string mmap_filename;
    attribute string mmap_lockname;
  };

  // End of TAO-specific interfaces.

  // PriorityBandedConnectionPolicy.
  struct PriorityBand
  {
    Priority low;
    Priority high;
  };
  typedef sequence <PriorityBand> PriorityBands;

  const CORBA::PolicyType PRIORITY_BANDED_CONNECTION_POLICY_TYPE = 45;
  local interface PriorityBandedConnectionPolicy : CORBA::Policy
  {
    readonly attribute PriorityBands priority_bands;
  };

  // RT Current.
  local interface Current : CORBA::Current
  {
    attribute Priority the_priority;
  };

  // Mutex.
  local interface Mutex
  {
      void lock ();
      void unlock ();
      boolean try_lock (in TimeBase::TimeT max_wait);
    // if max_wait = 0 then return immediately
  };

  // RTORB.
  local interface RTORB
  {
    // Mutex creation/destruction.
    Mutex create_mutex ();
    void destroy_mutex (in Mutex the_mutex);

    // TAO specific
    // Named Mutex creation/opening
    exception MutexNotFound {};
    Mutex create_named_mutex (in string name,
                              out boolean created_flag);
    Mutex open_named_mutex (in string name)
      raises (MutexNotFound);

    // End TAO specific

    TCPProtocolProperties create_tcp_protocol_properties(
                                                     in long send_buffer_size,
                                                     in long recv_buffer_size,
                                                     in boolean keep_alive,
                                                     in boolean dont_route,
                                                     in boolean no_delay,
						     in boolean enable_network_priority);

    // Threadpool creation/destruction.
    exception InvalidThreadpool {};

    ThreadpoolId create_threadpool (in unsigned long stacksize,
                                    in unsigned long static_threads,
                                    in unsigned long dynamic_threads,
                                    in Priority default_priority,
                                    in boolean allow_request_buffering,
                                    in unsigned long max_buffered_requests,
                                    in unsigned long max_request_buffer_size);

    ThreadpoolId create_threadpool_with_lanes (in unsigned long stacksize,
                                               in ThreadpoolLanes lanes,
                                               in boolean allow_borrowing,
                                               in boolean allow_request_buffering,
                                               in unsigned long max_buffered_requests,
                                               in unsigned long max_request_buffer_size);

    void destroy_threadpool (in ThreadpoolId threadpool)
      raises (InvalidThreadpool);

    // RT Policies creation.
    PriorityModelPolicy create_priority_model_policy (in PriorityModel priority_model,
                                                      in Priority server_priority);

    ThreadpoolPolicy create_threadpool_policy (in ThreadpoolId threadpool);

    PriorityBandedConnectionPolicy
      create_priority_banded_connection_policy (in PriorityBands priority_bands);


    ServerProtocolPolicy create_server_protocol_policy (in ProtocolList protocols);

    ClientProtocolPolicy create_client_protocol_policy (in ProtocolList protocols);

    PrivateConnectionPolicy create_private_connection_policy ();
  };
};

#endif /* _RT_CORBA_IDL_ */