summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp')
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp70
1 files changed, 26 insertions, 44 deletions
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp
index 4612ff106bf..c70f1d160cf 100644
--- a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp
@@ -41,13 +41,13 @@ public:
{
}
- void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ void go (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
started_ = true;
}
- void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ void done (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
started_ = false;
@@ -121,23 +121,20 @@ Consumer_Client::parse_args (int argc, char *argv[])
static CosNotifyChannelAdmin::SupplierAdmin_ptr
-create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
- ACE_ENV_ARG_DECL)
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec)
{
CosNotifyChannelAdmin::AdminID adminid = 0;
CosNotifyChannelAdmin::SupplierAdmin_var admin =
ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
- adminid
- ACE_ENV_ARG_PARAMETER);
+ adminid);
- ACE_CHECK_RETURN (0);
return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
}
static void
-SendEvent (int id ACE_ENV_ARG_DECL_NOT_USED)
+SendEvent (int id)
{
ACE_UNUSED_ARG(id);
CosNotification::StructuredEvent event;
@@ -146,25 +143,22 @@ SendEvent (int id ACE_ENV_ARG_DECL_NOT_USED)
event.header.fixed_header.event_type.type_name = CORBA::string_dup ("b");
event.header.fixed_header.event_name = CORBA::string_dup ("test");
- ACE_TRY_NEW_ENV
+ try
{
for (unsigned int i = 0; i < supplier_count; i++)
{
- suppliers[i]->send_event (event ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ suppliers[i]->send_event (event);
}
}
- ACE_CATCH (CORBA::Exception, e)
+ catch (const CORBA::Exception& e)
{
- ACE_PRINT_EXCEPTION (e, "Error: ");
+ e._tao_print_exception ("Error: ");
}
- ACE_ENDTRY;
}
static void
create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
- Notify_Test_Client* client
- ACE_ENV_ARG_DECL)
+ Notify_Test_Client* client)
{
for (unsigned int i = 0; i < supplier_count; i++)
{
@@ -172,21 +166,18 @@ create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
TAO_Notify_Tests_StructuredPushSupplier (),
CORBA::NO_MEMORY ());
- suppliers[i]->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ suppliers[i]->init (client->root_poa ());
- suppliers[i]->connect (admin ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ suppliers[i]->connect (admin);
}
}
static void
-disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+disconnect_suppliers (void)
{
for (unsigned int i = 0; i < supplier_count; ++i)
{
- suppliers[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ suppliers[i]->disconnect ();
}
}
@@ -197,27 +188,23 @@ disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
int main (int argc, char* argv[])
{
ACE_Auto_Ptr< sig_i > sig_impl;
- ACE_TRY_NEW_ENV
+ try
{
Consumer_Client client;
- int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ int status = client.init (argc, argv);
ACE_UNUSED_ARG(status);
ACE_ASSERT(status == 0);
CosNotifyChannelAdmin::EventChannel_var ec =
- client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ client.create_event_channel ("MyEventChannel", 0);
CORBA::ORB_ptr orb = client.orb ();
sig_impl.reset( new sig_i( orb ) );
- sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ sig_var sig = sig_impl->_this ();
CORBA::String_var ior =
- orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->object_to_string (sig.in ());
if (ior_output_file != 0)
{
@@ -233,10 +220,9 @@ int main (int argc, char* argv[])
}
CosNotifyChannelAdmin::SupplierAdmin_var admin =
- create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ create_supplieradmin (ec.in ());
ACE_ASSERT(!CORBA::is_nil (admin.in ()));
- create_suppliers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ create_suppliers (admin.in (), &client);
sig_impl->wait_for_startup();
@@ -244,8 +230,7 @@ int main (int argc, char* argv[])
for (int i = 0; i < event_count; ++i)
{
ACE_DEBUG((LM_DEBUG, "+"));
- SendEvent (i ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ SendEvent (i);
}
ACE_DEBUG((LM_DEBUG, "\nEach Supplier sent %d events.\n", event_count));
@@ -253,19 +238,16 @@ int main (int argc, char* argv[])
ACE_OS::unlink (ior_output_file);
- disconnect_suppliers(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ disconnect_suppliers();
- ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ ec->destroy();
return 0;
}
- ACE_CATCH (CORBA::Exception, e)
+ catch (const CORBA::Exception& e)
{
- ACE_PRINT_EXCEPTION (e, "Error: ");
+ e._tao_print_exception ("Error: ");
}
- ACE_ENDTRY;
return 1;
}