2
* File: sidl_BaseClass_Module.c
3
* Symbol: sidl.BaseClass-v0.9.17
7
* Revision: @(#) $Id: $
8
* Description: implement a C extension type for a sidl extendable
10
* Copyright (c) 2000-2002, Lawrence Livermore National Security, LLC.
11
* Produced at the Lawrence Livermore National Laboratory.
12
* Written by the Components Team <components@llnl.gov>
13
* All rights reserved.
15
* This file is part of Babel. For more information, see
16
* http://www.llnl.gov/CASC/components/. Please read the COPYRIGHT file
17
* for Our Notice and the LICENSE file for the GNU Lesser General Public
20
* This program is free software; you can redistribute it and/or modify it
21
* under the terms of the GNU Lesser General Public License (as published by
22
* the Free Software Foundation) version 2.1 dated February 1999.
24
* This program is distributed in the hope that it will be useful, but
25
* WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
26
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
27
* conditions of the GNU Lesser General Public License for more details.
29
* You should have recieved a copy of the GNU Lesser General Public License
30
* along with this program; if not, write to the Free Software Foundation,
31
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33
* WARNING: Automatically generated; changes will be lost
38
* THIS CODE IS AUTOMATICALLY GENERATED BY THE BABEL
39
* COMPILER. DO NOT EDIT THIS!
41
* This file contains the implementation of a Python C
42
* extension type (i.e. a Python type implemented in C).
43
* This extension type provides Python interface to the
44
* sidl type sidl.BaseClass.
49
* Symbol "sidl.BaseClass" (version 0.9.17)
51
* Every class implicitly inherits from <code>BaseClass</code>. This
52
* class implements the methods in <code>BaseInterface</code>.
58
#ifndef included_sidl_BaseClass_h
59
#include "sidl_BaseClass.h"
61
#ifndef included_sidl_ClassInfo_h
62
#include "sidl_ClassInfo.h"
64
#ifndef included_sidl_rmi_ProtocolFactory_h
65
#include "sidl_rmi_ProtocolFactory.h"
67
#ifndef included_sidl_rmi_InstanceRegistry_h
68
#include "sidl_rmi_InstanceRegistry.h"
70
#ifndef included_sidl_rmi_InstanceHandle_h
71
#include "sidl_rmi_InstanceHandle.h"
73
#ifndef included_sidl_rmi_Invocation_h
74
#include "sidl_rmi_Invocation.h"
76
#ifndef included_sidl_rmi_Response_h
77
#include "sidl_rmi_Response.h"
79
#ifndef included_sidl_rmi_ServerRegistry_h
80
#include "sidl_rmi_ServerRegistry.h"
82
#ifndef included_sidl_rmi_ConnectRegistry_h
83
#include "sidl_rmi_ConnectRegistry.h"
85
#ifndef included_sidl_io_Serializable_h
86
#include "sidl_io_Serializable.h"
88
#ifndef included_sidl_MemAllocException_h
89
#include "sidl_MemAllocException.h"
91
#ifndef included_sidl_NotImplementedException_h
92
#include "sidl_NotImplementedException.h"
94
#include "sidl_Exception.h"
100
#include "sidl_thread.h"
102
static struct sidl_recursive_mutex_t sidl_BaseClass__mutex= SIDL_RECURSIVE_MUTEX_INITIALIZER;
103
#define LOCK_STATIC_GLOBALS sidl_recursive_mutex_lock( &sidl_BaseClass__mutex )
104
#define UNLOCK_STATIC_GLOBALS sidl_recursive_mutex_unlock( &sidl_BaseClass__mutex )
105
/* #define HAVE_LOCKED_STATIC_GLOBALS (sidl_recursive_mutex_trylock( &sidl_BaseClass__mutex )==EDEADLOCK) */
107
#define LOCK_STATIC_GLOBALS
108
#define UNLOCK_STATIC_GLOBALS
109
/* #define HAVE_LOCKED_STATIC_GLOBALS (1) */
112
#define sidl_BaseClass_INTERNAL 1
113
#include "sidl_BaseClass_Module.h"
114
#ifndef included_sidl_BaseClass_IOR_h
115
#include "sidl_BaseClass_IOR.h"
117
#include "sidlObjA.h"
118
#include "sidlPyArrays.h"
119
#ifdef SIDL_HAVE_NUMPY
120
#include "oldnumeric.h"
121
#elif defined(SIDL_HAVE_NUMERIC_PYTHON)
122
#include "Numeric/arrayobject.h"
124
#error Neither Numeric Python nor NumPy installed
126
#ifndef included_sidl_Loader_h
127
#include "sidl_Loader.h"
129
#ifndef included_sidl_header_h
130
#include "sidl_header.h"
132
#ifndef included_sidl_interface_IOR_h
133
#include "sidl_interface_IOR.h"
135
#include "sidl_rmi_NetworkException_Module.h"
136
#include "sidl_BaseInterface_Module.h"
137
#include "sidl_ClassInfo_Module.h"
138
#include "sidl_RuntimeException_Module.h"
139
#include "sidl_rmi_Call_Module.h"
140
#include "sidl_rmi_Return_Module.h"
141
#include "sidl_rmi_Ticket_Module.h"
148
* lang_inited is a boolean value showing if we have already imported all the nescessary modules
151
static int lang_inited = 0;
153
#define LANG_SPECIFIC_INIT() if(!lang_inited) { \
155
sidl_BaseClass__import(); \
156
sidl_BaseInterface__import(); \
157
sidl_ClassInfo__import(); \
158
sidl_RuntimeException__import(); \
159
sidl_rmi_Ticket__import(); \
165
* RMI connector function for the class. (no addref)
167
struct sidl_BaseClass__object*
168
sidl_BaseClass__connectI(const char * url, sidl_bool ar, struct \
169
sidl_BaseInterface__object **_ex);
174
/* Static variables to hold version of IOR */
175
static const int32_t s_IOR_MAJOR_VERSION = 2;
176
static const int32_t s_IOR_MINOR_VERSION = 0;
178
/* Static variables for managing EPV initialization. */
179
static int s_remote_initialized = 0;
181
static struct sidl_BaseClass__epv s_rem_epv__sidl_baseclass;
183
static struct sidl_BaseInterface__epv s_rem_epv__sidl_baseinterface;
188
/* REMOTE CAST: dynamic type casting for remote objects. */
189
static void* remote_sidl_BaseClass__cast(
190
struct sidl_BaseClass__object* self,
191
const char* name, sidl_BaseInterface* _ex)
195
*_ex = NULL; /* default to no exception */
196
cmp = strcmp(name, "sidl.BaseInterface");
198
(*self->d_epv->f_addRef)(self, _ex); SIDL_CHECK(*_ex);
199
cast = &((*self).d_sidl_baseinterface);
203
cmp = strcmp(name, "sidl.BaseClass");
205
(*self->d_epv->f_addRef)(self, _ex); SIDL_CHECK(*_ex);
206
cast = ((struct sidl_BaseClass__object*)self);
210
if ((*self->d_epv->f_isType)(self,name, _ex)) {
211
void* (*func)(struct sidl_rmi_InstanceHandle__object*, struct \
212
sidl_BaseInterface__object**) =
213
(void* (*)(struct sidl_rmi_InstanceHandle__object*, struct \
214
sidl_BaseInterface__object**))
215
sidl_rmi_ConnectRegistry_getConnect(name, _ex);SIDL_CHECK(*_ex);
216
cast = (*func)(((struct sidl_BaseClass__remote*)self->d_data)->d_ih, \
225
/* REMOTE DELETE: call the remote destructor for the object. */
226
static void remote_sidl_BaseClass__delete(
227
struct sidl_BaseClass__object* self,
228
struct sidl_BaseInterface__object* *_ex)
234
/* REMOTE GETURL: call the getURL function for the object. */
235
static char* remote_sidl_BaseClass__getURL(
236
struct sidl_BaseClass__object* self, struct sidl_BaseInterface__object* \
239
struct sidl_rmi_InstanceHandle__object *conn = ((struct \
240
sidl_BaseClass__remote*)self->d_data)->d_ih;
243
return sidl_rmi_InstanceHandle_getObjectURL(conn, _ex);
248
/* REMOTE ADDREF: For internal babel use only! Remote addRef. */
249
static void remote_sidl_BaseClass__raddRef(
250
struct sidl_BaseClass__object* self,struct sidl_BaseInterface__object* *_ex)
252
struct sidl_BaseException__object* netex = NULL;
253
/* initialize a new invocation */
254
struct sidl_BaseInterface__object* _throwaway = NULL;
255
struct sidl_rmi_InstanceHandle__object *_conn = ((struct \
256
sidl_BaseClass__remote*)self->d_data)->d_ih;
257
sidl_rmi_Response _rsvp = NULL;
258
sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation( _conn, \
259
"addRef", _ex ); SIDL_CHECK(*_ex);
260
/* send actual RMI request */
261
_rsvp = sidl_rmi_Invocation_invokeMethod(_inv,_ex);SIDL_CHECK(*_ex);
262
/* Check for exceptions */
263
netex = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);
265
*_ex = (struct sidl_BaseInterface__object*)netex;
269
/* cleanup and return */
271
if(_inv) { sidl_rmi_Invocation_deleteRef(_inv,&_throwaway); }
272
if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp,&_throwaway); }
276
/* REMOTE ISREMOTE: returns true if this object is Remote (it is). */
278
remote_sidl_BaseClass__isRemote(
279
struct sidl_BaseClass__object* self,
280
struct sidl_BaseInterface__object* *_ex) {
285
/* REMOTE METHOD STUB:_set_hooks */
287
remote_sidl_BaseClass__set_hooks(
288
/* in */ struct sidl_BaseClass__object *self ,
289
/* in */ sidl_bool on,
290
/* out */ struct sidl_BaseInterface__object * *_ex)
292
LANG_SPECIFIC_INIT();
295
/* initialize a new invocation */
296
struct sidl_BaseInterface__object* _throwaway = NULL;
297
sidl_BaseException _be = NULL;
298
sidl_rmi_Response _rsvp = NULL;
299
struct sidl_rmi_InstanceHandle__object * _conn = ((struct \
300
sidl_BaseClass__remote*)self->d_data)->d_ih;
301
sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation( \
302
_conn, "_set_hooks", _ex ); SIDL_CHECK(*_ex);
304
/* pack in and inout arguments */
305
sidl_rmi_Invocation_packBool( _inv, "on", on, _ex);SIDL_CHECK(*_ex);
307
/* send actual RMI request */
308
_rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);
310
_be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
312
struct sidl_BaseInterface__object* throwaway_exception = NULL;
313
sidl_BaseException_addLine(_be, "Exception unserialized from sidl.BaseClass._set_hooks.", &throwaway_exception);
314
*_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast( \
315
_be,&throwaway_exception);
319
/* unpack out and inout arguments */
321
/* cleanup and return */
323
if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
324
if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
329
/* REMOTE EXEC: call the exec function for the object. */
330
static void remote_sidl_BaseClass__exec(
331
struct sidl_BaseClass__object* self,const char* methodName,
332
sidl_rmi_Call inArgs,
333
sidl_rmi_Return outArgs,
334
struct sidl_BaseInterface__object* *_ex)
339
/* REMOTE METHOD STUB:addRef */
341
remote_sidl_BaseClass_addRef(
342
/* in */ struct sidl_BaseClass__object *self ,
343
/* out */ struct sidl_BaseInterface__object * *_ex)
345
LANG_SPECIFIC_INIT();
348
struct sidl_BaseClass__remote* r_obj = (struct \
349
sidl_BaseClass__remote*)self->d_data;
352
#ifdef SIDL_DEBUG_REFCOUNT
353
fprintf(stderr, "babel: addRef %p new count %d (type %s)\n",r_obj, r_obj->d_refcount, "sidl.BaseClass Remote Stub");
354
#endif /* SIDL_DEBUG_REFCOUNT */
355
UNLOCK_STATIC_GLOBALS;
359
/* REMOTE METHOD STUB:deleteRef */
361
remote_sidl_BaseClass_deleteRef(
362
/* in */ struct sidl_BaseClass__object *self ,
363
/* out */ struct sidl_BaseInterface__object * *_ex)
365
LANG_SPECIFIC_INIT();
368
struct sidl_BaseClass__remote* r_obj = (struct \
369
sidl_BaseClass__remote*)self->d_data;
372
#ifdef SIDL_DEBUG_REFCOUNT
373
fprintf(stderr, "babel: deleteRef %p new count %d (type %s)\n",r_obj, r_obj->d_refcount, "sidl.BaseClass Remote Stub");
374
#endif /* SIDL_DEBUG_REFCOUNT */
375
if(r_obj->d_refcount == 0) {
376
sidl_rmi_InstanceHandle_deleteRef(r_obj->d_ih, _ex);
380
UNLOCK_STATIC_GLOBALS;
384
/* REMOTE METHOD STUB:isSame */
386
remote_sidl_BaseClass_isSame(
387
/* in */ struct sidl_BaseClass__object *self ,
388
/* in */ struct sidl_BaseInterface__object* iobj,
389
/* out */ struct sidl_BaseInterface__object * *_ex)
391
LANG_SPECIFIC_INIT();
394
/* initialize a new invocation */
395
struct sidl_BaseInterface__object* _throwaway = NULL;
396
sidl_BaseException _be = NULL;
397
sidl_rmi_Response _rsvp = NULL;
398
sidl_bool _retval = FALSE;
399
struct sidl_rmi_InstanceHandle__object * _conn = ((struct \
400
sidl_BaseClass__remote*)self->d_data)->d_ih;
401
sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation( \
402
_conn, "isSame", _ex ); SIDL_CHECK(*_ex);
404
/* pack in and inout arguments */
406
char* _url = sidl_BaseInterface__getURL((sidl_BaseInterface)iobj, \
407
_ex);SIDL_CHECK(*_ex);
408
sidl_rmi_Invocation_packString( _inv, "iobj", _url, _ex);SIDL_CHECK( \
412
sidl_rmi_Invocation_packString( _inv, "iobj", NULL, _ex);SIDL_CHECK( \
416
/* send actual RMI request */
417
_rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);
419
_be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
421
struct sidl_BaseInterface__object* throwaway_exception = NULL;
422
sidl_BaseException_addLine(_be, "Exception unserialized from sidl.BaseClass.isSame.", &throwaway_exception);
423
*_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast( \
424
_be,&throwaway_exception);
428
/* extract return value */
429
sidl_rmi_Response_unpackBool( _rsvp, "_retval", &_retval, _ex);SIDL_CHECK(\
432
/* unpack out and inout arguments */
434
/* cleanup and return */
436
if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
437
if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
442
/* REMOTE METHOD STUB:isType */
444
remote_sidl_BaseClass_isType(
445
/* in */ struct sidl_BaseClass__object *self ,
446
/* in */ const char* name,
447
/* out */ struct sidl_BaseInterface__object * *_ex)
449
LANG_SPECIFIC_INIT();
452
/* initialize a new invocation */
453
struct sidl_BaseInterface__object* _throwaway = NULL;
454
sidl_BaseException _be = NULL;
455
sidl_rmi_Response _rsvp = NULL;
456
sidl_bool _retval = FALSE;
457
struct sidl_rmi_InstanceHandle__object * _conn = ((struct \
458
sidl_BaseClass__remote*)self->d_data)->d_ih;
459
sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation( \
460
_conn, "isType", _ex ); SIDL_CHECK(*_ex);
462
/* pack in and inout arguments */
463
sidl_rmi_Invocation_packString( _inv, "name", name, _ex);SIDL_CHECK(*_ex);
465
/* send actual RMI request */
466
_rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);
468
_be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
470
struct sidl_BaseInterface__object* throwaway_exception = NULL;
471
sidl_BaseException_addLine(_be, "Exception unserialized from sidl.BaseClass.isType.", &throwaway_exception);
472
*_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast( \
473
_be,&throwaway_exception);
477
/* extract return value */
478
sidl_rmi_Response_unpackBool( _rsvp, "_retval", &_retval, _ex);SIDL_CHECK(\
481
/* unpack out and inout arguments */
483
/* cleanup and return */
485
if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
486
if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
491
/* REMOTE METHOD STUB:getClassInfo */
492
static struct sidl_ClassInfo__object*
493
remote_sidl_BaseClass_getClassInfo(
494
/* in */ struct sidl_BaseClass__object *self ,
495
/* out */ struct sidl_BaseInterface__object * *_ex)
497
LANG_SPECIFIC_INIT();
500
/* initialize a new invocation */
501
struct sidl_BaseInterface__object* _throwaway = NULL;
502
sidl_BaseException _be = NULL;
503
sidl_rmi_Response _rsvp = NULL;
504
char*_retval_str = NULL;
505
struct sidl_ClassInfo__object* _retval = 0;
506
struct sidl_rmi_InstanceHandle__object * _conn = ((struct \
507
sidl_BaseClass__remote*)self->d_data)->d_ih;
508
sidl_rmi_Invocation _inv = sidl_rmi_InstanceHandle_createInvocation( \
509
_conn, "getClassInfo", _ex ); SIDL_CHECK(*_ex);
511
/* pack in and inout arguments */
513
/* send actual RMI request */
514
_rsvp = sidl_rmi_Invocation_invokeMethod(_inv, _ex);SIDL_CHECK(*_ex);
516
_be = sidl_rmi_Response_getExceptionThrown(_rsvp, _ex);SIDL_CHECK(*_ex);
518
struct sidl_BaseInterface__object* throwaway_exception = NULL;
519
sidl_BaseException_addLine(_be, "Exception unserialized from sidl.BaseClass.getClassInfo.", &throwaway_exception);
520
*_ex = (struct sidl_BaseInterface__object*) sidl_BaseInterface__cast( \
521
_be,&throwaway_exception);
525
/* extract return value */
526
sidl_rmi_Response_unpackString( _rsvp, "_retval", &_retval_str, \
527
_ex);SIDL_CHECK(*_ex);
528
_retval = sidl_ClassInfo__connectI(_retval_str, FALSE, _ex);SIDL_CHECK( \
531
/* unpack out and inout arguments */
533
/* cleanup and return */
535
if(_inv) { sidl_rmi_Invocation_deleteRef(_inv, &_throwaway); }
536
if(_rsvp) { sidl_rmi_Response_deleteRef(_rsvp, &_throwaway); }
541
/* REMOTE EPV: create remote entry point vectors (EPVs). */
542
static void sidl_BaseClass__init_remote_epv(void)
544
/* assert( HAVE_LOCKED_STATIC_GLOBALS ); */
545
struct sidl_BaseClass__epv* epv = &s_rem_epv__sidl_baseclass;
546
struct sidl_BaseInterface__epv* e0 = &s_rem_epv__sidl_baseinterface;
548
epv->f__cast = remote_sidl_BaseClass__cast;
549
epv->f__delete = remote_sidl_BaseClass__delete;
550
epv->f__exec = remote_sidl_BaseClass__exec;
551
epv->f__getURL = remote_sidl_BaseClass__getURL;
552
epv->f__raddRef = remote_sidl_BaseClass__raddRef;
553
epv->f__isRemote = remote_sidl_BaseClass__isRemote;
554
epv->f__set_hooks = remote_sidl_BaseClass__set_hooks;
556
epv->f__ctor2 = NULL;
558
epv->f_addRef = remote_sidl_BaseClass_addRef;
559
epv->f_deleteRef = remote_sidl_BaseClass_deleteRef;
560
epv->f_isSame = remote_sidl_BaseClass_isSame;
561
epv->f_isType = remote_sidl_BaseClass_isType;
562
epv->f_getClassInfo = remote_sidl_BaseClass_getClassInfo;
564
e0->f__cast = (void* (*)(void*,const char*, struct \
565
sidl_BaseInterface__object**)) epv->f__cast;
566
e0->f__delete = (void (*)(void*,struct sidl_BaseInterface__object**)) \
568
e0->f__getURL = (char* (*)(void*,struct sidl_BaseInterface__object**)) \
570
e0->f__raddRef = (void (*)(void*,struct sidl_BaseInterface__object**)) \
572
e0->f__isRemote = (sidl_bool (*)(void*,struct \
573
sidl_BaseInterface__object**)) epv->f__isRemote;
574
e0->f__set_hooks = (void (*)(void*,int32_t, struct \
575
sidl_BaseInterface__object**)) epv->f__set_hooks;
576
e0->f__exec = (void (*)(void*,const char*,struct \
577
sidl_rmi_Call__object*,struct sidl_rmi_Return__object*,struct \
578
sidl_BaseInterface__object **)) epv->f__exec;
579
e0->f_addRef = (void (*)(void*,struct sidl_BaseInterface__object **)) \
581
e0->f_deleteRef = (void (*)(void*,struct sidl_BaseInterface__object **)) \
583
e0->f_isSame = (sidl_bool (*)(void*,struct \
584
sidl_BaseInterface__object*,struct sidl_BaseInterface__object **)) \
586
e0->f_isType = (sidl_bool (*)(void*,const char*,struct \
587
sidl_BaseInterface__object **)) epv->f_isType;
588
e0->f_getClassInfo = (struct sidl_ClassInfo__object* (*)(void*,struct \
589
sidl_BaseInterface__object **)) epv->f_getClassInfo;
591
s_remote_initialized = 1;
594
/* Create an instance that connects to an existing remote object. */
595
static struct sidl_BaseClass__object*
596
sidl_BaseClass__remoteConnect(const char *url, sidl_bool ar, struct \
597
sidl_BaseInterface__object* *_ex)
599
struct sidl_BaseClass__object* self = NULL;
601
struct sidl_BaseClass__object* s0;
603
struct sidl_BaseClass__remote* r_obj = NULL;
604
sidl_rmi_InstanceHandle instance = NULL;
605
char* objectID = NULL;
608
if(url == NULL) {return NULL;}
609
objectID = sidl_rmi_ServerRegistry_isLocalObject(url, _ex);
611
struct sidl_BaseClass__object* retobj = NULL;
612
struct sidl_BaseInterface__object *throwaway_exception;
613
sidl_BaseInterface bi = ( \
614
sidl_BaseInterface)sidl_rmi_InstanceRegistry_getInstanceByString( \
615
objectID, _ex); SIDL_CHECK(*_ex);
616
(*bi->d_epv->f_deleteRef)(bi->d_object, &throwaway_exception);
617
retobj = (struct sidl_BaseClass__object*) (*bi->d_epv->f__cast)( \
618
bi->d_object, "sidl.BaseClass", _ex);
620
(*bi->d_epv->f_deleteRef)(bi->d_object, &throwaway_exception);
624
instance = sidl_rmi_ProtocolFactory_connectInstance(url, "sidl.BaseClass", \
625
ar, _ex ); SIDL_CHECK(*_ex);
626
if ( instance == NULL) { return NULL; }
628
(struct sidl_BaseClass__object*) malloc(
629
sizeof(struct sidl_BaseClass__object));
632
(struct sidl_BaseClass__remote*) malloc(
633
sizeof(struct sidl_BaseClass__remote));
635
if(!self || !r_obj) {
636
sidl_MemAllocException ex = sidl_MemAllocException_getSingletonException( \
639
sidl_MemAllocException_setNote(ex, "Out of memory.", _ex); SIDL_CHECK( \
641
sidl_MemAllocException_add(ex, __FILE__, __LINE__, \
642
"sidl.BaseClass.EPVgeneration", _ex);
644
*_ex = (struct sidl_BaseInterface__object*)ex;
648
r_obj->d_refcount = 1;
649
r_obj->d_ih = instance;
653
if (!s_remote_initialized) {
654
sidl_BaseClass__init_remote_epv();
656
UNLOCK_STATIC_GLOBALS;
658
s0->d_sidl_baseinterface.d_epv = &s_rem_epv__sidl_baseinterface;
659
s0->d_sidl_baseinterface.d_object = (void*) self;
661
s0->d_data = (void*) r_obj;
662
s0->d_epv = &s_rem_epv__sidl_baseclass;
664
self->d_data = (void*) r_obj;
668
if(self) { free(self); }
669
if(r_obj) { free(r_obj); }
672
/* Create an instance that uses an already existing */
673
/* InstanceHandle to connect to an existing remote object. */
674
static struct sidl_BaseClass__object*
675
sidl_BaseClass__IHConnect(sidl_rmi_InstanceHandle instance, struct \
676
sidl_BaseInterface__object* *_ex)
678
struct sidl_BaseClass__object* self = NULL;
680
struct sidl_BaseClass__object* s0;
682
struct sidl_BaseClass__remote* r_obj = NULL;
684
(struct sidl_BaseClass__object*) malloc(
685
sizeof(struct sidl_BaseClass__object));
688
(struct sidl_BaseClass__remote*) malloc(
689
sizeof(struct sidl_BaseClass__remote));
691
if(!self || !r_obj) {
692
sidl_MemAllocException ex = sidl_MemAllocException_getSingletonException( \
695
sidl_MemAllocException_setNote(ex, "Out of memory.", _ex); SIDL_CHECK( \
697
sidl_MemAllocException_add(ex, __FILE__, __LINE__, \
698
"sidl.BaseClass.EPVgeneration", _ex);
700
*_ex = (struct sidl_BaseInterface__object*)ex;
704
r_obj->d_refcount = 1;
705
r_obj->d_ih = instance;
709
if (!s_remote_initialized) {
710
sidl_BaseClass__init_remote_epv();
712
UNLOCK_STATIC_GLOBALS;
714
s0->d_sidl_baseinterface.d_epv = &s_rem_epv__sidl_baseinterface;
715
s0->d_sidl_baseinterface.d_object = (void*) self;
717
s0->d_data = (void*) r_obj;
718
s0->d_epv = &s_rem_epv__sidl_baseclass;
720
self->d_data = (void*) r_obj;
722
sidl_rmi_InstanceHandle_addRef(instance,_ex);SIDL_CHECK(*_ex);
725
if(self) { free(self); }
726
if(r_obj) { free(r_obj); }
729
/* REMOTE: generate remote instance given URL string. */
730
static struct sidl_BaseClass__object*
731
sidl_BaseClass__remoteCreate(const char *url, struct \
732
sidl_BaseInterface__object **_ex)
734
struct sidl_BaseInterface__object* _throwaway_exception = NULL;
735
struct sidl_BaseClass__object* self = NULL;
737
struct sidl_BaseClass__object* s0;
739
struct sidl_BaseClass__remote* r_obj = NULL;
740
sidl_rmi_InstanceHandle instance = sidl_rmi_ProtocolFactory_createInstance( \
741
url, "sidl.BaseClass", _ex ); SIDL_CHECK(*_ex);
742
if ( instance == NULL) { return NULL; }
744
(struct sidl_BaseClass__object*) malloc(
745
sizeof(struct sidl_BaseClass__object));
748
(struct sidl_BaseClass__remote*) malloc(
749
sizeof(struct sidl_BaseClass__remote));
751
if(!self || !r_obj) {
752
sidl_MemAllocException ex = sidl_MemAllocException_getSingletonException( \
755
sidl_MemAllocException_setNote(ex, "Out of memory.", _ex); SIDL_CHECK( \
757
sidl_MemAllocException_add(ex, __FILE__, __LINE__, \
758
"sidl.BaseClass.EPVgeneration", _ex);
760
*_ex = (struct sidl_BaseInterface__object*)ex;
764
r_obj->d_refcount = 1;
765
r_obj->d_ih = instance;
769
if (!s_remote_initialized) {
770
sidl_BaseClass__init_remote_epv();
772
UNLOCK_STATIC_GLOBALS;
774
s0->d_sidl_baseinterface.d_epv = &s_rem_epv__sidl_baseinterface;
775
s0->d_sidl_baseinterface.d_object = (void*) self;
777
s0->d_data = (void*) r_obj;
778
s0->d_epv = &s_rem_epv__sidl_baseclass;
780
self->d_data = (void*) r_obj;
784
if(instance) { sidl_rmi_InstanceHandle_deleteRef(instance, \
785
&_throwaway_exception); }
786
if(self) { free(self); }
787
if(r_obj) { free(r_obj); }
791
* RMI connector function for the class.
794
struct sidl_BaseClass__object*
795
sidl_BaseClass__connectI(const char* url, sidl_bool ar, struct \
796
sidl_BaseInterface__object **_ex)
798
return sidl_BaseClass__remoteConnect(url, ar, _ex);
806
pStub_BaseClass__connect(PyObject *_ignored, PyObject *_args, PyObject \
808
PyObject *_return_value = NULL;
809
struct sidl_BaseClass__object* self = NULL;
811
struct sidl_BaseInterface__object *_exception = NULL;
812
static char *_kwlist[] = {
817
sidl_rmi_NetworkException__import();
818
_okay = PyArg_ParseTupleAndKeywords(
823
self = sidl_BaseClass__remoteConnect(url,1,&_exception);
825
struct sidl_rmi_NetworkException__object *_ex0;
826
if ((_ex0 = (struct sidl_rmi_NetworkException__object *)
827
sidl_PyExceptionCast(_exception, "sidl.rmi.NetworkException"))) {
828
struct sidl_BaseInterface__object *throwaway_exception;
829
PyObject *_obj = sidl_rmi_NetworkException__wrap(_ex0);
830
PyObject *_eargs = PyTuple_New(1);
831
PyTuple_SetItem(_eargs, 0, _obj);
832
_obj = PyObject_CallObject(sidl_rmi_NetworkException__type, _eargs);
833
PyErr_SetObject(sidl_rmi_NetworkException__type, _obj);
835
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
836
&throwaway_exception);
841
_return_value = Py_BuildValue(
843
(void *)sidl_BaseClass__wrap, self);
846
return _return_value;
851
staticforward PyTypeObject _sidl_BaseClassType;
853
static const struct sidl_BaseClass__external *_implEPV = NULL;
856
pStub_BaseClass__exec(PyObject *_self, PyObject *_args, PyObject *_kwdict) {
857
PyObject *_return_value = NULL;
858
struct sidl_BaseClass__object *_self_ior =
859
((struct sidl_BaseClass__object *)
860
sidl_Cast(_self, "sidl.BaseClass"));
862
char* methodName = NULL;
863
struct sidl_rmi_Call__object* inArgs = NULL;
864
struct sidl_rmi_Return__object* outArgs = NULL;
865
struct sidl_BaseInterface__object *_exception = NULL;
866
static char *_kwlist[] = {
873
sidl_RuntimeException__import();
874
sidl_rmi_Call__import();
875
sidl_rmi_Return__import();
876
_okay = PyArg_ParseTupleAndKeywords(
880
(void *)sidl_rmi_Call__convert, &inArgs,
881
(void *)sidl_rmi_Return__convert, &outArgs);
883
(*(_self_ior->d_epv->f__exec))(_self_ior, methodName, inArgs, outArgs, \
886
struct sidl_RuntimeException__object *_ex0;
887
if ((_ex0 = (struct sidl_RuntimeException__object *)
888
sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
889
struct sidl_BaseInterface__object *throwaway_exception;
890
PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
891
PyObject *_eargs = PyTuple_New(1);
892
PyTuple_SetItem(_eargs, 0, _obj);
893
_obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
894
PyErr_SetObject(sidl_RuntimeException__type, _obj);
896
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
897
&throwaway_exception);
902
_return_value = Py_None;
903
Py_INCREF(_return_value);
905
sidl_rmi_Call_deref(inArgs);
906
sidl_rmi_Return_deref(outArgs);
909
struct sidl_BaseInterface__object *throwaway_exception;
910
(*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
914
PyErr_SetString(PyExc_TypeError,
915
"self pointer is not a sidl.BaseClass");
917
return _return_value;
921
pStub_BaseClass__getURL(PyObject *_self, PyObject *_args, PyObject *_kwdict) {
922
PyObject *_return_value = NULL;
923
struct sidl_BaseClass__object *_self_ior =
924
((struct sidl_BaseClass__object *)
925
sidl_Cast(_self, "sidl.BaseClass"));
927
struct sidl_BaseInterface__object *_exception = NULL;
928
static char *_kwlist[] = {
932
sidl_RuntimeException__import();
933
_okay = PyArg_ParseTupleAndKeywords(
937
char* _return = NULL;
938
_return = (*(_self_ior->d_epv->f__getURL))(_self_ior, &_exception);
940
struct sidl_RuntimeException__object *_ex0;
941
if ((_ex0 = (struct sidl_RuntimeException__object *)
942
sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
943
struct sidl_BaseInterface__object *throwaway_exception;
944
PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
945
PyObject *_eargs = PyTuple_New(1);
946
PyTuple_SetItem(_eargs, 0, _obj);
947
_obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
948
PyErr_SetObject(sidl_RuntimeException__type, _obj);
950
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
951
&throwaway_exception);
956
_return_value = Py_BuildValue(
959
free((void *)_return);
963
struct sidl_BaseInterface__object *throwaway_exception;
964
(*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
968
PyErr_SetString(PyExc_TypeError,
969
"self pointer is not a sidl.BaseClass");
971
return _return_value;
975
pStub_BaseClass__isLocal(PyObject *_self, PyObject *_args, PyObject *_kwdict) \
977
PyObject *_return_value = NULL;
978
struct sidl_BaseClass__object *_self_ior =
979
((struct sidl_BaseClass__object *)
980
sidl_Cast(_self, "sidl.BaseClass"));
982
struct sidl_BaseInterface__object *_exception = NULL;
983
static char *_kwlist[] = {
987
sidl_RuntimeException__import();
988
_okay = PyArg_ParseTupleAndKeywords(
992
sidl_bool _return = (sidl_bool) 0;
994
_return = !(*(_self_ior->d_epv->f__isRemote))(_self_ior, &_exception);
995
_proxy__return = _return;
997
struct sidl_RuntimeException__object *_ex0;
998
if ((_ex0 = (struct sidl_RuntimeException__object *)
999
sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
1000
struct sidl_BaseInterface__object *throwaway_exception;
1001
PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
1002
PyObject *_eargs = PyTuple_New(1);
1003
PyTuple_SetItem(_eargs, 0, _obj);
1004
_obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
1005
PyErr_SetObject(sidl_RuntimeException__type, _obj);
1007
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
1008
&throwaway_exception);
1013
_return_value = Py_BuildValue(
1019
struct sidl_BaseInterface__object *throwaway_exception;
1020
(*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
1024
PyErr_SetString(PyExc_TypeError,
1025
"self pointer is not a sidl.BaseClass");
1027
return _return_value;
1031
pStub_BaseClass__isRemote(PyObject *_self, PyObject *_args, PyObject \
1033
PyObject *_return_value = NULL;
1034
struct sidl_BaseClass__object *_self_ior =
1035
((struct sidl_BaseClass__object *)
1036
sidl_Cast(_self, "sidl.BaseClass"));
1038
struct sidl_BaseInterface__object *_exception = NULL;
1039
static char *_kwlist[] = {
1043
sidl_RuntimeException__import();
1044
_okay = PyArg_ParseTupleAndKeywords(
1048
sidl_bool _return = (sidl_bool) 0;
1050
_return = (*(_self_ior->d_epv->f__isRemote))(_self_ior, &_exception);
1051
_proxy__return = _return;
1053
struct sidl_RuntimeException__object *_ex0;
1054
if ((_ex0 = (struct sidl_RuntimeException__object *)
1055
sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
1056
struct sidl_BaseInterface__object *throwaway_exception;
1057
PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
1058
PyObject *_eargs = PyTuple_New(1);
1059
PyTuple_SetItem(_eargs, 0, _obj);
1060
_obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
1061
PyErr_SetObject(sidl_RuntimeException__type, _obj);
1063
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
1064
&throwaway_exception);
1069
_return_value = Py_BuildValue(
1075
struct sidl_BaseInterface__object *throwaway_exception;
1076
(*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
1080
PyErr_SetString(PyExc_TypeError,
1081
"self pointer is not a sidl.BaseClass");
1083
return _return_value;
1087
pStub_BaseClass__set_hooks(PyObject *_self, PyObject *_args, PyObject \
1089
PyObject *_return_value = NULL;
1090
struct sidl_BaseClass__object *_self_ior =
1091
((struct sidl_BaseClass__object *)
1092
sidl_Cast(_self, "sidl.BaseClass"));
1094
sidl_bool on = (sidl_bool) 0;
1095
struct sidl_BaseInterface__object *_exception = NULL;
1097
static char *_kwlist[] = {
1102
sidl_RuntimeException__import();
1103
_okay = PyArg_ParseTupleAndKeywords(
1108
on = (_proxy_on ? (TRUE) : (FALSE));
1109
(*(_self_ior->d_epv->f__set_hooks))(_self_ior, on, &_exception);
1111
struct sidl_RuntimeException__object *_ex0;
1112
if ((_ex0 = (struct sidl_RuntimeException__object *)
1113
sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
1114
struct sidl_BaseInterface__object *throwaway_exception;
1115
PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
1116
PyObject *_eargs = PyTuple_New(1);
1117
PyTuple_SetItem(_eargs, 0, _obj);
1118
_obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
1119
PyErr_SetObject(sidl_RuntimeException__type, _obj);
1121
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
1122
&throwaway_exception);
1127
_return_value = Py_None;
1128
Py_INCREF(_return_value);
1132
struct sidl_BaseInterface__object *throwaway_exception;
1133
(*(_self_ior->d_epv->f_deleteRef))(_self_ior, &throwaway_exception);
1137
PyErr_SetString(PyExc_TypeError,
1138
"self pointer is not a sidl.BaseClass");
1140
return _return_value;
1144
sidl_BaseClass_createCast(PyObject *self, PyObject *args, PyObject *kwds) {
1145
struct sidl_BaseClass__object *optarg = NULL;
1147
PyObject * implObj = NULL;
1148
static char *_kwlist[] = {"sobj", "url", "impl", NULL };
1149
int _okay = PyArg_ParseTupleAndKeywords(args, kwds, "|O&zO", _kwlist, (void \
1150
*)sidl_BaseClass__convert, &optarg, &url, &implObj);
1152
if (!optarg && !url && !implObj) {
1153
struct sidl_BaseInterface__object *_exception;
1154
optarg = (*(_implEPV->createObject))(NULL,&_exception);
1156
sidl_RuntimeException__import();
1158
struct sidl_RuntimeException__object *_ex0;
1159
if ((_ex0 = (struct sidl_RuntimeException__object *)
1160
sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
1161
struct sidl_BaseInterface__object *throwaway_exception;
1162
PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
1163
PyObject *_eargs = PyTuple_New(1);
1164
PyTuple_SetItem(_eargs, 0, _obj);
1165
_obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
1166
PyErr_SetObject(sidl_RuntimeException__type, _obj);
1168
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
1169
&throwaway_exception);
1176
else if (!optarg && !url && implObj) {
1177
struct sidl_BaseInterface__object *_exception;
1179
optarg = (*(_implEPV->createObject))((void*)implObj,&_exception);
1181
sidl_RuntimeException__import();
1183
struct sidl_RuntimeException__object *_ex0;
1184
if ((_ex0 = (struct sidl_RuntimeException__object *)
1185
sidl_PyExceptionCast(_exception, "sidl.RuntimeException"))) {
1186
struct sidl_BaseInterface__object *throwaway_exception;
1187
PyObject *_obj = sidl_RuntimeException__wrap(_ex0);
1188
PyObject *_eargs = PyTuple_New(1);
1189
PyTuple_SetItem(_eargs, 0, _obj);
1190
_obj = PyObject_CallObject(sidl_RuntimeException__type, _eargs);
1191
PyErr_SetObject(sidl_RuntimeException__type, _obj);
1193
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
1194
&throwaway_exception);
1204
else if(url && !optarg && !implObj) {
1205
struct sidl_BaseInterface__object *_exception = NULL;
1206
optarg = sidl_BaseClass__remoteCreate(url,&_exception);
1208
sidl_rmi_NetworkException__import();
1209
struct sidl_rmi_NetworkException__object *_ex0;
1210
if ((_ex0 = (struct sidl_rmi_NetworkException__object *)
1211
sidl_PyExceptionCast(_exception, "sidl.rmi.NetworkException"))) {
1212
struct sidl_BaseInterface__object *throwaway_exception;
1213
PyObject *_obj = sidl_rmi_NetworkException__wrap(_ex0);
1214
PyObject *_eargs = PyTuple_New(1);
1215
PyTuple_SetItem(_eargs, 0, _obj);
1216
_obj = PyObject_CallObject(sidl_rmi_NetworkException__type, _eargs);
1217
PyErr_SetObject(sidl_rmi_NetworkException__type, _obj);
1219
(*(_exception->d_epv->f_deleteRef))(_exception->d_object, \
1220
&throwaway_exception);
1229
/* OK, but fall though */
1230
else if(!url && optarg && !implObj) {}
1235
return sidl_Object_Init(
1237
(struct sidl_BaseInterface__object *)optarg,
1243
static PyMethodDef _BaseClassModuleMethods[] = {
1247
{ "_connect", (PyCFunction)pStub_BaseClass__connect,
1248
(METH_VARARGS | METH_KEYWORDS),
1250
_connect( in string url)\n\
1252
( out sidl.BaseClass self)\n\
1254
sidl.rmi.NetworkException\n\
1263
static PyMethodDef _BaseClassObjectMethods[] = {
1264
{ "_exec", (PyCFunction)pStub_BaseClass__exec,
1265
(METH_VARARGS | METH_KEYWORDS),
1267
_exec( in string methodName,\n\
1268
in sidl.rmi.Call inArgs,\n\
1269
in sidl.rmi.Return outArgs)\n\
1273
sidl.RuntimeException\n\
1276
Select and execute a method by name"
1278
{ "_getURL", (PyCFunction)pStub_BaseClass__getURL,
1279
(METH_VARARGS | METH_KEYWORDS),
1285
sidl.RuntimeException\n\
1288
Get the URL of the Implementation of this object (for RMI)"
1290
{ "_isLocal", (PyCFunction)pStub_BaseClass__isLocal,
1291
(METH_VARARGS | METH_KEYWORDS),
1297
sidl.RuntimeException\n\
1300
TRUE if this object is local, false if remote"
1302
{ "_isRemote", (PyCFunction)pStub_BaseClass__isRemote,
1303
(METH_VARARGS | METH_KEYWORDS),
1309
sidl.RuntimeException\n\
1312
TRUE if this object is remote, false if local"
1314
{ "_set_hooks", (PyCFunction)pStub_BaseClass__set_hooks,
1315
(METH_VARARGS | METH_KEYWORDS),
1317
_set_hooks( in bool on)\n\
1321
sidl.RuntimeException\n\
1324
Method to set whether or not method hooks should be invoked."
1329
static PyTypeObject _sidl_BaseClassType = {
1330
PyObject_HEAD_INIT(NULL)
1332
"sidl.BaseClass.BaseClass", /* tp_name */
1333
0, /* tp_basicsize */
1334
0, /* tp_itemsize */
1341
0, /* tp_as_number */
1342
0, /* tp_as_sequence */
1343
0, /* tp_as_mapping */
1347
0, /* tp_getattro */
1348
0, /* tp_setattro */
1349
0, /* tp_as_buffer */
1350
Py_TPFLAGS_DEFAULT, /* tp_flags */
1353
Every class implicitly inherits from <code>BaseClass</code>. This\n\
1354
class implements the methods in <code>BaseInterface</code>.", /* tp_doc */
1355
0, /* tp_traverse */
1357
0, /* tp_richcompare */
1358
0, /* tp_weaklistoffset */
1360
0, /* tp_iternext */
1361
_BaseClassObjectMethods, /* tp_methods */
1366
0, /* tp_descr_get */
1367
0, /* tp_descr_set */
1368
0, /* tp_dictoffset */
1369
sidl_BaseClass_createCast, /* tp_init */
1374
sidl_BaseClass__wrap_RETURN
1375
sidl_BaseClass__wrap sidl_BaseClass__wrap_PROTO {
1378
result = _sidl_BaseClassType.tp_new(&_sidl_BaseClassType, NULL, NULL);
1380
if (sidl_Object_Init(
1382
(struct sidl_BaseInterface__object *)(sidlobj),
1397
sidl_BaseClass__weakRef_RETURN
1398
sidl_BaseClass__weakRef sidl_BaseClass__weakRef_PROTO {
1401
result = _sidl_BaseClassType.tp_new(&_sidl_BaseClassType, NULL, NULL);
1403
if (sidl_Object_Init(
1405
(struct sidl_BaseInterface__object *)(sidlobj),
1420
sidl_BaseClass_deref_RETURN
1421
sidl_BaseClass_deref sidl_BaseClass_deref_PROTO {
1423
struct sidl_BaseInterface__object *throwaway_exception;
1424
(*(sidlobj->d_epv->f_deleteRef))(sidlobj, &throwaway_exception);
1428
sidl_BaseClass__newRef_RETURN
1429
sidl_BaseClass__newRef sidl_BaseClass__newRef_PROTO {
1432
result = _sidl_BaseClassType.tp_new(&_sidl_BaseClassType, NULL, NULL);
1434
if (sidl_Object_Init(
1436
(struct sidl_BaseInterface__object *)(sidlobj),
1451
sidl_BaseClass__addRef_RETURN
1452
sidl_BaseClass__addRef sidl_BaseClass__addRef_PROTO {
1454
struct sidl_BaseInterface__object *throwaway_exception;
1455
(*(sidlobj->d_epv->f_addRef))(sidlobj, &throwaway_exception);
1459
sidl_BaseClass_PyType_RETURN
1460
sidl_BaseClass_PyType sidl_BaseClass_PyType_PROTO {
1461
Py_INCREF(&_sidl_BaseClassType);
1462
return &_sidl_BaseClassType;
1465
sidl_BaseClass__convert_RETURN
1466
sidl_BaseClass__convert sidl_BaseClass__convert_PROTO {
1468
struct sidl_BaseInterface__object *throwaway_exception;
1469
(*((*sidlobj)->d_epv->f_deleteRef))((*sidlobj), &throwaway_exception);
1471
*sidlobj = sidl_Cast(obj, "sidl.BaseClass");
1472
if ((!(*sidlobj)) && (obj != Py_None)) {
1473
PyErr_SetString(PyExc_TypeError,
1474
"argument is not a(n) sidl.BaseClass");
1481
_convertPython(void *sidlarray, const int *ind, PyObject *pyobj)
1483
struct sidl_BaseClass__object *sidlobj = NULL;
1484
if (sidl_BaseClass__convert(pyobj, &sidlobj)) {
1485
sidl_interface__array_set((struct sidl_interface__array *)sidlarray,
1486
ind, (struct sidl_BaseInterface__object *)sidlobj);
1488
struct sidl_BaseInterface__object *asInt = (struct \
1489
sidl_BaseInterface__object *)sidlobj;
1490
struct sidl_BaseInterface__object *throwaway_exception;
1491
(*asInt->d_epv->f_deleteRef)(asInt->d_object, &throwaway_exception);
1498
sidl_BaseClass__convert_python_array_RETURN
1499
sidl_BaseClass__convert_python_array \
1500
sidl_BaseClass__convert_python_array_PROTO {
1503
sidl__array_deleteRef((struct sidl__array *)*sidlarray);
1506
if (obj == Py_None) {
1510
PyObject *pya = PyArray_FromObject(obj, PyArray_OBJECT, 0, 0);
1512
if (PyArray_OBJECT == ((PyArrayObject *)pya)->descr->type_num) {
1513
int dimen, lower[SIDL_MAX_ARRAY_DIMENSION],
1514
upper[SIDL_MAX_ARRAY_DIMENSION],
1515
stride[SIDL_MAX_ARRAY_DIMENSION];
1516
if (sidl_array__extract_python_info
1517
(pya, &dimen, lower, upper, stride))
1519
*sidlarray = (struct \
1520
sidl_BaseClass__array*)sidl_interface__array_createRow
1521
(dimen, lower, upper);
1522
result = sidl_array__convert_python
1523
(pya, dimen, *sidlarray, _convertPython);
1524
if (*sidlarray && !result) {
1525
sidl_interface__array_deleteRef(
1526
(struct sidl_interface__array *)*sidlarray);
1538
_convertSIDL(void *sidlarray, const int *ind, PyObject **dest)
1540
struct sidl_BaseClass__object *sidlobj = (struct sidl_BaseClass__object*)
1541
sidl_interface__array_get((struct sidl_interface__array *)
1543
*dest = sidl_BaseClass__wrap(sidlobj);
1544
return (*dest == NULL);
1547
sidl_BaseClass__convert_sidl_array_RETURN
1548
sidl_BaseClass__convert_sidl_array sidl_BaseClass__convert_sidl_array_PROTO {
1549
PyObject *pya = NULL;
1551
const int dimen = sidlArrayDim(sidlarray);
1557
int32_t s_numelem[7];
1559
int * const lower = (int *)(sidlarray->d_lower);
1560
int * const upper = (int *)(sidlarray->d_upper);
1561
int32_t * const s_numelem = numelem;
1564
for(i = 0; i < dimen; ++i) {
1565
start[i] = sidlLower(sidlarray, i);
1567
lower[i] = sidlLower(sidlarray, i);
1568
upper[i] = sidlUpper(sidlarray, i);
1569
s_numelem[i] = sidlLength(sidlarray, i);
1571
numelem[i] = 1 + upper[i] - lower[i];
1573
pya = PyArray_FromDims(dimen, numelem, PyArray_OBJECT);
1575
if (!sidl_array__convert_sidl(pya, dimen, start,
1577
s_numelem, sidlarray, _convertSIDL))
1592
initBaseClass(void) {
1593
PyObject *module, *dict, *c_api;
1594
static void *ExternalAPI[sidl_BaseClass__API_NUM];
1595
struct sidl_BaseInterface__object *throwaway_exception;
1596
module = Py_InitModule3("BaseClass", _BaseClassModuleMethods, "\
1598
Every class implicitly inherits from <code>BaseClass</code>. This\n\
1599
class implements the methods in <code>BaseInterface</code>."
1601
dict = PyModule_GetDict(module);
1602
ExternalAPI[sidl_BaseClass__wrap_NUM] = (void*)sidl_BaseClass__wrap;
1603
ExternalAPI[sidl_BaseClass__convert_NUM] = (void*)sidl_BaseClass__convert;
1604
ExternalAPI[sidl_BaseClass__convert_python_array_NUM] = ( \
1605
void*)sidl_BaseClass__convert_python_array;
1606
ExternalAPI[sidl_BaseClass__convert_sidl_array_NUM] = ( \
1607
void*)sidl_BaseClass__convert_sidl_array;
1608
ExternalAPI[sidl_BaseClass__weakRef_NUM] = (void*)sidl_BaseClass__weakRef;
1609
ExternalAPI[sidl_BaseClass_deref_NUM] = (void*)sidl_BaseClass_deref;
1610
ExternalAPI[sidl_BaseClass__newRef_NUM] = (void*)sidl_BaseClass__newRef;
1611
ExternalAPI[sidl_BaseClass__addRef_NUM] = (void*)sidl_BaseClass__addRef;
1612
ExternalAPI[sidl_BaseClass_PyType_NUM] = (void*)sidl_BaseClass_PyType;
1614
ExternalAPI[sidl_BaseClass__connectI_NUM] = (void*)sidl_BaseClass__connectI;
1617
if (PyErr_Occurred()) {
1618
Py_FatalError("Error importing sidlObjA module.");
1620
c_api = PyCObject_FromVoidPtr((void *)ExternalAPI, NULL);
1621
PyDict_SetItemString(dict, "_C_API", c_api);
1623
import_SIDLPyArrays();
1624
if (PyErr_Occurred()) {
1625
Py_FatalError("Error importing sidlPyArrays module.");
1628
if (PyErr_Occurred()) {
1629
Py_FatalError("Error importing Numeric Python module.");
1631
sidl_BaseInterface__import();
1632
_sidl_BaseClassType.tp_base = sidl_BaseInterface_PyType();
1633
_sidl_BaseClassType.tp_bases = PyTuple_New(1);
1634
PyTuple_SetItem(_sidl_BaseClassType.tp_bases,0, (PyObject \
1635
*)sidl_BaseInterface_PyType());
1636
if (PyType_Ready(&_sidl_BaseClassType) < 0) {
1638
fprintf(stderr, "PyType_Ready on sidl.BaseClass failed.\n");
1641
Py_INCREF(&_sidl_BaseClassType);
1642
PyDict_SetItemString(dict, "BaseClass", (PyObject *)&_sidl_BaseClassType);
1643
_implEPV = sidl_BaseClass__externals();
1645
Py_FatalError("Cannot load implementation for sidl class sidl.BaseClass");
1651
sidl_rmi_ConnectRegistry_registerConnect("sidl.BaseClass", ( \
1652
void*)sidl_BaseClass__IHConnect, &throwaway_exception);