diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1997-11-12 00:39:28 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1997-11-12 00:39:28 +0000 |
commit | 2dfb5adcd3d89f375eef4e4afef598d1a66b6b24 (patch) | |
tree | 90d4baa11ba6804ff94dc730fef00bd14878bd06 /TAO/TAO_IDL | |
parent | 504b33f611ce54fee58f807864004843c7816b4b (diff) | |
download | ATCD-2dfb5adcd3d89f375eef4e4afef598d1a66b6b24.tar.gz |
new _bind, additional parameters to _narrow, use TAO_ENCAP_BYTE_ORDER
CVS:
CVS:
CVS:
CVS:
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/be/be_array.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_enum.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_interface.cpp | 43 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_sequence.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_structure.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_union.cpp | 2 |
7 files changed, 42 insertions, 13 deletions
diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp index 3d84b45a33d..4bfbb1b47c0 100644 --- a/TAO/TAO_IDL/be/be_array.cpp +++ b/TAO/TAO_IDL/be/be_array.cpp @@ -1209,7 +1209,7 @@ be_array::gen_encapsulation (void) // XXXASG - byte order must be based on what m/c we are generating code - // TODO - *os << "MY_BYTE_SEX, // byte order" << nl; + *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; // emit typecode of element type bt = be_type::narrow_from_decl (this->base_type ()); diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp index ef31c4fd083..a6d8b6ae843 100644 --- a/TAO/TAO_IDL/be/be_enum.cpp +++ b/TAO/TAO_IDL/be/be_enum.cpp @@ -255,7 +255,7 @@ be_enum::gen_encapsulation (void) // XXXASG - byte order must be based on what m/c we are generating code - // TODO - *cs << "MY_BYTE_SEX, // byte order" << nl; + *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; // generate repoID *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; (void)this->tc_name2long (this->repoID (), arr, arrlen); diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index f2d7c9b6fd3..724bb4ce63c 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -198,7 +198,7 @@ int be_interface::gen_client_header (void) *ch << "static " << local_name () << "_ptr " << "_duplicate (" << local_name () << "_ptr obj);" << nl; *ch << "static " << local_name () << "_ptr " << "_narrow (" << - "CORBA::Object_ptr obj);" << nl; + "CORBA::Object_ptr obj, CORBA::Environment &env);" << nl; *ch << "static " << local_name () << "_ptr " << "_nil (" << "void);" << nl; @@ -324,10 +324,9 @@ int be_interface::gen_client_stubs (void) // The _narrow method *cs << name () << "_ptr " << name () << - "::_narrow (CORBA::Object_ptr obj)" << nl; + "::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env)" << nl; *cs << "{\n"; cs->incr_indent (); - *cs << "CORBA::Environment env;" << nl; *cs << "if (CORBA::is_nil (obj)) return " << this->name () << "::_nil ();" << nl; *cs << "if (obj->_is_a (\"" << this->repoID () << "\", env))" << nl; @@ -372,20 +371,45 @@ int be_interface::gen_client_stubs (void) "CORBA::Environment &env)" << nl; *cs << "{\n"; cs->incr_indent (); +#if 0 *cs << "CORBA::ORB_ptr orb = 0;" << nl; - *cs << "CORBA::Object_ptr objref = CORBA::Object::_nil ();" << nl << nl; - *cs << "char IOR [256];" << nl; + *cs << "CORBA::Object_ptr objref = CORBA::Object::_nil ();" << nl; + *cs << "char IOR [TAO_MAXBUFSIZE];" << nl; + *cs << "size_t iorsize; // size of the actual IOR string" << nl; + *cs << "char *buffer; // holds the IOR\n"; + *cs << "#if defined (ACE_HAS_ALLOCA)" << nl; + *cs << "buffer = (char *) alloca (iorsize);\n"; + *cs << "#else" << nl; + *cs << "if (iorsize < TAO_MAXBUFSIZE)" << nl; + *cs << "\tbuffer = IOR; // use stack allocated storage" << nl; + *cs << "else" << nl; + *cs << "\tACE_NEW (buffer, char[size]);\n"; *cs << "orb = TAO_ORB_Core_instance ()->orb (); // access the ORB" << nl; *cs << "if (!orb) return " << this->name () << "::_nil (); // return null obj" << nl << nl; *cs << "ACE_OS::memset (IOR, '\\0', 256);" << nl; + // @@ XXXASG - What if we start supporting IIOP:1.1 *cs << "ACE_OS::sprintf (IOR, \"iiop:1.0//%s:%d/%s\", host, port, key);" << nl; *cs << "objref = orb->string_to_object (IOR, env);" << nl; +#endif + *cs << "CORBA::Object_ptr objref = CORBA::Object::_nil ();" << nl; + *cs << "IIOP_Object *data = new IIOP_Object (host, port, key);" << nl; + *cs << "if (!data) return " << this->name () << "::_nil ();" << nl; + *cs << "// get the object_ptr using Query Interface" << nl; + *cs << + "if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != NOERROR)" + << nl; + *cs << "{" << nl; + *cs << "\tenv.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));" + << nl; + *cs << "\treturn " << this->name () << "::_nil ();" << nl; + *cs << "}" << nl; + *cs << "data->Release (); // QueryInterface had bumped up our count" << nl; *cs << "if (CORBA::is_nil (objref))" << nl; *cs << "\treturn " << this->name () << "::_nil ();" << nl; *cs << "else // narrow it" << nl; - *cs << "\treturn " << this->name () << "::_narrow (objref);" << nl; + *cs << "\treturn " << this->name () << "::_narrow (objref, env);" << nl; cs->decr_indent (0); *cs << "}\n\n"; @@ -565,9 +589,11 @@ int be_interface::gen_server_skeletons (void) "// underlying ORB core instance" << nl; *ss << "CORBA::POA_ptr oa = TAO_ORB_Core_instance ()->root_poa (); " << "// underlying OA" << nl; + *ss << "const ACE_INET_Addr &addr = ocp->orb_params ()->addr ();" << nl; *ss << "this->optable_ = &tao_" << local_name () << "_optable;" << nl << nl; *ss << "// set up an IIOP object" << nl; +#if 0 *ss << "data = new IIOP_Object (CORBA::string_dup (repoID));" << nl; *ss << "data->profile.iiop_version.major = IIOP::MY_MAJOR;" << nl; *ss << "data->profile.iiop_version.minor = IIOP::MY_MINOR;" << nl; @@ -583,6 +609,9 @@ int be_interface::gen_server_skeletons (void) "new CORBA::Octet [(size_t)data->profile.object_key.length+1];" << nl; *ss << "ACE_OS::strcpy ((char *)data->profile.object_key.buffer, obj_name);" << " // set the object key" << nl; +#endif + *ss << "data = new IIOP_Object (CORBA::string_dup (repoID), addr, obj_name);" + << nl; *ss << "this->set_parent (data); // store the IIOP obj ref with us" << nl; *ss << "this->sub_ = this; // set the most derived type to be us" << nl; @@ -1293,7 +1322,7 @@ be_interface::gen_encapsulation (void) // XXXASG - byte order must be based on what m/c we are generating code - // TODO - *cs << "MY_BYTE_SEX, // byte order" << nl; + *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; // generate repoID *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; (void)this->tc_name2long (this->repoID (), arr, arrlen); diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index 2d7eee19cbc..663c3a2a768 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -1318,7 +1318,7 @@ be_sequence::gen_encapsulation (void) // XXXASG - byte order must be based on what m/c we are generating code - // TODO - *os << "MY_BYTE_SEX, // byte order" << nl; + *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; // emit typecode of element type bt = be_type::narrow_from_decl (this->base_type ()); diff --git a/TAO/TAO_IDL/be/be_state.cpp b/TAO/TAO_IDL/be/be_state.cpp index 878c3303118..160b13df689 100644 --- a/TAO/TAO_IDL/be/be_state.cpp +++ b/TAO/TAO_IDL/be/be_state.cpp @@ -973,7 +973,7 @@ be_state_operation::gen_code (be_type *bt, be_decl *d, be_type *type) break; case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: { - *os << "return " << bt->name () << "::_narrow (retval);" << nl; + *os << "return " << bt->name () << "::_narrow (retval, env);" << nl; } break; case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp index 3cb452ea2ee..0efbdef1eb4 100644 --- a/TAO/TAO_IDL/be/be_structure.cpp +++ b/TAO/TAO_IDL/be/be_structure.cpp @@ -783,7 +783,7 @@ be_structure::gen_encapsulation (void) // XXXASG - byte order must be based on what m/c we are generating code - // TODO - *cs << "MY_BYTE_SEX, // byte order" << nl; + *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; // generate repoID *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; (void)this->tc_name2long (this->repoID (), arr, arrlen); diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp index 90f84cb4e61..4210adda7b3 100644 --- a/TAO/TAO_IDL/be/be_union.cpp +++ b/TAO/TAO_IDL/be/be_union.cpp @@ -973,7 +973,7 @@ be_union::gen_encapsulation (void) // XXXASG - byte order must be based on what m/c we are generating code - // TODO - *cs << "MY_BYTE_SEX, // byte order" << nl; + *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; // generate repoID *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; (void)this->tc_name2long (this->repoID (), arr, arrlen); |