summaryrefslogtreecommitdiff
path: root/TAO/tao/RTCORBA.pidl
blob: ecd0e4cd45e006ad6de162185fd6dd29663dbe29 (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
//
// $Id$
//
// ================================================================
//
// = LIBRARY
//   TAO
//
// = FILENAME
//   RTCORBA.pidl
//
// = DESCRIPTION
//
//   The RTCORBA module specified in ptc/99-05-03 (Real-Time
//   CORBA Joint Revised Submission May 28, 1999).
//
//   Changes to the original OMG idl:
//     1.  All RT policies have been assigned PolicyType values
//         from the range reserved for TAO.  0x54410002 through
//         0x54410007 are used for RT Policies.  This is in effect
//         until OMG will standardize PolicyType values (currently RT
//         CORBA spec contains question marks instead of values).
//     2.  All interfaces in RTCORBA module have been made <local>.
//         Original idl defined most interfaces as local, but not
//         all.  It is unclear whether that was intentional or a
//         result of sloppiness.  Until the former is proved, the
//         latter will be assumed and all interfaces made <local>.
//
//   This file was used to generate the code in
//   RTCORBA{C,S,S_T}.{h,i,cpp} The command used to generate code
//   is:
//
//     tao_idl -o orig -Gp -Gd -Ge 1 -Gv \
//          -Wb,export_macro=TAO_Export \
//          -Wb,export_include=corbafwd.h \
//          -Wb,pre_include="ace/pre.h" \
//          -Wb,post_include="ace/post.h" \
//          RTCORBA.pidl
//
//   After the files are generated, patches located in tao/diffs
//   directory must be applied.  The patches provide the following
//   fixes: 1) disable the code under certain configurations, i.e.,
//   apply "if (TAO_HAS_RT_CORBA)", 2) 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 .cpp.
//   These changes are required because the generated code is part of
//   the TAO library, it hardly makes any sense to change the IDL
//   compiler to support changes that are very occasional.
//
// ================================================================

#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;

  // 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 = 0x54410002;
  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 = 0x54410003;
  local interface ThreadpoolPolicy : CORBA::Policy
  {
    readonly attribute ThreadpoolId threadpool;
  };

  // Private Connection Policy
  const CORBA::PolicyType PRIVATE_CONNECTION_POLICY_TYPE = 0x54410006;
  local interface PrivateConnectionPolicy : CORBA::Policy {};

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

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

  // Protocol Properties.
  local interface ProtocolProperties {};

  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;
    };

  local interface GIOPProtocolProperties : 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 = 0x54410004;
  local interface ServerProtocolPolicy : CORBA::Policy
    {
      readonly attribute ProtocolList protocols;
    };

  // Client Protocol Policy
  const CORBA::PolicyType CLIENT_PROTOCOL_POLICY_TYPE = 0x54410005;
  local interface ClientProtocolPolicy : CORBA::Policy
    {
      readonly attribute ProtocolList protocols;
    };

  // 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);

    // 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);

    PrivateConnectionPolicy create_private_connection_policy ();

    ServerProtocolPolicy create_server_protocol_policy (in ProtocolList protocols);

    ClientProtocolPolicy create_client_protocol_policy (in ProtocolList protocols);
  };
};

#pragma prefix ""

#endif /* _RT_CORBA_IDL_ */