diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp | 92 |
1 files changed, 48 insertions, 44 deletions
diff --git a/TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp b/TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp index 273e74a2f94..670a64a50e2 100644 --- a/TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp +++ b/TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp @@ -4,6 +4,8 @@ #include "ace/INET_Addr.h" #include "ace/OS_NS_stdio.h" + + TAO_Offer_Exporter:: TAO_Offer_Exporter (CosTrading::Lookup_ptr lookup_if, CORBA::Boolean verbose) @@ -32,7 +34,6 @@ TAO_Offer_Exporter::export_offers (void) { ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Exporter::Exporting offers.\n")); - // Set the PROPERTY_NAMES - TRADER_NAME. for (int i = 0; i < NUM_OFFERS; i++) { this->props_plotters_[i][4].value <<= "Default"; @@ -50,9 +51,10 @@ TAO_Offer_Exporter::export_to (CosTrading::Register_ptr reg) { for (int i = 0; i < NUM_OFFERS; i++) { - TAO_Trader_Test::Plotter_var pPlotter= this->plotter_[i]._this (); + CORBA::Object_ptr offer_obj= this->plotter_[i]._this (); + CosTrading::OfferId_var offer_id = - reg->_cxx_export (pPlotter.in(), + reg->_cxx_export (offer_obj, TT_Info::INTERFACE_NAMES[1], this->props_plotters_[i]); @@ -61,8 +63,9 @@ TAO_Offer_Exporter::export_to (CosTrading::Register_ptr reg) ACE_DEBUG ((LM_DEBUG, "Registered offer id: %C.\n", offer_id.in ())); } - TAO_Trader_Test::Printer_var pPrinter = this->printer_[i]._this (); - offer_id = reg->_cxx_export (pPrinter.in(), + offer_obj = this->printer_[i]._this (); + + offer_id = reg->_cxx_export (offer_obj, TT_Info::INTERFACE_NAMES[2], this->props_printers_[i]); @@ -71,8 +74,9 @@ TAO_Offer_Exporter::export_to (CosTrading::Register_ptr reg) ACE_DEBUG ((LM_DEBUG, "Registered offer id: %C.\n", offer_id.in ())); } - TAO_Trader_Test::File_System_var pFileSystem = this->fs_[i]._this (); - offer_id = reg->_cxx_export (pFileSystem.in(), + offer_obj = this->fs_[i]._this (); + + offer_id = reg->_cxx_export (offer_obj, TT_Info::INTERFACE_NAMES[3], this->props_fs_[i]); @@ -82,9 +86,10 @@ TAO_Offer_Exporter::export_to (CosTrading::Register_ptr reg) } } } - catch (const CORBA::Exception& e) + catch (const CORBA::Exception& ex) { - e._tao_print_exception ("TAO_Offer_Exporter::export_to"); + ex._tao_print_exception ( + "TAO_Offer_Exporter::export_offers"); throw; } } @@ -128,7 +133,6 @@ TAO_Offer_Exporter::export_offers_to_all (void) CosTrading::Link::LinkInfo_var link_info = link_if->describe_link (link_name_seq[i]); - // Set the PROPERTY_NAMES - TRADER_NAME. for (int j = 0; j < NUM_OFFERS; j++) { this->props_plotters_[j][4].value <<= link_name_seq[i]; @@ -144,10 +148,9 @@ TAO_Offer_Exporter::export_offers_to_all (void) this->export_to (link_info->target_reg.in ()); } - catch (const CORBA::Exception& e) + catch (const CORBA::Exception&) { - e._tao_print_exception ("TAO_Offer_Exporter::export_offers_to_all"); - throw; + // @@ IGNORE?? } } } @@ -173,9 +176,10 @@ TAO_Offer_Exporter::withdraw_offers (void) } } } - catch (const CORBA::Exception& e) + catch (const CORBA::Exception& ex) { - e._tao_print_exception ("TAO_Offer_Exporter::withdraw_offers"); + ex._tao_print_exception ( + "TAO_Offer_Exporter::withdraw_offers"); throw; } } @@ -212,9 +216,10 @@ TAO_Offer_Exporter::describe_offers (void) } } } - catch (const CORBA::Exception& e) + catch (const CORBA::Exception& ex) { - e._tao_print_exception ("TAO_Offer_Exporter::describe_offers"); + ex._tao_print_exception ( + "TAO_Offer_Exporter::describe_offers"); throw; } } @@ -250,9 +255,10 @@ TAO_Offer_Exporter::modify_offers (void) } } } - catch (const CORBA::Exception& e) + catch (const CORBA::Exception& ex) { - e._tao_print_exception ("TAO_Offer_Exporter::modify_offers"); + ex._tao_print_exception ( + "TAO_Offer_Exporter::modify_offers"); throw; } } @@ -283,9 +289,10 @@ withdraw_offers_using_constraints (void) withdraw_using_constraint (TT_Info::INTERFACE_NAMES[TT_Info::FILESYSTEM], constraint); } - catch (const CORBA::Exception& e) + catch (const CORBA::Exception& ex) { - e._tao_print_exception ("TAO_Offer_Exporter::withdraw_offers_using_constraints"); + ex._tao_print_exception ( + "TAO_Offer_Exporter::withdraw_using_constraint"); throw; } } @@ -296,38 +303,36 @@ TAO_Offer_Exporter::grab_offerids (void) if (this->verbose_) ACE_DEBUG ((LM_DEBUG, "TAO_Offer_Exporter::Grabbing all offer ids.\n")); - CosTrading::OfferIdSeq_var offer_id_seq_result; + CosTrading::OfferIdSeq *offer_id_seq; try { CORBA::ULong length = NUM_OFFERS; - CosTrading::OfferIdIterator_var offer_id_iter; + CosTrading::OfferIdIterator_ptr offer_id_iter; this->admin_->list_offers (NUM_OFFERS, - offer_id_seq_result.out(), - offer_id_iter.out()); + CosTrading::OfferIdSeq_out (offer_id_seq), + CosTrading::OfferIdIterator_out (offer_id_iter)); - // We might already have seq results but may have to process additional - // iterator result fragments. - if (!CORBA::is_nil (offer_id_iter.in())) + if ((! CORBA::is_nil (offer_id_iter)) && offer_id_seq != 0) { - CosTrading::OfferIdSeq_var offer_id_seq_remaining; CORBA::Boolean any_left = 0; + CosTrading::OfferIdSeq *id_seq; + CosTrading::OfferIdIterator_var offer_id_iter_var (offer_id_iter); + do { any_left = offer_id_iter->next_n (length, - offer_id_seq_remaining.out()); + CosTrading::OfferIdSeq_out (id_seq)); - // Grow our result sequence with the remaining fragments. - CORBA::ULong offers = offer_id_seq_remaining->length (); - CORBA::ULong old_length = offer_id_seq_result->length (); - offer_id_seq_result->length (old_length + offers); + int offers = id_seq->length (); + int old_length = offer_id_seq->length (); + offer_id_seq->length (old_length + offers); - for (CORBA::ULong i = 0; i < offers; i++) - { - offer_id_seq_result[i + old_length] = CORBA::string_dup (offer_id_seq_remaining[i].in ()); - } + for (int i = 0; i < offers; i++) + (*offer_id_seq)[i + old_length] = (*id_seq)[i]; + delete id_seq; } while (any_left); @@ -337,24 +342,23 @@ TAO_Offer_Exporter::grab_offerids (void) if (this->verbose_) { ACE_DEBUG ((LM_DEBUG, "The following offer ids are registered:\n")); - for (CORBA::ULong i=0; i<offer_id_seq_result->length(); i++) - ACE_DEBUG ((LM_DEBUG, "Offer Id: %C\n", offer_id_seq_result[i].in())); + for (int len = offer_id_seq->length (), j = 0; j < len; j++) + ACE_DEBUG ((LM_DEBUG, "Offer Id: %C\n", (const char *)(*offer_id_seq)[j])); } } - catch (const CORBA::Exception& e) + catch (const CORBA::Exception& ex) { - e._tao_print_exception ("TAO_Offer_Exporter::grab_offerids"); + ex._tao_print_exception ("TAO_Offer_Exporter::grab_offerids"); throw; } // @@ redundant. - return offer_id_seq_result._retn(); + return offer_id_seq; } void TAO_Offer_Exporter::create_offers (void) { - ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Exporter::Creating offers.\n")); const int QUEUE_SIZE = 4; int counter = 0, i = 0; |