diff options
Diffstat (limited to 'TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp | 83 |
1 files changed, 25 insertions, 58 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp index c98b0bed8bb..740b549a1e6 100644 --- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp @@ -141,7 +141,7 @@ Sender::parse_args (int argc, // Method to get the object reference of the receiver int -Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL) +Sender::bind_to_receiver (void) { CosNaming::Name name (1); name.length (1); @@ -150,14 +150,10 @@ Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL) // Resolve the receiver object reference from the Naming Service CORBA::Object_var receiver_mmdevice_obj = - this->naming_client_->resolve (name - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + this->naming_client_->resolve (name); this->receiver_mmdevice_ = - AVStreams::MMDevice::_narrow (receiver_mmdevice_obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + AVStreams::MMDevice::_narrow (receiver_mmdevice_obj.in ()); if (CORBA::is_nil (this->receiver_mmdevice_.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -169,8 +165,7 @@ Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL) int Sender::init (int argc, - char **argv - ACE_ENV_ARG_DECL) + char **argv) { // Initialize the endpoint strategy with the orb and poa. int result = @@ -207,8 +202,7 @@ Sender::init (int argc, "File opened successfully\n")); // Resolve the object reference of the receiver from the Naming Service. - result = this->bind_to_receiver (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + result = this->bind_to_receiver (); if (result != 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -272,8 +266,7 @@ Sender::init (int argc, this->sender_mmdevice_; AVStreams::MMDevice_var mmdevice = - this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + this->sender_mmdevice_->_this (); ACE_NEW_RETURN (this->streamctrl_, TAO_StreamCtrl, @@ -287,9 +280,7 @@ Sender::init (int argc, this->streamctrl_->bind_devs (mmdevice.in (), this->receiver_mmdevice_.in (), the_qos.inout (), - flow_spec - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + flow_spec); if (bind_result == 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -301,7 +292,7 @@ Sender::init (int argc, // Method to send data at the specified rate int -Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL) +Sender::pace_data (void) { // The time that should lapse between two consecutive frames sent. ACE_Time_Value inter_frame_time; @@ -316,7 +307,7 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL) this->frame_rate_, inter_frame_time.msec ())); - ACE_TRY + try { // The time taken for sending a frame and preparing for the next frame ACE_High_Res_Timer elapsed_timer; @@ -381,9 +372,7 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL) // Run the orb for the wait time so the sender can // continue other orb requests. - TAO_AV_CORE::instance ()->orb ()->run (wait_time - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + TAO_AV_CORE::instance ()->orb ()->run (wait_time); } } @@ -414,22 +403,16 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL) // File reading is complete, destroy the stream. AVStreams::flowSpec stop_spec; - this->streamctrl_->destroy (stop_spec - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->streamctrl_->destroy (stop_spec); // Shut the orb down. - TAO_AV_CORE::instance ()->orb ()->shutdown (0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + TAO_AV_CORE::instance ()->orb ()->shutdown (0); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Sender::pace_data Failed\n"); + ex._tao_print_exception ("Sender::pace_data Failed\n"); return -1; } - ACE_ENDTRY; return 0; } @@ -437,45 +420,33 @@ int main (int argc, char **argv) { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0 - ACE_ENV_ARG_PARAMETER); + 0); CORBA::Object_var obj - = orb->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + = orb->resolve_initial_references ("RootPOA"); // Get the POA_var object from Object_var PortableServer::POA_var root_poa - = PortableServer::POA::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + = PortableServer::POA::_narrow (obj.in ()); PortableServer::POAManager_var mgr - = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + = root_poa->the_POAManager (); - mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + mgr->activate (); // Initialize the AV Stream components. TAO_AV_CORE::instance ()->init (orb.in (), - root_poa.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + root_poa.in ()); // Initialize the Sender. int result = 0; result = SENDER::instance ()->init (argc, - argv - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + argv); if (result < 0) ACE_ERROR_RETURN ((LM_ERROR, @@ -483,17 +454,13 @@ main (int argc, -1); // Start sending data. - result = SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + result = SENDER::instance ()->pace_data (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Sender Failed\n"); + ex._tao_print_exception ("Sender Failed\n"); return -1; } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); SENDER::close (); // Explicitly finalize the Unmanaged_Singleton. |