diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-09-15 19:27:20 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-09-15 19:27:20 +0000 |
commit | 7b57a5a4c1f6ef0b8c5f8ccd82a7759cd2f5a4c0 (patch) | |
tree | 3a99b3629b99a0b9145fbe3cba94fc65e7bc5b16 | |
parent | 671a15f6d25efa7ba2e6eefbb9ccd46580296852 (diff) | |
download | ATCD-7b57a5a4c1f6ef0b8c5f8ccd82a7759cd2f5a4c0.tar.gz |
ChangeLogTag: Wed Sep 15 19:26:33 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
36 files changed, 400 insertions, 193 deletions
diff --git a/ChangeLog b/ChangeLog index cc6a7e8e9a7..e5a61e05378 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,45 @@ +Wed Sep 15 19:26:33 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> + + * orbsvcs/orbsvcs/RTEvent.mpc: + * orbsvcs/orbsvcs/Event_Utilities.cpp: + * TAO_IDL/be/be_visitor_interface/interface_ch.cpp: + * TAO_IDL/be/be_visitor_interface/interface_cs.cpp: + * TAO_IDL/be/be_visitor_interface/interface_sh.cpp: + * TAO_IDL/be/be_visitor_interface/interface_ss.cpp: + * TAO_IDL/be/be_codegen.cpp: + * TAO_IDL/be/be_interface.cpp: + * tao/CORBANAME_Parser.cpp: + * tao/PolicyC.cpp: + * tao/PolicyC.h: + * tao/PortableServer/Basic_SArguments.h: + * tao/Object_KeyC.h: + * tao/Messaging.mpc: + * tao/Object.h: + * tao/Messaging/ExceptionHolder_i.cpp: + * tao/Messaging/Asynch_Reply_Dispatcher.cpp: + * tao/Messaging/ExceptionHolder_i.h: + * tao/Messaging/AMH_Response_Handler.cpp: + * tao/BiDir_GIOP/BiDir_Service_Context_Handler.cpp: + * tao/PI/ORBInitInfo.cpp: + * tao/PI/RequestInfo_Util.h: + * tao/PI/Interceptor_List_T.cpp: + * tao/PI/ORBInitInfo.h: + * tao/PI/ClientRequestDetails.cpp: + * tao/PI/RequestInfo_Util.cpp: + * tao/PI/ClientRequestInfo.h: + * tao/PI/Interceptor_List_T.h: + * tao/PI/ClientRequestInfo.cpp: + * tao/CodecFactory.mpc: + * tao/Object_T.cpp: + * tao/PI.mpc: + * tao/Object.cpp: + * tao/CodecFactory/CDR_Encaps_Codec.cpp: + * tao/CodecFactory/CDR_Encaps_Codec.h: + + More changes to support the alternatie IDL->C++ + mapping. The changes above allow clean builds + of the Portable Interceptor and Messaging libs. + Tue Sep 7 16:00:49 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * tests/Alt_Mapping/ub_long_seq.h: diff --git a/TAO_IDL/be/be_codegen.cpp b/TAO_IDL/be/be_codegen.cpp index 9fa44f72054..4ce270982a3 100644 --- a/TAO_IDL/be/be_codegen.cpp +++ b/TAO_IDL/be/be_codegen.cpp @@ -3234,8 +3234,10 @@ TAO_CodeGen::gen_stub_arg_file_includes (TAO_OutStream * stream) void TAO_CodeGen::gen_skel_arg_file_includes (TAO_OutStream * stream) { + // Also triggered by interface, for _is_a() std::string arg. this->gen_cond_file_include ( - idl_global->basic_arg_seen_, + idl_global->basic_arg_seen_ + || idl_global->non_local_iface_seen_, "tao/PortableServer/Basic_SArguments.h", stream ); diff --git a/TAO_IDL/be/be_interface.cpp b/TAO_IDL/be/be_interface.cpp index bf414c03ce7..8f260ee0bd0 100644 --- a/TAO_IDL/be/be_interface.cpp +++ b/TAO_IDL/be/be_interface.cpp @@ -2161,10 +2161,18 @@ be_interface::is_a_helper (be_interface * /*derived*/, TAO_OutStream *os) { // Emit the comparison code. - *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl - << "value," << be_nl - << "\"" << bi->repoID () << "\"" << be_uidt_nl - << ") == 0 ||" << be_uidt_nl; + if (be_global->alt_mapping ()) + { + *os << "value == \"" << bi->repoID () << "\" ||" + << be_nl; + } + else + { + *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl + << "value," << be_nl + << "\"" << bi->repoID () << "\"" << be_uidt_nl + << ") == 0 ||" << be_uidt_nl; + } return 0; } @@ -3037,19 +3045,35 @@ be_interface::gen_is_a_ancestors (TAO_OutStream *os) if (this->is_abstract () || this->has_mixed_parentage ()) { - *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl - << "value," << be_nl - << "\"IDL:omg.org/CORBA/AbstractBase:1.0\"" << be_uidt_nl - << ") == 0"; + if (be_global->alt_mapping ()) + { + *os << "value == \"IDL:omg.org/CORBA/AbstractBase:1.0\" ||" + << be_nl; + } + else + { + *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl + << "value," << be_nl + << "\"IDL:omg.org/CORBA/AbstractBase:1.0\"" << be_uidt_nl + << ") == 0 ||" << be_uidt_nl; + } } else if (this->is_local ()) { - *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl - << "value," << be_nl - << "\"IDL:omg.org/CORBA/LocalObject:1.0\"" << be_uidt_nl - << ") == 0"; + if (be_global->alt_mapping ()) + { + *os << "value == \"IDL:omg.org/CORBA/LocalObject:1.0\" ||" + << be_nl; + } + else + { + *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl + << "value," << be_nl + << "\"IDL:omg.org/CORBA/LocalObject:1.0\"" << be_uidt_nl + << ") == 0 ||" << be_uidt_nl; + } } - +/* if (this->has_mixed_parentage () || this->is_local ()) { *os << " ||" << be_uidt_nl; @@ -3058,13 +3082,21 @@ be_interface::gen_is_a_ancestors (TAO_OutStream *os) { *os << be_uidt << be_uidt_nl; } - +*/ if (! this->is_abstract ()) { - *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl - << "value," << be_nl - << "\"IDL:omg.org/CORBA/Object:1.0\"" << be_uidt_nl - << ") == 0" << be_uidt << be_uidt_nl; + if (be_global->alt_mapping ()) + { + *os << "value == \"IDL:omg.org/CORBA/Object:1.0\"" + << be_nl; + } + else + { + *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl + << "value," << be_nl + << "\"IDL:omg.org/CORBA/Object:1.0\"" << be_uidt_nl + << ") == 0" << be_uidt << be_uidt_nl; + } } return 0; diff --git a/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO_IDL/be/be_visitor_interface/interface_ch.cpp index 710d1129c4c..de558db4e48 100644 --- a/TAO_IDL/be/be_visitor_interface/interface_ch.cpp +++ b/TAO_IDL/be/be_visitor_interface/interface_ch.cpp @@ -172,8 +172,9 @@ be_visitor_interface_ch::visit_interface (be_interface *node) } // The _is_a method - *os << "virtual ::CORBA::Boolean _is_a (const char *type_id);" - << be_nl; + *os << "virtual ::CORBA::Boolean _is_a (const " + << (be_global->alt_mapping () ? "std::string " : "char *") + << "type_id);" << be_nl; // The _interface_repository_id method. *os << "virtual const char* _interface_repository_id " diff --git a/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO_IDL/be/be_visitor_interface/interface_cs.cpp index 9d77aaf5b04..ad466d52b82 100644 --- a/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -329,7 +329,9 @@ be_visitor_interface_cs::visit_interface (be_interface *node) } *os << "::CORBA::Boolean" << be_nl - << node->full_name () << "::_is_a (const char *value)" << be_nl; + << node->full_name () << "::_is_a (const " + << (be_global->alt_mapping () ? "std::string " : "char *") + << "value)" << be_nl; *os << "{" << be_idt_nl << "if (" << be_idt << be_idt_nl; @@ -345,7 +347,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) -1); } - *os << ")" << be_nl + *os << ")" << be_uidt_nl << "{" << be_idt_nl << "return true; // success using local knowledge" << be_uidt_nl << "}" << be_uidt_nl diff --git a/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO_IDL/be/be_visitor_interface/interface_sh.cpp index e4cc2609d0a..dc156ed15fd 100644 --- a/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -127,7 +127,9 @@ be_visitor_interface_sh::visit_interface (be_interface *node) << "virtual ~" << class_name.c_str () << " (void);" << be_nl << be_nl; // _is_a - *os << "virtual ::CORBA::Boolean _is_a (const char* logical_type_id);" << be_nl << be_nl; + *os << "virtual ::CORBA::Boolean _is_a (const " + << (be_global->alt_mapping () ? "std::string " : "char *") + << "logical_type_id);" << be_nl << be_nl; // Add a skeleton for our _is_a method. *os << "static void _is_a_skel (" << be_idt << be_idt_nl diff --git a/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index e3e186606f3..84b54614e95 100644 --- a/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -681,7 +681,9 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << be_nl << be_nl << "::CORBA::Boolean " << full_skel_name - << "::_is_a (const char* value)" << be_nl + << "::_is_a (const " + << (be_global->alt_mapping () ? "std::string " : "char *") + << "value)" << be_nl << "{" << be_idt_nl << "return" << be_idt_nl << "(" << be_idt_nl; @@ -696,22 +698,39 @@ be_visitor_interface_ss::visit_interface (be_interface *node) -1); } - *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl - << "value," << be_nl - << "\"IDL:omg.org/CORBA/Object:1.0\"" << be_uidt_nl - << ")"; + +// *os << " ||" << be_nl; + + if (be_global->alt_mapping ()) + { + *os << "value == \"IDL:omg.org/CORBA/Object:1.0\""; + } + else + { + *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl + << "value," << be_nl + << "\"IDL:omg.org/CORBA/Object:1.0\"" << be_uidt_nl + << ") == 0 ||" << be_uidt_nl; + } if (node->has_mixed_parentage ()) { - *os << " ||" << be_uidt_nl - << "!ACE_OS::strcmp (" << be_idt << be_idt_nl - << "(char *)value," << be_nl - << "\"IDL:omg.org/CORBA/AbstractBase:1.0\"" - << be_uidt_nl - << ")"; + *os << " ||" << be_uidt_nl; + + if (be_global->alt_mapping ()) + { + *os << "value == \"IDL:omg.org/CORBA/AbstractBase:1.0\""; + } + else + { + *os << "ACE_OS::strcmp (" << be_idt << be_idt_nl + << "value," << be_nl + << "\"IDL:omg.org/CORBA/AbstractBase:1.0\"" << be_uidt_nl + << ") == 0 ||" << be_uidt_nl; + } } - *os << be_uidt << be_uidt_nl + *os << be_uidt_nl << ");" << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; diff --git a/orbsvcs/orbsvcs/Event_Utilities.cpp b/orbsvcs/orbsvcs/Event_Utilities.cpp index 0c44bea3fd1..10675726fff 100644 --- a/orbsvcs/orbsvcs/Event_Utilities.cpp +++ b/orbsvcs/orbsvcs/Event_Utilities.cpp @@ -30,8 +30,8 @@ ACE_ConsumerQOS_Factory::~ACE_ConsumerQOS_Factory (void) int ACE_ConsumerQOS_Factory::start_conjunction_group (int nchildren) { - int l = qos_.dependencies.length (); - qos_.dependencies.length (l + 1); + int l = qos_.dependencies.size (); + qos_.dependencies.resize (l + 1); if (this->event_initializer_ != 0) (*this->event_initializer_) (qos_.dependencies[l].event); qos_.dependencies[l].event.header.type = ACE_ES_CONJUNCTION_DESIGNATOR; @@ -44,8 +44,8 @@ ACE_ConsumerQOS_Factory::start_conjunction_group (int nchildren) int ACE_ConsumerQOS_Factory::start_disjunction_group (int nchildren) { - int l = qos_.dependencies.length (); - qos_.dependencies.length (l + 1); + int l = qos_.dependencies.size (); + qos_.dependencies.resize (l + 1); if (this->event_initializer_ != 0) (*this->event_initializer_) (qos_.dependencies[l].event); qos_.dependencies[l].event.header.type = ACE_ES_DISJUNCTION_DESIGNATOR; @@ -58,8 +58,8 @@ ACE_ConsumerQOS_Factory::start_disjunction_group (int nchildren) int ACE_ConsumerQOS_Factory::start_logical_and_group (int nchildren) { - int l = qos_.dependencies.length (); - qos_.dependencies.length (l + 1); + int l = qos_.dependencies.size (); + qos_.dependencies.resize (l + 1); if (this->event_initializer_ != 0) (*this->event_initializer_) (qos_.dependencies[l].event); qos_.dependencies[l].event.header.type = ACE_ES_LOGICAL_AND_DESIGNATOR; @@ -72,8 +72,8 @@ ACE_ConsumerQOS_Factory::start_logical_and_group (int nchildren) int ACE_ConsumerQOS_Factory::start_negation (void) { - int l = qos_.dependencies.length (); - qos_.dependencies.length (l + 1); + int l = qos_.dependencies.size (); + qos_.dependencies.resize (l + 1); if (this->event_initializer_ != 0) (*this->event_initializer_) (qos_.dependencies[l].event); qos_.dependencies[l].event.header.type = ACE_ES_NEGATION_DESIGNATOR; @@ -86,8 +86,8 @@ int ACE_ConsumerQOS_Factory::start_bitmask (CORBA::ULong source_mask, CORBA::ULong type_mask) { - int l = qos_.dependencies.length (); - qos_.dependencies.length (l + 2); + int l = qos_.dependencies.size (); + qos_.dependencies.resize (l + 2); if (this->event_initializer_ != 0) { (*this->event_initializer_) (qos_.dependencies[l].event); @@ -110,8 +110,8 @@ ACE_ConsumerQOS_Factory::insert (const RtecEventChannelAdmin::Dependency &subscr // Make sure that a designator is first. if (designator_set_ == 0) { - int l = qos_.dependencies.length (); - qos_.dependencies.length (l + 1); + int l = qos_.dependencies.size (); + qos_.dependencies.resize (l + 1); if (this->event_initializer_ != 0) (*this->event_initializer_) (qos_.dependencies[l].event); qos_.dependencies[l].rt_info = 0; @@ -120,8 +120,8 @@ ACE_ConsumerQOS_Factory::insert (const RtecEventChannelAdmin::Dependency &subscr this->designator_set_ = 1; } - int l = qos_.dependencies.length (); - qos_.dependencies.length (l + 1); + int l = qos_.dependencies.size (); + qos_.dependencies.resize (l + 1); qos_.dependencies[l] = subscribe; return 0; } @@ -143,7 +143,7 @@ ACE_ConsumerQOS_Factory::debug (const RtecEventChannelAdmin::ConsumerQOS& qos) ACE_DEBUG ((LM_DEBUG, "ConsumerQOS {\n")); ACE_DEBUG ((LM_DEBUG, " is_gateway: %d\n", qos.is_gateway)); - for (u_int i = 0; i < qos.dependencies.length (); ++i) + for (u_int i = 0; i < qos.dependencies.size (); ++i) { char buf[128]; ACE_OS::sprintf (buf, " dep[%d]", i); @@ -163,11 +163,11 @@ ACE_SupplierQOS_Factory:: qos_.is_gateway = 0; // Allocate the space requested by the application.... - qos_.publications.length (qos_max_len); + qos_.publications.reserve (qos_max_len); // ... now reset the length, we do not want to use any elements in // the sequence that have not been initialized.... - qos_.publications.length (0); + qos_.publications.resize (0); } int @@ -176,12 +176,12 @@ ACE_SupplierQOS_Factory::insert (RtecEventComm::EventSourceID sid, RtecBase::handle_t rt_info, u_int ncalls) { - CORBA::ULong l = this->qos_.publications.length (); - if (l >= this->qos_.publications.maximum ()) + CORBA::ULong l = this->qos_.publications.size (); + if (l >= this->qos_.publications.capacity ()) { // There is not enough space for the next element, grow the // buffer. - this->qos_.publications.length (l + 1); + this->qos_.publications.resize (l + 1); // @@ TODO We may want to consider more efficient growing // strategies here, for example, duplicating the size of the @@ -203,7 +203,7 @@ void ACE_SupplierQOS_Factory::debug (const RtecEventChannelAdmin::SupplierQOS& q ACE_DEBUG ((LM_DEBUG, "SupplierQOS {\n")); ACE_DEBUG ((LM_DEBUG, " is_gateway: %d\n", qos.is_gateway)); - for (u_int i = 0; i < qos.publications.length (); ++i) + for (u_int i = 0; i < qos.publications.size (); ++i) { char buf[128] = { 0 }; ACE_OS::sprintf (buf, " publications[%d]", i); diff --git a/orbsvcs/orbsvcs/RTEvent.mpc b/orbsvcs/orbsvcs/RTEvent.mpc index 170b7970027..ed71e741c86 100644 --- a/orbsvcs/orbsvcs/RTEvent.mpc +++ b/orbsvcs/orbsvcs/RTEvent.mpc @@ -3,7 +3,11 @@ project(RTEvent) : orbsvcslib, orbsvcs_output, install, svc_utils, tao_versioning_idl_defaults { sharedname = TAO_RTEvent - idlflags += -GT -Wb,stub_export_macro=TAO_RTEvent_Export -Wb,stub_export_include=orbsvcs/Event/event_export.h -Wb,skel_export_macro=TAO_RTEvent_Skel_Export -Wb,skel_export_include=orbsvcs/Event/event_skel_export.h + idlflags += -GT -Gstl \ + -Wb,stub_export_macro=TAO_RTEvent_Export \ + -Wb,stub_export_include=orbsvcs/Event/event_export.h \ + -Wb,skel_export_macro=TAO_RTEvent_Skel_Export \ + -Wb,skel_export_include=orbsvcs/Event/event_skel_export.h dynamicflags += TAO_RTEVENT_BUILD_DLL tagchecks += RTEvent diff --git a/tao/BiDir_GIOP/BiDir_Service_Context_Handler.cpp b/tao/BiDir_GIOP/BiDir_Service_Context_Handler.cpp index 447b62f147e..556ca10a793 100644 --- a/tao/BiDir_GIOP/BiDir_Service_Context_Handler.cpp +++ b/tao/BiDir_GIOP/BiDir_Service_Context_Handler.cpp @@ -21,9 +21,12 @@ TAO_BiDIR_Service_Context_Handler::process_service_context ( TAO_Transport& transport, const IOP::ServiceContext& context) { - TAO_InputCDR cdr (reinterpret_cast<const char*> ( - context.context_data.get_buffer ()), - context.context_data.length ()); + TAO_InputCDR cdr ( + reinterpret_cast<const char*> ( + context.context_data.get_allocator ().address ( + *context.context_data.begin ())), + context.context_data.size ()); + return transport.tear_listen_point_list (cdr); } diff --git a/tao/CORBANAME_Parser.cpp b/tao/CORBANAME_Parser.cpp index 37b9bee2adc..da944772902 100644 --- a/tao/CORBANAME_Parser.cpp +++ b/tao/CORBANAME_Parser.cpp @@ -110,8 +110,9 @@ TAO_CORBANAME_Parser::parse_string (const char *ior, CORBA::ORB_ptr orb) "Cannot resolve Naming Service: CORBANAME_Parser\n"), 0); + std::string type_id ("IDL:omg.org/CosNaming/NamingContextExt:1.0"); CORBA::Boolean is_a = - name_context->_is_a ("IDL:omg.org/CosNaming/NamingContextExt:1.0"); + name_context->_is_a (type_id); if (!is_a) { diff --git a/tao/CodecFactory.mpc b/tao/CodecFactory.mpc index dc71640d7a2..a79b7fa9c06 100644 --- a/tao/CodecFactory.mpc +++ b/tao/CodecFactory.mpc @@ -2,7 +2,7 @@ project(*idl) : tao_versioning_idl_defaults, install { custom_only = 1 IDL_Files { - idlflags += -Gp -Gd -Sci -SS -Sorb -Sal -GX \ + idlflags += -Gp -Gd -Sci -SS -Sorb -Sal -GX -Gstl \ -Wb,export_macro=TAO_CodecFactory_Export \ -Wb,export_include=tao/CodecFactory/codecfactory_export.h \ -Wb,include_guard=TAO_CODECFACTORY_SAFE_INCLUDE \ diff --git a/tao/CodecFactory/CDR_Encaps_Codec.cpp b/tao/CodecFactory/CDR_Encaps_Codec.cpp index 6caf233bb55..3fed35012b5 100644 --- a/tao/CodecFactory/CDR_Encaps_Codec.cpp +++ b/tao/CodecFactory/CDR_Encaps_Codec.cpp @@ -43,7 +43,7 @@ TAO_CDR_Encaps_Codec::~TAO_CDR_Encaps_Codec (void) { } -CORBA::OctetSeq * +CORBA::OctetSeq TAO_CDR_Encaps_Codec::encode (const CORBA::Any & data) { this->check_type_for_encoding (data); @@ -71,6 +71,7 @@ TAO_CDR_Encaps_Codec::encode (const CORBA::Any & data) if ((cdr << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) && (cdr << data)) { + /* CORBA::OctetSeq * octet_seq = 0; ACE_NEW_THROW_EX (octet_seq, @@ -82,20 +83,30 @@ TAO_CDR_Encaps_Codec::encode (const CORBA::Any & data) CORBA::COMPLETED_NO)); CORBA::OctetSeq_var safe_octet_seq = octet_seq; - octet_seq->length (static_cast<CORBA::ULong> (cdr.total_length ())); CORBA::Octet *buf = octet_seq->get_buffer (); + */ + CORBA::OctetSeq octet_seq; + octet_seq.resize (cdr.total_length ()); + size_t index = 0; for (const ACE_Message_Block *i = cdr.begin (); i != 0; i = i->cont ()) { + for (size_t j = 0; j < i->length (); ++j) + { + octet_seq[index++] = i->rd_ptr ()[j]; + } + /* size_t const len = i->length (); ACE_OS::memcpy (buf, i->rd_ptr (), len); buf += len; + */ } - return safe_octet_seq._retn (); +// return safe_octet_seq._retn (); + return octet_seq; } throw ::CORBA::MARSHAL (); @@ -112,13 +123,18 @@ TAO_CDR_Encaps_Codec::decode (const CORBA::OctetSeq & data) // the octet sequence, and place them into the Any. We can't just // insert the octet sequence into the Any. - ACE_Message_Block mb (data.length () + 2 * ACE_CDR::MAX_ALIGNMENT); + ACE_Message_Block mb (data.size () + 2 * ACE_CDR::MAX_ALIGNMENT); ACE_CDR::mb_align (&mb); - ACE_OS::memcpy (mb.rd_ptr (), data.get_buffer (), data.length ()); +// ACE_OS::memcpy (mb.rd_ptr (), data.get_buffer (), data.length ()); + + for (size_t i = 0; i < data.size (); ++i) + { + mb.rd_ptr ()[i] = data[i]; + } size_t rd_pos = mb.rd_ptr () - mb.base (); - size_t wr_pos = mb.wr_ptr () - mb.base () + data.length (); + size_t wr_pos = mb.wr_ptr () - mb.base () + data.size (); TAO_InputCDR cdr (mb.data_block (), ACE_Message_Block::DONT_DELETE, @@ -161,7 +177,7 @@ TAO_CDR_Encaps_Codec::decode (const CORBA::OctetSeq & data) throw IOP::Codec::FormatMismatch (); } -CORBA::OctetSeq * +CORBA::OctetSeq TAO_CDR_Encaps_Codec::encode_value (const CORBA::Any & data) { this->check_type_for_encoding (data); @@ -212,6 +228,7 @@ TAO_CDR_Encaps_Codec::encode_value (const CORBA::Any & data) // TAO extension: replace the contents of the octet sequence with // the CDR stream. + /* CORBA::OctetSeq * octet_seq = 0; ACE_NEW_THROW_EX (octet_seq, @@ -228,19 +245,30 @@ TAO_CDR_Encaps_Codec::encode_value (const CORBA::Any & data) octet_seq->length (static_cast<CORBA::ULong> (cdr.total_length ())); CORBA::Octet *buf = octet_seq->get_buffer (); - + */ + CORBA::OctetSeq octet_seq; + octet_seq.resize (cdr.total_length ()); + size_t index = 0; + for (const ACE_Message_Block *i = cdr.begin (); i != 0; i = i->cont ()) { + for (size_t j = 0; j < i->length (); ++j) + { + octet_seq[index++] = i->rd_ptr ()[j]; + } + /* size_t len = i->length (); ACE_OS::memcpy (buf, i->rd_ptr (), len); buf += len; + */ } - return safe_octet_seq._retn (); +// return safe_octet_seq._retn (); + return octet_seq; } throw ::CORBA::MARSHAL (); @@ -256,13 +284,18 @@ TAO_CDR_Encaps_Codec::decode_value (const CORBA::OctetSeq & data, // We accommodate this by including // 2 * ACE_CDR::MAX_ALIGNMENT bytes of additional space in // the message block. - ACE_Message_Block mb (data.length () + 2 * ACE_CDR::MAX_ALIGNMENT); + ACE_Message_Block mb (data.size () + 2 * ACE_CDR::MAX_ALIGNMENT); ACE_CDR::mb_align (&mb); - + + for (size_t i = 0; i < data.size (); ++i) + { + mb.rd_ptr ()[i] = data[i]; + } + /* ACE_OS::memcpy (mb.rd_ptr (), data.get_buffer (), data.length ()); - + */ // @todo How do we check for a type mismatch so that we can // throw a IOP::Codec::TypeMismatch exception? // @@ I added a check below. See the comment. I'm not sure @@ -277,7 +310,7 @@ TAO_CDR_Encaps_Codec::decode_value (const CORBA::OctetSeq & data, // encapsulation. size_t rd_pos = mb.rd_ptr () - mb.base (); - size_t wr_pos = mb.wr_ptr () - mb.base () + data.length (); + size_t wr_pos = mb.wr_ptr () - mb.base () + data.size (); TAO_InputCDR cdr (mb.data_block (), ACE_Message_Block::DONT_DELETE, diff --git a/tao/CodecFactory/CDR_Encaps_Codec.h b/tao/CodecFactory/CDR_Encaps_Codec.h index 7fb3827ee41..5e44075ad5b 100644 --- a/tao/CodecFactory/CDR_Encaps_Codec.h +++ b/tao/CodecFactory/CDR_Encaps_Codec.h @@ -58,7 +58,7 @@ public: /// Encode the given data, including the TypeCode, into an octet /// sequence. - virtual CORBA::OctetSeq * encode (const CORBA::Any & data); + virtual CORBA::OctetSeq encode (const CORBA::Any & data); /// Extract the TypeCode and the value from the octet sequence and /// place them into an Any. @@ -66,7 +66,7 @@ public: /// Encode the given data, excluding the TypeCode, into an octet /// sequence. - virtual CORBA::OctetSeq * encode_value (const CORBA::Any & data); + virtual CORBA::OctetSeq encode_value (const CORBA::Any & data); /// Extract the value from the octet sequence, based on the given /// TypeCode, and place it into an Any. diff --git a/tao/Messaging.mpc b/tao/Messaging.mpc index c96838ba41c..27a44ad621c 100644 --- a/tao/Messaging.mpc +++ b/tao/Messaging.mpc @@ -1,6 +1,8 @@ //$Id$ project(*idl) : tao_versioning_idl_defaults { custom_only = 1 + idlflags += -Gstl + IDL_Files { idlflags += -SS -GA -Gp -Gd -Sorb -Sal \ -Wb,export_macro=TAO_Messaging_Export \ diff --git a/tao/Messaging/AMH_Response_Handler.cpp b/tao/Messaging/AMH_Response_Handler.cpp index 0ad4459adb3..83a26487e4b 100644 --- a/tao/Messaging/AMH_Response_Handler.cpp +++ b/tao/Messaging/AMH_Response_Handler.cpp @@ -187,7 +187,7 @@ TAO_AMH_Response_Handler::_tao_rh_send_exception (const CORBA::Exception &ex) TAO_Pluggable_Reply_Params_Base reply_params; reply_params.request_id_ = this->request_id_; - reply_params.svc_ctx_.length (0); + reply_params.svc_ctx_.resize (0); reply_params.service_context_notowned (&this->reply_service_context_.service_info ()); reply_params.argument_flag_ = true; // @@ It appears as if there should be a more efficient way to do @@ -247,7 +247,7 @@ TAO_AMH_Response_Handler::_tao_rh_send_location_forward (CORBA::Object_ptr fwd, TAO_Pluggable_Reply_Params_Base reply_params; reply_params.request_id_ = this->request_id_; - reply_params.svc_ctx_.length (0); + reply_params.svc_ctx_.resize (0); reply_params.service_context_notowned (&this->reply_service_context_.service_info ()); reply_params.argument_flag_ = true; diff --git a/tao/Messaging/Asynch_Reply_Dispatcher.cpp b/tao/Messaging/Asynch_Reply_Dispatcher.cpp index 9075cd3247c..2f8e3280727 100644 --- a/tao/Messaging/Asynch_Reply_Dispatcher.cpp +++ b/tao/Messaging/Asynch_Reply_Dispatcher.cpp @@ -83,10 +83,19 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply (TAO_Pluggable_Reply_Params ¶ms) { // Steal the buffer, that way we don't do any unnecesary copies of // this data. - CORBA::ULong const max = params.svc_ctx_.maximum (); - CORBA::ULong const len = params.svc_ctx_.length (); - IOP::ServiceContext *context_list = params.svc_ctx_.get_buffer (1); - this->reply_service_info_.replace (max, len, context_list, 1); + CORBA::ULong const max = params.svc_ctx_.capacity (); + CORBA::ULong const len = params.svc_ctx_.size (); + +// IOP::ServiceContext *context_list = params.svc_ctx_.get_buffer (1); +// this->reply_service_info_.replace (max, len, context_list, 1); + + this->reply_service_info_.reserve (max); + this->reply_service_info_.resize (len); + + for (size_t i = 0; i < len; ++i) + { + this->reply_service_info_[i] = params.svc_ctx_[i]; + } if (TAO_debug_level >= 4) { diff --git a/tao/Messaging/ExceptionHolder_i.cpp b/tao/Messaging/ExceptionHolder_i.cpp index c9100b1c818..725088e2b95 100644 --- a/tao/Messaging/ExceptionHolder_i.cpp +++ b/tao/Messaging/ExceptionHolder_i.cpp @@ -53,9 +53,12 @@ namespace TAO void ExceptionHolder::raise_exception (void) { - TAO_InputCDR _tao_in ((const char*) this->marshaled_exception ().get_buffer (), - this->marshaled_exception ().length (), - this->byte_order ()); + TAO_InputCDR _tao_in ( + reinterpret_cast<const char *> ( + this->marshaled_exception ().get_allocator ().address ( + *this->marshaled_exception ().begin ())), + this->marshaled_exception ().size (), + this->byte_order ()); _tao_in.char_translator (this->char_translator_); _tao_in.wchar_translator (this->wchar_translator_); diff --git a/tao/Messaging/ExceptionHolder_i.h b/tao/Messaging/ExceptionHolder_i.h index e79af7993ba..6ce63574e43 100644 --- a/tao/Messaging/ExceptionHolder_i.h +++ b/tao/Messaging/ExceptionHolder_i.h @@ -30,7 +30,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace Dynamic { - class ExceptionList; + typedef std::vector< ::CORBA::TypeCode_ptr> ExceptionList; } namespace Messaging diff --git a/tao/Object.cpp b/tao/Object.cpp index b5c769e5745..f08cc683390 100644 --- a/tao/Object.cpp +++ b/tao/Object.cpp @@ -202,7 +202,7 @@ CORBA::Object::_servant (void) const // logical type ID is passed as a parameter. CORBA::Boolean -CORBA::Object::_is_a (const char *type_id) +CORBA::Object::_is_a (const std::string type_id) { TAO_OBJECT_IOR_EVALUATE_RETURN(false); @@ -226,11 +226,11 @@ CORBA::Object::_is_a (const char *type_id) throw ::CORBA::NO_IMPLEMENT (); if (this->_stubobj ()->type_id.in () != 0 - && ACE_OS::strcmp (type_id, + && ACE_OS::strcmp (type_id.c_str (), this->_stubobj ()->type_id.in ()) == 0) return true; - return this->proxy_broker ()->_is_a (this, type_id); + return this->proxy_broker ()->_is_a (this, type_id.c_str ()); } const char* diff --git a/tao/Object.h b/tao/Object.h index 4bef8185f20..01c224cd7d7 100644 --- a/tao/Object.h +++ b/tao/Object.h @@ -135,7 +135,7 @@ namespace CORBA // appropriate. /// Determine if we are of the type specified by the "logical_type_id" - virtual CORBA::Boolean _is_a (const char *logical_type_id); + virtual CORBA::Boolean _is_a (const std::string logical_type_id); /// The repository ID for the most derived class, this is an /// implementation method and does no remote invocations! diff --git a/tao/Object_KeyC.h b/tao/Object_KeyC.h index b300a3c140e..8ef85c75402 100644 --- a/tao/Object_KeyC.h +++ b/tao/Object_KeyC.h @@ -28,8 +28,8 @@ // TAO_IDL - Generated from // .\be\be_codegen.cpp:149 -#ifndef _TAO_PIDL_OBJECT_KEYC_EXVGOK_H_ -#define _TAO_PIDL_OBJECT_KEYC_EXVGOK_H_ +#ifndef _TAO_PIDL_OBJECT_KEYC_RNNW6J_H_ +#define _TAO_PIDL_OBJECT_KEYC_RNNW6J_H_ #include /**/ "ace/pre.h" @@ -64,7 +64,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL // TAO_IDL - Generated from -// e:\branches\alt_mapping_saic\tao\tao_idl\be\be_visitor_module/module_ch.cpp:41 +// w:\tao\tao_idl\be\be_visitor_module/module_ch.cpp:41 namespace TAO { @@ -75,7 +75,7 @@ namespace TAO typedef CORBA::OctetSeq ObjectKey; // TAO_IDL - Generated from -// e:\branches\alt_mapping_saic\tao\tao_idl\be\be_visitor_module/module_ch.cpp:70 +// w:\tao\tao_idl\be\be_visitor_module/module_ch.cpp:70 } // module TAO diff --git a/tao/Object_T.cpp b/tao/Object_T.cpp index e48f0a5287c..92a0c553489 100644 --- a/tao/Object_T.cpp +++ b/tao/Object_T.cpp @@ -23,8 +23,10 @@ namespace TAO { return T::_nil (); } + + std::string type_id (repo_id); - if (obj->_is_a (repo_id) == false) + if (obj->_is_a (type_id) == false) { return T::_nil (); } diff --git a/tao/PI.mpc b/tao/PI.mpc index ba4491302eb..0436591053b 100644 --- a/tao/PI.mpc +++ b/tao/PI.mpc @@ -1,7 +1,7 @@ //$Id$ project(*idl) : tao_versioning_idl_defaults, install, pidl_install { custom_only = 1 - idlflags += -SS -Sci -Gp -Gd \ + idlflags += -SS -Sci -Gp -Gd -Gstl \ -Wb,export_macro=TAO_PI_Export \ -Wb,export_include=tao/PI/pi_export.h \ -o PI diff --git a/tao/PI/ClientRequestDetails.cpp b/tao/PI/ClientRequestDetails.cpp index f806b51a0d0..0a58b63d43a 100644 --- a/tao/PI/ClientRequestDetails.cpp +++ b/tao/PI/ClientRequestDetails.cpp @@ -21,7 +21,7 @@ namespace TAO // Flag to check for duplicate ProcessingModePolicy objects in the list. bool processing_mode_applied = false; - const CORBA::ULong plen = policies.length (); + const CORBA::ULong plen = policies.size (); for (CORBA::ULong i = 0; i < plen; ++i) { diff --git a/tao/PI/ClientRequestInfo.cpp b/tao/PI/ClientRequestInfo.cpp index ed51f4b2d34..09779bf3d40 100644 --- a/tao/PI/ClientRequestInfo.cpp +++ b/tao/PI/ClientRequestInfo.cpp @@ -169,7 +169,7 @@ TAO_ClientRequestInfo::received_exception (void) return caught_exception_var._retn (); } -char * +std::string TAO_ClientRequestInfo::received_exception_id (void) { this->check_validity (); @@ -181,7 +181,9 @@ TAO_ClientRequestInfo::received_exception_id (void) throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); } - return CORBA::string_dup (caught_exception->_rep_id ()); +// return CORBA::string_dup (caught_exception->_rep_id ()); + std::string retval (caught_exception->_rep_id ()); + return retval; } IOP::TaggedComponent * @@ -195,7 +197,7 @@ TAO_ClientRequestInfo::get_effective_component (IOP::ComponentId id) IOP::MultipleComponentProfile &components = ecs.components (); - CORBA::ULong const len = components.length (); + CORBA::ULong const len = components.size (); for (CORBA::ULong i = 0; i < len; ++i) { if (components[i].tag == id) @@ -226,7 +228,7 @@ TAO_ClientRequestInfo::get_effective_component (IOP::ComponentId id) throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 28, CORBA::COMPLETED_NO); } -IOP::TaggedComponentSeq * +IOP::TaggedComponentSeq TAO_ClientRequestInfo::get_effective_components (IOP::ComponentId id) { this->check_validity (); @@ -237,14 +239,16 @@ TAO_ClientRequestInfo::get_effective_components (IOP::ComponentId id) IOP::MultipleComponentProfile &components = ecs.components (); - IOP::TaggedComponentSeq *tagged_components = 0; - IOP::TaggedComponentSeq_var safe_tagged_components; + IOP::TaggedComponentSeq tagged_components; +// IOP::TaggedComponentSeq *tagged_components = 0; +// IOP::TaggedComponentSeq_var safe_tagged_components; - const CORBA::ULong len = components.length (); + const CORBA::ULong len = components.size (); for (CORBA::ULong i = 0; i < len; ++i) { if (components[i].tag == id) { + /* if (tagged_components == 0) { // Only allocate a sequence if we have tagged components @@ -259,14 +263,16 @@ TAO_ClientRequestInfo::get_effective_components (IOP::ComponentId id) safe_tagged_components = tagged_components; } - + const CORBA::ULong old_len = safe_tagged_components->length (); safe_tagged_components->length (old_len + 1); safe_tagged_components[old_len] = components[i]; // Deep copy + */ + tagged_components.push_back (components[i]); } } - +/* if (tagged_components == 0) { // No tagged component sequence was allocated, meaning no tagged @@ -274,8 +280,9 @@ TAO_ClientRequestInfo::get_effective_components (IOP::ComponentId id) // IOP::ComponentId. throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 28, CORBA::COMPLETED_NO); } - - return safe_tagged_components._retn (); +*/ +// return safe_tagged_components._retn (); + return tagged_components; } CORBA::Policy_ptr @@ -399,19 +406,21 @@ TAO_ClientRequestInfo::request_id (void) return id; } -char * +std::string TAO_ClientRequestInfo::operation (void) { this->check_validity (); - return CORBA::string_dup (this->invocation_->operation_details ().opname ()); +// return CORBA::string_dup (this->invocation_->operation_details ().opname ()); + std::string retval (this->invocation_->operation_details ().opname ()); + return retval; } -Dynamic::ParameterList * +Dynamic::ParameterList TAO_ClientRequestInfo::arguments (void) { this->check_validity (); - +/* // Generate the argument list on demand. Dynamic::ParameterList *parameter_list = TAO_RequestInfo_Util::make_parameter_list (); @@ -422,13 +431,22 @@ TAO_ClientRequestInfo::arguments (void) throw ::CORBA::MARSHAL (); return safe_parameter_list._retn (); +*/ + Dynamic::ParameterList parameter_list; + + if (!this->parameter_list (parameter_list)) + { + throw ::CORBA::MARSHAL (); + } + + return parameter_list; } bool TAO_ClientRequestInfo::parameter_list (Dynamic::ParameterList ¶m_list) { // Account for the return type that is in the argument list. - param_list.length (this->invocation_->operation_details ().args_num () - 1); + param_list.resize (this->invocation_->operation_details ().args_num () - 1); for (CORBA::ULong i = 1; i != this->invocation_->operation_details ().args_num (); ++i) { @@ -449,11 +467,11 @@ TAO_ClientRequestInfo::parameter_list (Dynamic::ParameterList ¶m_list) return true; } -Dynamic::ExceptionList * +Dynamic::ExceptionList TAO_ClientRequestInfo::exceptions (void) { this->check_validity (); - +/* Dynamic::ExceptionList *exception_list = TAO_RequestInfo_Util::make_exception_list (); @@ -463,6 +481,16 @@ TAO_ClientRequestInfo::exceptions (void) throw ::CORBA::MARSHAL (); return safe_exception_list._retn (); +*/ + + Dynamic::ExceptionList exception_list; + + if (!this->exception_list (exception_list)) + { + throw ::CORBA::MARSHAL (); + } + + return exception_list; } bool @@ -470,7 +498,7 @@ TAO_ClientRequestInfo::exception_list (Dynamic::ExceptionList &exception_list) { if (this->invocation_->operation_details ().ex_count ()) { - exception_list.length (this->invocation_->operation_details ().ex_count ()); + exception_list.resize (this->invocation_->operation_details ().ex_count ()); for (CORBA::ULong i = 0; i != this->invocation_->operation_details ().ex_count (); @@ -487,7 +515,7 @@ TAO_ClientRequestInfo::exception_list (Dynamic::ExceptionList &exception_list) return true; } -Dynamic::ContextList * +Dynamic::ContextList TAO_ClientRequestInfo::contexts (void) { this->check_validity (); @@ -495,7 +523,7 @@ TAO_ClientRequestInfo::contexts (void) throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); } -Dynamic::RequestContext * +Dynamic::RequestContext TAO_ClientRequestInfo::operation_context (void) { this->check_validity (); diff --git a/tao/PI/ClientRequestInfo.h b/tao/PI/ClientRequestInfo.h index 92b3915f3cb..4773a5e63ca 100644 --- a/tao/PI/ClientRequestInfo.h +++ b/tao/PI/ClientRequestInfo.h @@ -51,10 +51,11 @@ namespace TAO namespace Dynamic { - class ParameterList; - class ExceptionList; - typedef CORBA::StringSeq RequestContext; + struct Parameter; + typedef std::vector<Parameter> ParameterList; + typedef std::vector< ::CORBA::TypeCode_ptr> ExceptionList; typedef CORBA::StringSeq ContextList; + typedef CORBA::StringSeq RequestContext; } namespace Messaging @@ -80,18 +81,18 @@ public: virtual CORBA::ULong request_id (void); /// Return the operation name for the current request. - virtual char * operation (void); + virtual std::string operation (void); /// Return the list of arguments passed to the current operation. - virtual Dynamic::ParameterList * arguments (void); + virtual Dynamic::ParameterList arguments (void); /// Return the list of exceptions the current operation is capable /// of throwing. - virtual Dynamic::ExceptionList * exceptions (void); + virtual Dynamic::ExceptionList exceptions (void); - virtual Dynamic::ContextList * contexts (void); + virtual Dynamic::ContextList contexts (void); - virtual Dynamic::RequestContext * operation_context (void); + virtual Dynamic::RequestContext operation_context (void); /// Return the result of the current request. If there is no return /// value then an Any with tk_void TypeCode is returned. This is @@ -147,7 +148,7 @@ public: virtual CORBA::Any * received_exception (void); /// Return the repository ID for the received exception. - virtual char * received_exception_id (void); + virtual std::string received_exception_id (void); /// Return the first IOP::TaggedComponent that matches the given /// IOP::ComponentId in the object reference for the current @@ -157,7 +158,7 @@ public: /// Return all IOP::TaggedComponent(s) that match the given /// IOP::ComponentId in the object reference for the current /// target. - virtual IOP::TaggedComponentSeq * get_effective_components (IOP::ComponentId id); + virtual IOP::TaggedComponentSeq get_effective_components (IOP::ComponentId id); /// Return the policy of the given type in effect for the current /// request. diff --git a/tao/PI/Interceptor_List_T.cpp b/tao/PI/Interceptor_List_T.cpp index 9ed1601ab3b..dd2e4e3d758 100644 --- a/tao/PI/Interceptor_List_T.cpp +++ b/tao/PI/Interceptor_List_T.cpp @@ -55,10 +55,11 @@ namespace TAO { /// If the Interceptor is not anonymous, make sure an /// Interceptor with the same isn't already registered. - CORBA::String_var name = - interceptor->name (); +// CORBA::String_var name = +// interceptor->name (); - if (ACE_OS::strlen (name.in ()) != 0) +// if (ACE_OS::strlen (name.in ()) != 0) + if (!interceptor->name ().empty ()) { // @@ This simple search algorithm isn't the greatest // thing in the world, but since we only register @@ -77,11 +78,12 @@ namespace TAO // registered. Anonymous interceptors are okay. for (size_t i = 0; i < old_len; ++i) { - CORBA::String_var existing_name = - this->interceptor (i)->name (); +// CORBA::String_var existing_name = +// this->interceptor (i)->name (); - if (ACE_OS::strcmp (existing_name.in (), - name.in ()) == 0) +// if (ACE_OS::strcmp (existing_name.in (), +// name.in ()) == 0) + if (this->interceptor (i)->name () == interceptor->name ()) { throw PortableInterceptor::ORBInitInfo::DuplicateName (); } @@ -127,10 +129,11 @@ namespace TAO { /// If the Interceptor is not anonymous, make sure an /// Interceptor with the same isn't already registered. - CORBA::String_var name = - interceptor->name (); +// CORBA::String_var name = +// interceptor->name (); - if (ACE_OS::strlen (name.in ()) != 0) +// if (ACE_OS::strlen (name.in ()) != 0) + if (!interceptor->name ().empty ()) { // @@ This simple search algorithm isn't the greatest // thing in the world, but since we only register @@ -149,11 +152,12 @@ namespace TAO // registered. Anonymous interceptors are okay. for (size_t i = 0; i < old_len; ++i) { - CORBA::String_var existing_name = - this->interceptor (i)->name (); +// CORBA::String_var existing_name = +// this->interceptor (i)->name (); - if (ACE_OS::strcmp (existing_name.in (), - name.in ()) == 0) +// if (ACE_OS::strcmp (existing_name.in (), +// name.in ()) == 0) + if (this->interceptor (i)->name () == interceptor->name ()) { throw PortableInterceptor::ORBInitInfo::DuplicateName (); } diff --git a/tao/PI/Interceptor_List_T.h b/tao/PI/Interceptor_List_T.h index 7a7d49c71dc..3336ba1e0f3 100644 --- a/tao/PI/Interceptor_List_T.h +++ b/tao/PI/Interceptor_List_T.h @@ -16,6 +16,8 @@ #include /**/ "ace/pre.h" +#include <vector> + #include "ace/Array_Base.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -34,7 +36,9 @@ namespace PortableInterceptor namespace CORBA { - class PolicyList; + class Policy; + typedef Policy *Policy_ptr; + typedef std::vector<Policy_ptr> PolicyList; } namespace TAO diff --git a/tao/PI/ORBInitInfo.cpp b/tao/PI/ORBInitInfo.cpp index 1a7b26bbfac..34f82cdcb80 100644 --- a/tao/PI/ORBInitInfo.cpp +++ b/tao/PI/ORBInitInfo.cpp @@ -71,7 +71,7 @@ TAO_ORBInitInfo::~TAO_ORBInitInfo (void) { } -CORBA::StringSeq * +CORBA::StringSeq TAO_ORBInitInfo::arguments (void) { this->check_validity (); @@ -79,7 +79,8 @@ TAO_ORBInitInfo::arguments (void) // In accordance with the C++ mapping for sequences, it is up to the // caller to deallocate storage for returned sequences. - CORBA::StringSeq *args = 0; + CORBA::StringSeq args; + /* ACE_NEW_THROW_EX (args, CORBA::StringSeq, CORBA::NO_MEMORY ( @@ -89,24 +90,31 @@ TAO_ORBInitInfo::arguments (void) CORBA::COMPLETED_NO)); CORBA::StringSeq_var safe_args (args); - + */ // Copy the argument vector to the string sequence. - args->length (this->argc_); // Not a problem if argc is zero. + args.resize (this->argc_); // Not a problem if argc is zero. + for (int i = 0; i < this->argc_; ++i) - (*args)[i] = CORBA::string_dup (this->argv_[i]); + { + args[i] = this->argv_[i]; +// (*args)[i] = CORBA::string_dup (this->argv_[i]); + } - return safe_args._retn (); +// return safe_args._retn (); + return args; } -char * +std::string TAO_ORBInitInfo::orb_id (void) { this->check_validity (); // In accordance with the C++ mapping for strings, return a copy. - return CORBA::string_dup (this->orb_core_->orbid ()); +// return CORBA::string_dup (this->orb_core_->orbid ()); + std::string retval (this->orb_core_->orbid ()); + return retval; } IOP::CodecFactory_ptr @@ -142,12 +150,13 @@ TAO_ORBInitInfo::codec_factory (void) void TAO_ORBInitInfo::register_initial_reference ( - const char * id, + const std::string id, CORBA::Object_ptr obj) { this->check_validity (); - if (id == 0 || ACE_OS::strlen (id) == 0) +// if (id == 0 || ACE_OS::strlen (id) == 0) + if (id.empty ()) throw PortableInterceptor::ORBInitInfo::InvalidName (); if (CORBA::is_nil (obj)) @@ -155,22 +164,23 @@ TAO_ORBInitInfo::register_initial_reference ( TAO_Object_Ref_Table &table = this->orb_core_->object_ref_table (); - if (table.register_initial_reference (id, obj) == -1) + if (table.register_initial_reference (id.c_str (), obj) == -1) throw PortableInterceptor::ORBInitInfo::InvalidName (); } CORBA::Object_ptr -TAO_ORBInitInfo::resolve_initial_references (const char * id) +TAO_ORBInitInfo::resolve_initial_references (const std::string id) { this->check_validity (); - if (id == 0 || ACE_OS::strlen (id) == 0) +// if (id == 0 || ACE_OS::strlen (id) == 0) + if (id.empty ()) throw PortableInterceptor::ORBInitInfo::InvalidName (); // The ORB is practically fully initialized by the time this point // is reached so just use the ORB's resolve_initial_references() // mechanism. - return this->orb_core_->orb ()->resolve_initial_references (id); + return this->orb_core_->orb ()->resolve_initial_references (id.c_str ()); } void diff --git a/tao/PI/ORBInitInfo.h b/tao/PI/ORBInitInfo.h index fdf7676380e..ae61060d083 100644 --- a/tao/PI/ORBInitInfo.h +++ b/tao/PI/ORBInitInfo.h @@ -73,10 +73,10 @@ public: //@{ /// Return the argument vector for the ORB currently being /// initialized as a string sequence. - virtual CORBA::StringSeq * arguments (void); + virtual CORBA::StringSeq arguments (void); /// Return the ORBid for the ORB currently being initialized. - virtual char * orb_id (void); + virtual std::string orb_id (void); /// Return the CodecFactory for the ORB currently being /// initialized. @@ -92,12 +92,12 @@ public: * resolve_initial_references() that may be called in the * ORBInitializer::post_init() call. */ - virtual void register_initial_reference (const char * id, CORBA::Object_ptr obj); + virtual void register_initial_reference (const std::string id, CORBA::Object_ptr obj); /// Obtain a reference to an object that may not yet be available /// via the usual CORBA::ORB::resolve_initial_references() mechanism /// since the ORB may not be fully initialized yet. - virtual CORBA::Object_ptr resolve_initial_references (const char * id); + virtual CORBA::Object_ptr resolve_initial_references (const std::string id); /// Register a client request interceptor with the ORB currently /// being initialized. diff --git a/tao/PI/RequestInfo_Util.cpp b/tao/PI/RequestInfo_Util.cpp index 2388515e963..05253829f24 100644 --- a/tao/PI/RequestInfo_Util.cpp +++ b/tao/PI/RequestInfo_Util.cpp @@ -19,10 +19,11 @@ ACE_RCSID (tao, TAO_BEGIN_VERSIONED_NAMESPACE_DECL -Dynamic::ParameterList * +Dynamic::ParameterList TAO_RequestInfo_Util::make_parameter_list (void) { - Dynamic::ParameterList *parameter_list = 0; + Dynamic::ParameterList parameter_list; + /* ACE_NEW_THROW_EX (parameter_list, Dynamic::ParameterList, CORBA::NO_MEMORY ( @@ -32,14 +33,15 @@ TAO_RequestInfo_Util::make_parameter_list (void) CORBA::COMPLETED_NO)); // No need to do an ACE_CHECK_RETURN. The caller should do that. - + */ return parameter_list; } -Dynamic::ExceptionList * +Dynamic::ExceptionList TAO_RequestInfo_Util::make_exception_list (void) { - Dynamic::ExceptionList *exception_list = 0; + Dynamic::ExceptionList exception_list; + /* ACE_NEW_THROW_EX (exception_list, Dynamic::ExceptionList, CORBA::NO_MEMORY ( @@ -49,14 +51,15 @@ TAO_RequestInfo_Util::make_exception_list (void) CORBA::COMPLETED_NO)); // No need to do an ACE_CHECK_RETURN. The caller should do that. - + */ return exception_list; } -Dynamic::ContextList * +Dynamic::ContextList TAO_RequestInfo_Util::make_context_list (void) { - Dynamic::ContextList *context_list = 0; + Dynamic::ContextList context_list; + /* ACE_NEW_THROW_EX (context_list, Dynamic::ContextList, CORBA::NO_MEMORY ( @@ -66,14 +69,15 @@ TAO_RequestInfo_Util::make_context_list (void) CORBA::COMPLETED_NO)); // No need to do an ACE_CHECK_RETURN. The caller should do that. - + */ return context_list; } -Dynamic::RequestContext * +Dynamic::RequestContext TAO_RequestInfo_Util::make_request_context (void) { - Dynamic::RequestContext *request_context = 0; + Dynamic::RequestContext request_context; + /* ACE_NEW_THROW_EX (request_context, Dynamic::RequestContext, CORBA::NO_MEMORY ( @@ -83,7 +87,7 @@ TAO_RequestInfo_Util::make_request_context (void) CORBA::COMPLETED_NO)); // No need to do an ACE_CHECK_RETURN. The caller should do that. - + */ return request_context; } diff --git a/tao/PI/RequestInfo_Util.h b/tao/PI/RequestInfo_Util.h index 650cc77b488..aa1d971f2b7 100644 --- a/tao/PI/RequestInfo_Util.h +++ b/tao/PI/RequestInfo_Util.h @@ -15,6 +15,9 @@ #include /**/ "ace/pre.h" +#include <vector> +#include <string> + #include "tao/Basic_Types.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -31,14 +34,15 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace CORBA { - class StringSeq; + typedef std::vector<std::string> StringSeq; class Any; } namespace Dynamic { - class ParameterList; - class ExceptionList; + struct Parameter; + typedef std::vector<Parameter> ParameterList; + typedef std::vector< ::CORBA::TypeCode_ptr> ExceptionList; typedef CORBA::StringSeq ContextList; typedef CORBA::StringSeq RequestContext; } @@ -63,13 +67,13 @@ public: * class. */ //@{ - static Dynamic::ParameterList * make_parameter_list (void); + static Dynamic::ParameterList make_parameter_list (void); - static Dynamic::ExceptionList * make_exception_list (void); + static Dynamic::ExceptionList make_exception_list (void); - static Dynamic::ContextList * make_context_list (void); + static Dynamic::ContextList make_context_list (void); - static Dynamic::RequestContext * make_request_context (void); + static Dynamic::RequestContext make_request_context (void); static CORBA::Any * make_any (CORBA::Boolean tk_void_any); //@} diff --git a/tao/PolicyC.cpp b/tao/PolicyC.cpp index eff733a61b6..be01d40fc29 100644 --- a/tao/PolicyC.cpp +++ b/tao/PolicyC.cpp @@ -587,20 +587,14 @@ CORBA::Policy::_tao_release (Policy_ptr obj) CORBA::Boolean CORBA::Policy::_is_a ( - const char *value + const std::string value ) { if ( - !ACE_OS::strcmp ( - value, - "IDL:omg.org/CORBA/Policy:1.0" - ) || - !ACE_OS::strcmp ( - value, - "IDL:omg.org/CORBA/Object:1.0" - ) - ) + value == "IDL:omg.org/CORBA/Policy:1.0" || + value == "IDL:omg.org/CORBA/Object:1.0" + ) { return true; // success using local knowledge } diff --git a/tao/PolicyC.h b/tao/PolicyC.h index dc478cbae50..1d4c5484c66 100644 --- a/tao/PolicyC.h +++ b/tao/PolicyC.h @@ -299,7 +299,7 @@ namespace CORBA // be\be_visitor_interface/interface_ch.cpp:210 virtual CORBA::Boolean _is_a ( - const char *type_id + const std::string type_id ); diff --git a/tao/PortableServer/Basic_SArguments.h b/tao/PortableServer/Basic_SArguments.h index 24c91de43d4..0fca6f3b1ef 100644 --- a/tao/PortableServer/Basic_SArguments.h +++ b/tao/PortableServer/Basic_SArguments.h @@ -23,6 +23,7 @@ #include "tao/PortableServer/Basic_SArgument_T.h" #include "tao/PortableServer/SArg_Traits_T.h" +#include "tao/Basic_Arguments.h" #include "tao/Any_Insert_Policy_T.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL |