*** omniORB_2.5.0/src/tool/omniidl2/omniORB2_be/o2be_interface.cc Mon Mar 9 14:25:03 1998 --- new/src/tool/omniidl2/omniORB2_be/o2be_interface.cc Wed Jul 8 14:21:30 1998 *************** *** 1192,1198 **** IND(s); s << "private:\n"; INC_INDENT_LEVEL(); IND(s); s << lcproxy_uqname() << " *_orig_" << _fqname() << ";\n"; ! IND(s); s << objref_uqname() << " _actual_" << _fqname() << ";\n\n"; DEC_INDENT_LEVEL(); IND(s); s << "public:\n\n"; --- 1192,1198 ---- IND(s); s << "private:\n"; INC_INDENT_LEVEL(); IND(s); s << lcproxy_uqname() << " *_orig_" << _fqname() << ";\n"; ! IND(s); s << uqname() << "_var _actual_" << _fqname() << ";\n\n"; DEC_INDENT_LEVEL(); IND(s); s << "public:\n\n"; *************** *** 1242,1249 **** IND(s); s << "virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type = 0);\n"; IND(s); s << "virtual void _set_actual(CORBA::Object_ptr p);\n"; ! IND(s); s << wrapproxy_uqname() << "(" << lcproxy_uqname() << " *proxy);\n"; DEC_INDENT_LEVEL(); IND(s); s << "};\n\n"; --- 1242,1250 ---- IND(s); s << "virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type = 0);\n"; IND(s); s << "virtual void _set_actual(CORBA::Object_ptr p);\n"; ! IND(s); s << "void _set_proxy(" << lcproxy_uqname() << " *proxy);\n"; + IND(s); s << wrapproxy_uqname() << "() {}\n"; DEC_INDENT_LEVEL(); IND(s); s << "};\n\n"; *************** *** 1856,1861 **** --- 1857,1863 ---- IND(s); s << "}\n\n"; IND(s); s << "p->_set_wrap_" << _fqname() << "(w);\n"; + IND(s); s << "CORBA::release(p);\n"; IND(s); s << "return (CORBA::Object_ptr)w;\n"; DEC_INDENT_LEVEL(); IND(s); s << "}\n"; *************** *** 2141,2147 **** IND(s); s << home_fqname() << "::_release_actual()\n"; IND(s); s << "{\n"; INC_INDENT_LEVEL(); ! IND(s); s << "CORBA::release(_actual_" << _fqname() << ");"; { int ni,j; AST_Interface **intftable; --- 2143,2149 ---- IND(s); s << home_fqname() << "::_release_actual()\n"; IND(s); s << "{\n"; INC_INDENT_LEVEL(); ! IND(s); s << "CORBA::release(_actual_" << _fqname() << ");\n"; { int ni,j; AST_Interface **intftable; *************** *** 2232,2307 **** << " *proxy,Rope *r,CORBA::Octet *key,size_t keysize," << "IOP::TaggedProfileList *profiles,CORBA::Boolean release)" << " : omniObject(" << IRrepoId() ! << ",r,key,keysize,profiles,release)"; ! { ! int ni,j; ! AST_Interface **intftable; ! ni = n_inherits(); ! intftable = inherits(); ! for (j=0; j< ni; j++) ! { ! o2be_interface * intf = o2be_interface::narrow_from_decl(intftable[j]); ! char* intf_name = (char*)intf->unambiguous_wrapproxy_name(this); ! if (o2be_global::mflag()) { ! // MSVC {4.2,5.0} cannot deal with a call to a virtual member ! // of a base class using the member function's fully/partially ! // scoped name. Have to use the alias for the base class in the ! // global scope to refer to the virtual member function instead. ! if (strcmp(intf_name,intf->wrapproxy_uqname()) != 0) { ! intf_name = new char[strlen(intf->_scopename())+ ! strlen(intf->wrapproxy_uqname())+1]; ! strcpy(intf_name,intf->_scopename()); ! strcat(intf_name,intf->wrapproxy_uqname()); ! } ! } ! s << ", " << intf_name << "(proxy)"; ! } ! } ! s << "\n"; IND(s); s << "{\n"; INC_INDENT_LEVEL(); IND(s); s << "omni::objectIsReady(this);\n"; IND(s); s << "omni::objectDuplicate(proxy);\n"; ! IND(s); s << "_orig_" << _fqname() << " = proxy;\n"; ! IND(s); s << "_actual_" << _fqname() << " = " << fqname() ! << "::_duplicate(proxy);\n"; ! DEC_INDENT_LEVEL(); ! IND(s); s << "}\n\n"; ! ! IND(s); s << wrapproxy_fqname() << "::" << wrapproxy_uqname() ! << "(" << lcproxy_fqname() << " *proxy)"; ! { ! int ni,j; ! AST_Interface **intftable; ! ni = n_inherits(); ! intftable = inherits(); ! char *sep = " : "; ! for (j=0; j< ni; j++) ! { ! o2be_interface * intf = o2be_interface::narrow_from_decl(intftable[j]); ! char* intf_name = (char*)intf->unambiguous_wrapproxy_name(this); ! if (o2be_global::mflag()) { ! // MSVC {4.2,5.0} cannot deal with a call to a virtual member ! // of a base class using the member function's fully/partially ! // scoped name. Have to use the alias for the base class in the ! // global scope to refer to the virtual member function instead. ! if (strcmp(intf_name,intf->wrapproxy_uqname()) != 0) { ! intf_name = new char[strlen(intf->_scopename())+ ! strlen(intf->wrapproxy_uqname())+1]; ! strcpy(intf_name,intf->_scopename()); ! strcat(intf_name,intf->wrapproxy_uqname()); ! } ! } ! s << sep << intf_name << "(proxy)"; ! sep = ", "; ! } ! } ! s << "\n"; ! IND(s); s << "{\n"; ! INC_INDENT_LEVEL(); ! IND(s); s << "_orig_" << _fqname() << " = proxy;\n"; ! IND(s); s << "_actual_" << _fqname() << " = " << fqname() ! << "::_duplicate(proxy);\n"; DEC_INDENT_LEVEL(); IND(s); s << "}\n\n"; --- 2234,2245 ---- << " *proxy,Rope *r,CORBA::Octet *key,size_t keysize," << "IOP::TaggedProfileList *profiles,CORBA::Boolean release)" << " : omniObject(" << IRrepoId() ! << ",r,key,keysize,profiles,release)\n"; IND(s); s << "{\n"; INC_INDENT_LEVEL(); IND(s); s << "omni::objectIsReady(this);\n"; IND(s); s << "omni::objectDuplicate(proxy);\n"; ! IND(s); s << "_set_proxy(proxy);\n"; DEC_INDENT_LEVEL(); IND(s); s << "}\n\n"; *************** *** 2313,2320 **** INC_INDENT_LEVEL(); IND(s); s << "_unregister_wrap();\n"; DEC_INDENT_LEVEL(); - IND(s); s << "CORBA::release(_orig_" << _fqname() << ");\n"; - IND(s); s << "CORBA::release(_actual_" << _fqname() << ");\n"; DEC_INDENT_LEVEL(); IND(s); s << "}\n\n"; --- 2251,2256 ---- *************** *** 2348,2354 **** IND(s); s << wrapproxy_fqname() << "::_reset_proxy()\n"; IND(s); s << "{\n"; INC_INDENT_LEVEL(); - IND(s); s << "CORBA::release(_actual_" << _fqname() << ");\n"; IND(s); s << "_actual_" << _fqname() << " = " << fqname() << "::_duplicate(_orig_" << _fqname() << ");\n"; { --- 2284,2289 ---- *************** *** 2401,2407 **** IND(s); s << wrapproxy_fqname() << "::_set_actual(CORBA::Object_ptr p)\n"; IND(s); s << "{\n"; INC_INDENT_LEVEL(); - IND(s); s << "CORBA::release(_actual_" << _fqname() << ");\n"; IND(s); s << "_actual_" << _fqname() << " = " << fqname() << "::_narrow(p);\n"; { --- 2336,2341 ---- *************** *** 2430,2435 **** --- 2364,2406 ---- } DEC_INDENT_LEVEL(); IND(s); s << "}\n\n"; + + // _set_proxy: + IND(s); s << "void\n"; + IND(s); s << wrapproxy_fqname() << "::_set_proxy(" + << lcproxy_fqname() << " *proxy)\n"; + IND(s); s << "{\n"; + INC_INDENT_LEVEL(); + IND(s); s << "_orig_" << _fqname() << " = proxy;\n"; + IND(s); s << "_actual_" << _fqname() << " = " << fqname() + << "::_duplicate(proxy);\n"; + { + int ni,j; + AST_Interface **intftable; + ni = n_inherits(); + intftable = inherits(); + for (j=0; j< ni; j++) + { + o2be_interface * intf = o2be_interface::narrow_from_decl(intftable[j]); + char* intf_name = (char*)intf->unambiguous_wrapproxy_name(this); + if (o2be_global::mflag()) { + // MSVC {4.2,5.0} cannot deal with a call to a virtual member + // of a base class using the member function's fully/partially + // scoped name. Have to use the alias for the base class in the + // global scope to refer to the virtual member function instead. + if (strcmp(intf_name,intf->wrapproxy_uqname()) != 0) { + intf_name = new char[strlen(intf->_scopename())+ + strlen(intf->wrapproxy_uqname())+1]; + strcpy(intf_name,intf->_scopename()); + strcat(intf_name,intf->wrapproxy_uqname()); + } + } + IND(s); s << intf_name << "::_set_proxy(proxy);\n"; + } + } + DEC_INDENT_LEVEL(); + IND(s); s << "}\n"; + s << "\n// *** End of LifeCycle stuff\n\n"; }