summaryrefslogtreecommitdiff
path: root/TAO/tests/Cubit/COOL/sk_cubit.C
blob: af60f56ff564f480ae3916a3b6250069c645cd8a (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
/*
 * File generated by CHIC (CHIC-COMMON-970407)
 *        from: cubit.idl
*/

//=========================================================
// Binding upcall class between Cubit_Impl and Cubit
//=========================================================
class _COOL_Bind_Cubit_Cubit_Impl {
public:
        static int
    dispatch(void*, _COOL_ServerRequest&, CORBA_Environment&);
        static int
    loadLocalVtbl(const void*, const _InterfaceId);
};
static const _COOL_UpCall  _u_Bind_Cubit_Cubit_Impl = {
    Cubit::coInterfaceDef,
    _COOL_Bind_Cubit_Cubit_Impl::dispatch,
    _COOL_Bind_Cubit_Cubit_Impl::loadLocalVtbl,
    1
};

#ifndef _COOL_localCubit_Cubit_Impl
#define _COOL_localCubit_Cubit_Impl

    //=========================================================
    // Local Invocation class between Cubit and Cubit_Impl
    //=========================================================
class _localCubit_Cubit_Impl : public virtual CORBA_Object {

public:
        virtual CORBA_Octet
    cube_octet(CORBA_Octet o,
               CORBA_Environment& _env = _environment);
            virtual CORBA_Short
    cube_short(CORBA_Short s,
               CORBA_Environment& _env = _environment);
            virtual CORBA_Long
    cube_long(CORBA_Long l,
              CORBA_Environment& _env = _environment);
            virtual Cubit::Many
    cube_struct(const Cubit::Many& values,
                CORBA_Environment& _env = _environment);
            virtual Cubit::oneof
    cube_union(const Cubit::oneof& values,
               CORBA_Environment& _env = _environment);
            virtual void
    please_exit(CORBA_Environment& _env = _environment);
    
    _localCubit_Cubit_Impl() : CORBA_Object(_emptyCtor)
    {}
protected:
        virtual int
    _shiftVtbl() const;
        virtual
    ~_localCubit_Cubit_Impl();

};

#endif

    int
_localCubit_Cubit_Impl::_shiftVtbl() const
{
    return C_OK;
}

_localCubit_Cubit_Impl::~_localCubit_Cubit_Impl()
{
}

    void
COOL_bind(const Cubit_Impl& server, Cubit_ptr& inter,
          const COOL_BindingData& bindingData,
          CORBA_Environment& _env)
{
    inter = new Cubit;
    int result = CORBA_Object::bindObject(&server, inter,
                                          _u_Bind_Cubit_Cubit_Impl,
                                          bindingData, _env);
    if (result != C_OK) {
        inter = Cubit::_nil();
    }
}

    int
_COOL_Bind_Cubit_Cubit_Impl::dispatch(void* _impl,
                                      _COOL_ServerRequest& _req,
                                      CORBA_Environment& _env)
{

    switch (_req.operation()) {

        // Cubit::cube_octet
    case 0: {
        CORBA_Octet o;
        o = _req.get_Octet();
        CORBA_Octet _returnValue = 
        ((Cubit_Impl*)_impl)->cube_octet(o, _env);
        if (_req.initialize(1, _env) != C_OK) {
            return C_ENOMEM;
        }
        _req.put_Octet(_returnValue);
        return C_OK;
    }

        // Cubit::cube_short
    case 1: {
        CORBA_Short s;
        s = _req.get_Short();
        CORBA_Short _returnValue = 
        ((Cubit_Impl*)_impl)->cube_short(s, _env);
        if (_req.initialize(2, _env) != C_OK) {
            return C_ENOMEM;
        }
        _req.put_Short(_returnValue);
        return C_OK;
    }

        // Cubit::cube_long
    case 2: {
        CORBA_Long l;
        l = _req.get_Long();
        CORBA_Long _returnValue = 
        ((Cubit_Impl*)_impl)->cube_long(l, _env);
        if (_req.initialize(4, _env) != C_OK) {
            return C_ENOMEM;
        }
        _req.put_Long(_returnValue);
        return C_OK;
    }

        // Cubit::cube_struct
    case 3: {
        Cubit::Many values;
        Cubit::ManyMarshaler::get(_req, values);
        Cubit::Many _returnValue = 
        ((Cubit_Impl*)_impl)->cube_struct(values, _env);
        if (_req.initialize(10, _env) != C_OK) {
            return C_ENOMEM;
        }
        Cubit::ManyMarshaler::put(_req, _returnValue);
        return C_OK;
    }

        // Cubit::cube_union
    case 4: {
        Cubit::oneof values;
        Cubit::oneofMarshaler::get(_req, values);
        Cubit::oneof _returnValue = 
        ((Cubit_Impl*)_impl)->cube_union(values, _env);
        if (_req.initialize(14, _env) != C_OK) {
            return C_ENOMEM;
        }
        Cubit::oneofMarshaler::put(_req, _returnValue);
        return C_OK;
    }

        // Cubit::please_exit
    case 5: {
        ((Cubit_Impl*)_impl)->please_exit(_env);
        return C_EPOSTPONED;
    }
    default:
        return C_EBADOPERATION;
    }
}

#ifdef _COOL_WINDOWS_NEW
#  undef new
#endif
    int
_COOL_Bind_Cubit_Cubit_Impl::loadLocalVtbl(const void* obj,
                                           const _InterfaceId interfaceId)
{
    switch (interfaceId) {
    case 0x00750aa6:    // Cubit
        ::new ((void*)obj,_new_placement) _localCubit_Cubit_Impl;
        break;
    default:
        return C_EFAIL;
    }
    return C_OK;
}
#ifdef _COOL_WINDOWS_NEW
#  define new _COOL_WINDOWS_NEW
#endif

    CORBA_Octet
_localCubit_Cubit_Impl::cube_octet(CORBA_Octet o,
                                   CORBA_Environment& _env)
{
    _COOL_ImplLock _implLock;
    if (lockImplementation(_implLock, _env) != C_OK) {
        return 0;
    }
    CORBA_Octet _returnValue = ((Cubit_Impl*)_implLock.implAddr())->cube_octet(o, _env);
    unlockImplementation(_implLock, _env);
    return _returnValue;
}

    CORBA_Short
_localCubit_Cubit_Impl::cube_short(CORBA_Short s,
                                   CORBA_Environment& _env)
{
    _COOL_ImplLock _implLock;
    if (lockImplementation(_implLock, _env) != C_OK) {
        return 0;
    }
    CORBA_Short _returnValue = ((Cubit_Impl*)_implLock.implAddr())->cube_short(s, _env);
    unlockImplementation(_implLock, _env);
    return _returnValue;
}

    CORBA_Long
_localCubit_Cubit_Impl::cube_long(CORBA_Long l,
                                  CORBA_Environment& _env)
{
    _COOL_ImplLock _implLock;
    if (lockImplementation(_implLock, _env) != C_OK) {
        return 0;
    }
    CORBA_Long _returnValue = ((Cubit_Impl*)_implLock.implAddr())->cube_long(l, _env);
    unlockImplementation(_implLock, _env);
    return _returnValue;
}

    Cubit::Many
_localCubit_Cubit_Impl::cube_struct(const Cubit::Many& values,
                                    CORBA_Environment& _env)
{
    _COOL_ImplLock _implLock;
    if (lockImplementation(_implLock, _env) != C_OK) {
        Cubit::Many _returnValue;
        return _returnValue;
    }
    Cubit::Many _returnValue = ((Cubit_Impl*)_implLock.implAddr())->cube_struct(values, _env);
    unlockImplementation(_implLock, _env);
    return _returnValue;
}

    Cubit::oneof
_localCubit_Cubit_Impl::cube_union(const Cubit::oneof& values,
                                   CORBA_Environment& _env)
{
    _COOL_ImplLock _implLock;
    if (lockImplementation(_implLock, _env) != C_OK) {
        Cubit::oneof _returnValue;
        return _returnValue;
    }
    Cubit::oneof _returnValue = ((Cubit_Impl*)_implLock.implAddr())->cube_union(values, _env);
    unlockImplementation(_implLock, _env);
    return _returnValue;
}

    void
_localCubit_Cubit_Impl::please_exit(CORBA_Environment& _env)
{
    _COOL_ImplLock _implLock;
    if (lockImplementation(_implLock, _env) != C_OK) {
        return;
    }
    ((Cubit_Impl*)_implLock.implAddr())->please_exit(_env);
    unlockImplementation(_implLock, _env);
}