summaryrefslogtreecommitdiff
path: root/TAO/tests/Cubit/COOL/cubit.C
blob: 984b7d54e2ad48e28d7c5bc480bfcc8ebc4cad7e (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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
/*
 * File generated by CHIC (CHIC-COMMON-970407)
 *        from: cubit.idl
*/
#include <corba/cool.H>
#include "cubit.H"



//=========================================================
//    interface Cubit
//=========================================================



class _TypeCodeImpl_Cubit  {
public:
        static void
    push(COOL_Marshaler& marshaler, const void* t);
        static void*
    pop(COOL_Marshaler& marshaler);
        static size_t
    size(COOL_Marshaler& marshaler, const void* t);
        static void*
    copy(const void* from);
        static void
    release(void* t);

    static CORBA_TypeCode          constant;
    static const _COOL_TypeDefImpl typeDefImpl;
    static const void*const        parameters[];
};

const _COOL_TypeDefImpl _TypeCodeImpl_Cubit::typeDefImpl = {
    _TypeCodeImpl_Cubit::push,
    _TypeCodeImpl_Cubit::pop,
    _TypeCodeImpl_Cubit::size,
    _TypeCodeImpl_Cubit::copy,
    _TypeCodeImpl_Cubit::release
};

    void
_TypeCodeImpl_Cubit::push(COOL_Marshaler& marshaler, const void* t)
{
    const Cubit_ptr obj = *(const Cubit_ptr*) t;
    marshaler.put_Object(obj);
}
    void*
_TypeCodeImpl_Cubit::pop(COOL_Marshaler& marshaler)
{
    Cubit_ptr* t = new Cubit_ptr;
    *t = (Cubit_ptr) NULL;
    CubitMarshaler::get(marshaler, *t);
    return (void*) t;
}    
    size_t
_TypeCodeImpl_Cubit::size(COOL_Marshaler& marshaler, const void* t)
{
    const Cubit_ptr obj = *(const Cubit_ptr*)t;
    return marshaler.size_Object(obj);
}
    void*
_TypeCodeImpl_Cubit::copy(const void* from)
{
    Cubit_ptr* to  = new Cubit_ptr;
    *to = Cubit::_duplicate(*(const Cubit_ptr*)from);
    return (void*) to;
}    
    void
_TypeCodeImpl_Cubit::release(void* t)
{
    CORBA_release(*(Cubit_ptr*)t);
}


const void*const _TypeCodeImpl_Cubit::parameters[] = {
    (const void*) "IDL:Cubit:1.0",
    (const void*) "Cubit"
};


CORBA_TypeCode _TypeCodeImpl_Cubit::constant(
    CORBA_tk_objref,
    0x00750aa6,
    &_TypeCodeImpl_Cubit::typeDefImpl,
    _TypeCodeImpl_Cubit::parameters
);
const CORBA_TypeCode_ptr _tc_Cubit = &_TypeCodeImpl_Cubit::constant;


    Cubit_ptr
Cubit_proxy::operator =(Cubit_ptr ptr) 
{
    if (*ptr_ != ptr) {
        if (release_ == CORBA_TRUE) CORBA_release(*ptr_);
        *ptr_ = ptr;
    }
    return ptr;
}
    Cubit_ptr
Cubit_proxy::_duplicate(Cubit_ptr ptr)
{
    return Cubit::_duplicate(ptr);
}
    void
Cubit_proxy::_release(Cubit_ptr ptr)
{
    CORBA_release(ptr);
}
    Cubit_ptr
Cubit_proxy::_nil()
{
    return Cubit::_nil();
}

    void
CubitMarshaler::put(COOL_Marshaler& marshaler,
    const Cubit_ptr ptr)
{
    marshaler.put_Object(ptr);
}
    void
CubitMarshaler::get(COOL_Marshaler& marshaler,
    Cubit_ptr& ptr)
{
    CORBA_release(ptr);
    Cubit_ptr obj = new Cubit;
    if (marshaler.get_Object(obj) == CORBA_FALSE) {
        obj = Cubit::_nil();
    }
    ptr = obj;
}
    size_t
CubitMarshaler::size(COOL_Marshaler& marshaler,
    const Cubit_ptr ptr)
{
    return marshaler.size_Object(ptr);
}
static const _COOL_OperationDesc Cubit_desc[] = {
  { "cube_long", 2, (const CORBA_TypeCode_ptr*const*const) 0 },
  { "cube_octet", 0, (const CORBA_TypeCode_ptr*const*const) 0 },
  { "cube_short", 1, (const CORBA_TypeCode_ptr*const*const) 0 },
  { "cube_struct", 3, (const CORBA_TypeCode_ptr*const*const) 0 },
  { "cube_union", 4, (const CORBA_TypeCode_ptr*const*const) 0 },
  { "please_exit", 5, (const CORBA_TypeCode_ptr*const*const) 0 }
};
const _COOL_InterfaceDesc Cubit::coOperations = {
    "IDL:Cubit:1.0", 0x00750aa6, 6, Cubit_desc
};

const _COOL_FullInterfaceDesc Cubit::coInterfaceDef[] = {
    { &Cubit::coOperations, 0},
    { (const _COOL_InterfaceDesc*const) 0, 0}
};
Cubit Cubit::coNilObject(Cubit::coInterfaceDef);

Cubit::~Cubit()
{
}

    int
Cubit::_shiftVtbl(CORBA_Environment& _env) const
{
    return switchLocal(this, coOperations.typeId, _env);
}

//
// RPC fct: Cubit::cube_octet()
//
    CORBA_Octet
Cubit::cube_octet(CORBA_Octet o,
                  CORBA_Environment& _env) const
{
    int _error = _shiftVtbl(_env);
    if (_error == C_OK) {
        return cube_octet(o, _env);
    }
    CORBA_Octet _returnValue = 0;
    if (_error == C_EUNKNOWN) {
        return _returnValue;
    }
    _COOL_Request _req(this, coOperations, 1, 1, 0, _env);
    if (_env.exception()) {
        return _returnValue;
    }
    _req.put_Octet(o);

    if (_req.invoke(_env) != C_OK) {
        return _returnValue;
    }
    _returnValue = _req.get_Octet();
    return _returnValue;
}


//
// RPC fct: Cubit::cube_short()
//
    CORBA_Short
Cubit::cube_short(CORBA_Short s,
                  CORBA_Environment& _env) const
{
    int _error = _shiftVtbl(_env);
    if (_error == C_OK) {
        return cube_short(s, _env);
    }
    CORBA_Short _returnValue = 0;
    if (_error == C_EUNKNOWN) {
        return _returnValue;
    }
    _COOL_Request _req(this, coOperations, 2, 2, 0, _env);
    if (_env.exception()) {
        return _returnValue;
    }
    _req.put_Short(s);

    if (_req.invoke(_env) != C_OK) {
        return _returnValue;
    }
    _returnValue = _req.get_Short();
    return _returnValue;
}


//
// RPC fct: Cubit::cube_long()
//
    CORBA_Long
Cubit::cube_long(CORBA_Long l,
                 CORBA_Environment& _env) const
{
    int _error = _shiftVtbl(_env);
    if (_error == C_OK) {
        return cube_long(l, _env);
    }
    CORBA_Long _returnValue = 0;
    if (_error == C_EUNKNOWN) {
        return _returnValue;
    }
    _COOL_Request _req(this, coOperations, 0, 4, 0, _env);
    if (_env.exception()) {
        return _returnValue;
    }
    _req.put_Long(l);

    if (_req.invoke(_env) != C_OK) {
        return _returnValue;
    }
    _returnValue = _req.get_Long();
    return _returnValue;
}


//=========================================================
//    Structure Many
//=========================================================



class _TypeCodeImpl_Cubit_Many  {
public:
        static void
    push(COOL_Marshaler& marshaler, const void* t);
        static void*
    pop(COOL_Marshaler& marshaler);
        static size_t
    size(COOL_Marshaler& marshaler, const void* t);
        static void*
    copy(const void* from);
        static void
    release(void* t);

    static CORBA_TypeCode          constant;
    static const _COOL_TypeDefImpl typeDefImpl;
    static const void*const        parameters[];
};

const _COOL_TypeDefImpl _TypeCodeImpl_Cubit_Many::typeDefImpl = {
    _TypeCodeImpl_Cubit_Many::push,
    _TypeCodeImpl_Cubit_Many::pop,
    _TypeCodeImpl_Cubit_Many::size,
    _TypeCodeImpl_Cubit_Many::copy,
    _TypeCodeImpl_Cubit_Many::release
};

    void
_TypeCodeImpl_Cubit_Many::push(COOL_Marshaler& marshaler, const void* t)
{
    Cubit::ManyMarshaler::put(marshaler, *(const Cubit::Many*)t);
}
    void*
_TypeCodeImpl_Cubit_Many::pop(COOL_Marshaler& marshaler)
{
    Cubit::Many* t = new Cubit::Many;
    Cubit::ManyMarshaler::get(marshaler, *t);
    return (void*) t;
}    
    size_t
_TypeCodeImpl_Cubit_Many::size(COOL_Marshaler&, const void*)
{
    return 10;
}
    void*
_TypeCodeImpl_Cubit_Many::copy(const void* from)
{
    Cubit::Many* to = new Cubit::Many(*(const Cubit::Many*)from);
    return (void*) to;
}    
    void
_TypeCodeImpl_Cubit_Many::release(void* t)
{
    delete (Cubit::Many*)t;
}


const void*const _TypeCodeImpl_Cubit_Many::parameters[] = {
    (const void*) "IDL:Eng.SUN.COM/Cubit/Many:1.0",
    (const void*) "Many",
    (const void*) 3UL,
    (const void*) "o", (const void*) &CORBA__tc_octet,
    (const void*) "l", (const void*) &CORBA__tc_long,
    (const void*) "s", (const void*) &CORBA__tc_short
};


CORBA_TypeCode _TypeCodeImpl_Cubit_Many::constant(
    CORBA_tk_struct,
    0x004e6a97,
    &_TypeCodeImpl_Cubit_Many::typeDefImpl,
    _TypeCodeImpl_Cubit_Many::parameters
);
 CORBA_TypeCode_ptr Cubit::_tc_Many = &_TypeCodeImpl_Cubit_Many::constant;


    void

Cubit::ManyMarshaler::put(COOL_Marshaler& marshaler,
    const Cubit::Many& obj)
{
     marshaler.put_Octet(obj.o);
     marshaler.put_Long(obj.l);
     marshaler.put_Short(obj.s);
}

    void
Cubit::ManyMarshaler::get(COOL_Marshaler& marshaler,
    Cubit::Many& obj)
{
    obj.o =  marshaler.get_Octet();
    obj.l =  marshaler.get_Long();
    obj.s =  marshaler.get_Short();
}


//
// RPC fct: Cubit::cube_struct()
//
    Cubit::Many
Cubit::cube_struct(const Cubit::Many& values,
                   CORBA_Environment& _env) const
{
    int _error = _shiftVtbl(_env);
    if (_error == C_OK) {
        return cube_struct(values, _env);
    }
    Cubit::Many _returnValue;
    if (_error == C_EUNKNOWN) {
        return _returnValue;
    }
    _COOL_Request _req(this, coOperations, 3, 10, 0, _env);
    if (_env.exception()) {
        return _returnValue;
    }
    Cubit::ManyMarshaler::put(_req, values);

    if (_req.invoke(_env) != C_OK) {
        return _returnValue;
    }
    Cubit::ManyMarshaler::get(_req, _returnValue);
    return _returnValue;
}


//=========================================================
//    Enum discrim
//=========================================================



class _TypeCodeImpl_Cubit_discrim  {
public:
        static void
    push(COOL_Marshaler& marshaler, const void* t);
        static void*
    pop(COOL_Marshaler& marshaler);
        static size_t
    size(COOL_Marshaler& marshaler, const void* t);
        static void*
    copy(const void* from);
        static void
    release(void* t);

    static CORBA_TypeCode          constant;
    static const _COOL_TypeDefImpl typeDefImpl;
    static const void*const        parameters[];
};

const _COOL_TypeDefImpl _TypeCodeImpl_Cubit_discrim::typeDefImpl = {
    _TypeCodeImpl_Cubit_discrim::push,
    _TypeCodeImpl_Cubit_discrim::pop,
    _TypeCodeImpl_Cubit_discrim::size,
    _TypeCodeImpl_Cubit_discrim::copy,
    _TypeCodeImpl_Cubit_discrim::release
};

    void
_TypeCodeImpl_Cubit_discrim::push(COOL_Marshaler& marshaler, const void* t)
{
    marshaler.put_ULong((CORBA_ULong) *(const Cubit::discrim*)t);

}
    void*
_TypeCodeImpl_Cubit_discrim::pop(COOL_Marshaler& marshaler)
{
    Cubit::discrim* t = new Cubit::discrim;
    *t = (Cubit::discrim) marshaler.get_ULong();
    return (void*) t;
}    
    size_t
_TypeCodeImpl_Cubit_discrim::size(COOL_Marshaler& marshaler, const void*)
{
    return marshaler.size_ULong();
}
    void*
_TypeCodeImpl_Cubit_discrim::copy(const void* from)
{
    Cubit::discrim* to = new Cubit::discrim(*(const Cubit::discrim*)from);
    return (void*) to;
}    
    void
_TypeCodeImpl_Cubit_discrim::release(void* t)
{
    delete (Cubit::discrim*)t;
}


const void*const _TypeCodeImpl_Cubit_discrim::parameters[] = {
    (const void*) "IDL:Eng.SUN.COM/Cubit/discrim:1.0",
    (const void*) "discrim",
    (const void*) 6UL,
    (const void*) "e_0th",
    (const void*) "e_1st",
    (const void*) "e_2nd",
    (const void*) "e_3rd",
    (const void*) "e_4th",
    (const void*) "e_5th"
};


CORBA_TypeCode _TypeCodeImpl_Cubit_discrim::constant(
    CORBA_tk_enum,
    0x006e1395,
    &_TypeCodeImpl_Cubit_discrim::typeDefImpl,
    _TypeCodeImpl_Cubit_discrim::parameters
);
 CORBA_TypeCode_ptr Cubit::_tc_discrim = &_TypeCodeImpl_Cubit_discrim::constant;

    void
Cubit::oneof::_d(Cubit::discrim val)
{
    switch(val) {
    case Cubit::e_0th:
        if (initialized_ == 1) discriminant_ = val;
        break;
    case Cubit::e_1st:
        if (initialized_ == 2) discriminant_ = val;
        break;
    case Cubit::e_2nd:
        if (initialized_ == 3) discriminant_ = val;
        break;
    case Cubit::e_3rd:
    default:
        if (initialized_ == 4) discriminant_ = val;
        break;
    }
}
    void
Cubit::oneof::build(const oneof& val)
{
    memcpy(this, &val, sizeof(oneof));
}
    void
Cubit::oneofMarshaler::put(COOL_Marshaler& req, const Cubit::oneof& obj)
{
    req.put_ULong((CORBA_ULong) obj.discriminant_);
    switch(obj.initialized_) {
    case 1:
        req.put_Octet(*((CORBA_Octet*) obj.value_));
        break;
    case 2:
        req.put_Short(*((CORBA_Short*) obj.value_));
        break;
    case 3:
        req.put_Long(*((CORBA_Long*) obj.value_));
        break;
    case 4:
        Cubit::ManyMarshaler::put(req, *((Cubit::Many*) obj.value_));
        break;
    }
}
    void
Cubit::oneofMarshaler::get(COOL_Marshaler& req, Cubit::oneof& obj)
{
    obj.discriminant_ = (Cubit::discrim) req.get_ULong();
    switch(obj.discriminant_) {
    case Cubit::e_0th:
        obj.initialized_ = (CORBA_ULong) 1;
        *((CORBA_Octet*) obj.value_) = req.get_Octet();
        break;
    case Cubit::e_1st:
        obj.initialized_ = (CORBA_ULong) 2;
        *((CORBA_Short*) obj.value_) = req.get_Short();
        break;
    case Cubit::e_2nd:
        obj.initialized_ = (CORBA_ULong) 3;
        *((CORBA_Long*) obj.value_) = req.get_Long();
        break;
    case Cubit::e_3rd:
    default:
        obj.initialized_ = (CORBA_ULong) 4;
        new(obj.value_, _new_placement)Cubit::Many();
        Cubit::ManyMarshaler::get(req, *((Cubit::Many*) obj.value_));
        break;
    }
}


class _TypeCodeImpl_Cubit_oneof  {
public:
        static void
    push(COOL_Marshaler& marshaler, const void* t);
        static void*
    pop(COOL_Marshaler& marshaler);
        static size_t
    size(COOL_Marshaler& marshaler, const void* t);
        static void*
    copy(const void* from);
        static void
    release(void* t);

    static CORBA_TypeCode          constant;
    static const _COOL_TypeDefImpl typeDefImpl;
    static const void*const        parameters[];
};

const _COOL_TypeDefImpl _TypeCodeImpl_Cubit_oneof::typeDefImpl = {
    _TypeCodeImpl_Cubit_oneof::push,
    _TypeCodeImpl_Cubit_oneof::pop,
    _TypeCodeImpl_Cubit_oneof::size,
    _TypeCodeImpl_Cubit_oneof::copy,
    _TypeCodeImpl_Cubit_oneof::release
};

    void
_TypeCodeImpl_Cubit_oneof::push(COOL_Marshaler& marshaler, const void* t)
{
    Cubit::oneofMarshaler::put(marshaler, *(const Cubit::oneof*)t);
}
    void*
_TypeCodeImpl_Cubit_oneof::pop(COOL_Marshaler& marshaler)
{
    Cubit::oneof* t = new Cubit::oneof;
    Cubit::oneofMarshaler::get(marshaler, *t);
    return (void*) t;
}    
    size_t
_TypeCodeImpl_Cubit_oneof::size(COOL_Marshaler&, const void*)
{
    return 14;
}
    void*
_TypeCodeImpl_Cubit_oneof::copy(const void* from)
{
    Cubit::oneof* to = new Cubit::oneof(*(const Cubit::oneof*)from);
    return (void*) to;
}    
    void
_TypeCodeImpl_Cubit_oneof::release(void* t)
{
    delete (Cubit::oneof*)t;
}


const void*const _TypeCodeImpl_Cubit_oneof::parameters[] = {
    (const void*) "IDL:Eng.SUN.COM/Cubit/oneof:1.0",
    (const void*) "oneof", 
    (const void*) &Cubit::_tc_discrim,
    (const void*) 4L,
    (const void*) 5UL,
    (const void*) (Cubit::discrim) Cubit::e_0th,
        (const void*) "o", (const void*) &CORBA__tc_octet,
    (const void*) (Cubit::discrim) Cubit::e_1st,
        (const void*) "s", (const void*) &CORBA__tc_short,
    (const void*) (Cubit::discrim) Cubit::e_2nd,
        (const void*) "l", (const void*) &CORBA__tc_long,
    (const void*) (Cubit::discrim) Cubit::e_3rd,
        (const void*) "cm", (const void*) &Cubit::_tc_Many,
    (const void*) (Cubit::discrim) 4,
        (const void*) "cm", (const void*) &Cubit::_tc_Many
};


CORBA_TypeCode _TypeCodeImpl_Cubit_oneof::constant(
    CORBA_tk_union,
    0x0070cd3e,
    &_TypeCodeImpl_Cubit_oneof::typeDefImpl,
    _TypeCodeImpl_Cubit_oneof::parameters
);
 CORBA_TypeCode_ptr Cubit::_tc_oneof = &_TypeCodeImpl_Cubit_oneof::constant;


//
// RPC fct: Cubit::cube_union()
//
    Cubit::oneof
Cubit::cube_union(const Cubit::oneof& values,
                  CORBA_Environment& _env) const
{
    int _error = _shiftVtbl(_env);
    if (_error == C_OK) {
        return cube_union(values, _env);
    }
    Cubit::oneof _returnValue;
    if (_error == C_EUNKNOWN) {
        return _returnValue;
    }
    _COOL_Request _req(this, coOperations, 4, 14, 0, _env);
    if (_env.exception()) {
        return _returnValue;
    }
    Cubit::oneofMarshaler::put(_req, values);

    if (_req.invoke(_env) != C_OK) {
        return _returnValue;
    }
    Cubit::oneofMarshaler::get(_req, _returnValue);
    return _returnValue;
}


//
// RPC fct: Cubit::please_exit()
//
    void
Cubit::please_exit(CORBA_Environment& _env) const
{
    int _error = _shiftVtbl(_env);
    if (_error == C_OK) {
        please_exit(_env);
        return;
    }
    if (_error == C_EUNKNOWN) {
        return;
    }
    _COOL_Request _req(this, coOperations, 5, 0, 1, _env);

    _req.send(_env);
}