# Stubs for "Test3"
#
# This file was automatically generated with ILU (version 2.0beta1) tools
# at Tue Sep 21 11:44:54 1999 by `nobody'
# running "c:/iluwin/bin/python-stubber.exe" of Tue Sep 21 10:50:35 1999
# on "C:/iluwin/examples/test1/Test3.isl" of Mon Sep 20 15:53:46 1999,
# and "C:/iluwin/examples/test1/Test1.isl" of Mon Sep 20 15:53:47 1999,
# and "C:/iluwin/examples/test1/Test2.isl" of Mon Sep 20 15:53:44 1999,
# and "c:/iluwin/interfaces/ilu.isl" of Mon Sep 20 15:51:47 1999.
#
# ILU is Copyright 1991-1999 Xerox Corporation, All Rights Reserved.
# ILU information:  ftp://ftp.parc.xerox.com/pub/ilu/ilu.html.

_imported_modules = {};
import iluRt ; _imported_modules['iluRt'] = iluRt; _imported_modules['ilu'] = iluRt;
iluRt.CheckStubConsistency('2.0beta1', 'v2 (post-2.0alpha12)');
_imported_modules['ilu__skel'] = iluRt
del iluRt
__types__={}

import Test1; _imported_modules['Test1'] = Test1; del Test1;
import Test2; _imported_modules['Test2'] = Test2; del Test2;
import iluRt

def _Input_FU(_call):
    _d = iluRt.InputUnion(_call, iluRt.TypeKind_enumeration)
    if _d == _imported_modules['Test1'].TheE.ev1:
	_value = (_d, iluRt.InputObjectID(_call, iluRt.FALSE, O))
    elif _d == _imported_modules['Test1'].TheE.ev3:
	_value = (_d, iluRt.InputInteger(_call))
    else:
	raise TypeError
    iluRt.EndUnion(_call)
    return _value

def _Output_FU(_call, _value):
    _d = _value[0]
    _value = _value[1]
    iluRt.OutputUnion(_call, _d, iluRt.TypeKind_enumeration)
    if _d == _imported_modules['Test1'].TheE.ev1:
	iluRt.OutputObjectID(_call, _value, iluRt.FALSE, O)
    elif _d == _imported_modules['Test1'].TheE.ev3:
	iluRt.OutputInteger(_call, _value)
    else:
	raise TypeError
    iluRt.EndUnion(_call)

def _SizeOf_FU(_call, _value):
    _d = _value[0]
    _value = _value[1]
    _size = iluRt.SizeOfUnion(_call, _d, iluRt.TypeKind_enumeration)
    if _d == _imported_modules['Test1'].TheE.ev1:
	_size = _size + iluRt.SizeOfObjectID(_call, _value, iluRt.FALSE, O)
    elif _d == _imported_modules['Test1'].TheE.ev3:
	_size = _size + iluRt.SizeOfInteger(_call, _value)
    else:
	raise TypeError
    iluRt.EndUnion(_call)
    return _size

__types__['FU'] = iluRt.RegisterUnionType(('Test3','FU',), None, 'ilut:epYJ46OVQhjZaO69Z6TuooNq1SJ', 'ilut:krAAJGDr0mWg96aGb8cRAqq6LEh', iluRt.TypeKind_enumeration, 0, 0, (('', 'ilut:hyreF7j+Bai+huUOV7umD2+sBxz', ('ev1',)), ('', 'ilut:ggrbg-q7UoqiAlNTWvqkwfZ4rlY', ('ev3',))))
iluRt.RegisterIoFuncs('ilut:epYJ46OVQhjZaO69Z6TuooNq1SJ', _Input_FU, _Output_FU, _SizeOf_FU, 'Test3.FU')

T2T1O3 = _imported_modules['Test1'].O3

__types__['T2T1O3'] = iluRt.RegisterAliasType(('Test3','T2T1O3',), None, 'ilut:elSuMj-IXsqZljGnWZRap7ZW64A', 'ilut:elSuMj-IXsqZljGnWZRap7ZW64A')
iluRt.NoteAlias('Test3.T2T1O3', 'ilut:elSuMj-IXsqZljGnWZRap7ZW64A', 'ilut:elSuMj-IXsqZljGnWZRap7ZW64A')

__types__['T2T1U3'] = iluRt.RegisterAliasType(('Test3','T2T1U3',), None, 'ilut:pJIIpHYTc0rbT9hGwYxGCgVtILs', 'ilut:pJIIpHYTc0rbT9hGwYxGCgVtILs')
iluRt.NoteAlias('Test3.T2T1U3', 'ilut:pJIIpHYTc0rbT9hGwYxGCgVtILs', 'ilut:pJIIpHYTc0rbT9hGwYxGCgVtILs')

class O(_imported_modules['Test1'].O3, _imported_modules['Test2'].P):
    _IluClass = iluRt.FormClassRecord(\
	'Test3.O',\
	'',\
	'ilut:hyreF7j+Bai+huUOV7umD2+sBxz',\
	None,\
	iluRt.FALSE,\
	iluRt.FALSE,\
	None,\
	(\
	    ('I-to-Test1U', 1, iluRt.FALSE, iluRt.FALSE, "ilut:gaYVCP7Kh4DScQISCVDQNadiFPZ", (('i', 0, 0, 'ilut:ggrbg-q7UoqiAlNTWvqkwfZ4rlY'),), (('ilu:Test3.E1', 'ilut:naKu7NwC1iaZkRZFKFBdxeuTiXv',), ('ilu:Test1.E1', 'ilut:gaYVCP7Kh4DScQISCVDQNadiFPZ',))),\
	),\
	(_imported_modules['Test1'].O3._IluClass, _imported_modules['Test2'].P._IluClass)\
	)

    def I_to_Test1U(_self, i):
	_result = None
	_call = iluRt.BeginCall(_self, O._IluClass, 1)
	try:
	    while 1:
	        iluRt.BeginRequest(_call,\
	          iluRt.SizeOfObjectID(_call, _self, iluRt.TRUE, O)\
	          + iluRt.SizeOfInteger(_call, i))
	        iluRt.OutputObjectID(_call, _self, iluRt.TRUE, O)
	        iluRt.OutputInteger(_call, i)
	        iluRt.FinishRequest(_call)
	        _ecode = iluRt.GetReply(_call)
	        if _ecode != iluRt.RetryCall: break
	    try:
	      if _ecode != 0:
		_CatchException(_call, O._IluClass, _ecode)
	      _result = _imported_modules['Test1']._Input_TheU(_call)
	    finally:
	      iluRt.ReplyRead(_call)
	finally:
	    iluRt.FinishCall(_call)
	return _result

__types__['O'] = iluRt.RegisterObjectType(O, ('Test3','O',), None, None)

E1__ExcnID = 'ilu:Test3.E1'
E1 = E1__ExcnID

def _CatchException(_call, _IluClass, _ecode):
    _value = None
    _name = iluRt.ExceptionName(_call, _IluClass, _ecode)
    if _name == E1__ExcnID:
	_name = E1
	_value = iluRt.InputString(_call, 0)
    elif _name == _imported_modules['Test1'].E1__ExcnID:
	_name = _imported_modules['Test1'].E1
	_value = _imported_modules['Test1']._Input_TheU(_call)
    raise _name, _value
