summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-03-10 23:56:54 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-03-10 23:56:54 +0000
commit2541b2ec9fd610850ac81e7dda8e5bbde8d4ec98 (patch)
treeb966b7daff5a193231fe97f07a9a0c1eda354b72 /TAO
parentf607a04f211bcda1048cf0f650778cfa79e751d2 (diff)
downloadATCD-2541b2ec9fd610850ac81e7dda8e5bbde8d4ec98.tar.gz
added _IMPORTANCE to RtecScheduler Importance enum values
Diffstat (limited to 'TAO')
-rw-r--r--TAO/examples/Simulator/Event_Supplier/Event_Con.cpp184
-rw-r--r--TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp220
2 files changed, 202 insertions, 202 deletions
diff --git a/TAO/examples/Simulator/Event_Supplier/Event_Con.cpp b/TAO/examples/Simulator/Event_Supplier/Event_Con.cpp
index 5565744062b..5d53bbe9616 100644
--- a/TAO/examples/Simulator/Event_Supplier/Event_Con.cpp
+++ b/TAO/examples/Simulator/Event_Supplier/Event_Con.cpp
@@ -2,7 +2,7 @@
//
// ============================================================================
//
-//
+//
// = FILENAME
// Event_Con.cpp
//
@@ -17,7 +17,7 @@
// This demo just tests the basic functionality of the Event Service
// One Conumer which inherits from the Rtec Consumer.
// One Supplier with an internal Rtec Consumer and one internal Rtec Supplier.
-// The internal Supplier is just a demo supplier because the architecture
+// The internal Supplier is just a demo supplier because the architecture
// expects an supplier which has inherited from the Rtec Supplier.
//
// ============================================================================
@@ -58,7 +58,7 @@ int received = 0;
Demo_Consumer::Demo_Consumer (){}
int Demo_Consumer::open_consumer (RtecEventChannelAdmin::EventChannel_ptr ec,
- const char *my_name)
+ const char *my_name)
{
TAO_TRY
{
@@ -70,14 +70,14 @@ int Demo_Consumer::open_consumer (RtecEventChannelAdmin::EventChannel_ptr ec,
rt_info_ = server->create (my_name, TAO_TRY_ENV);
server->set (rt_info_,
- ORBSVCS_Time::zero,
- ORBSVCS_Time::zero,
- ORBSVCS_Time::zero,
- 0,
- RtecScheduler::VERY_LOW,
- ORBSVCS_Time::zero,
- 1,
- TAO_TRY_ENV);
+ ORBSVCS_Time::zero,
+ ORBSVCS_Time::zero,
+ ORBSVCS_Time::zero,
+ 0,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ ORBSVCS_Time::zero,
+ 1,
+ TAO_TRY_ENV);
// Create the event that we're registering for.
@@ -85,7 +85,7 @@ int Demo_Consumer::open_consumer (RtecEventChannelAdmin::EventChannel_ptr ec,
dependencies.start_disjunction_group ();
dependencies.insert_type (ACE_ES_EVENT_NOTIFICATION, rt_info_);
dependencies.insert_type (ACE_ES_EVENT_SHUTDOWN, rt_info_);
-
+
// The channel administrator is the event channel we got from the invocation
// of this routine
@@ -106,11 +106,11 @@ int Demo_Consumer::open_consumer (RtecEventChannelAdmin::EventChannel_ptr ec,
// because a consumer inherits from a Servant class that is no CORBA::Object.
RtecEventComm::PushConsumer_var objref = this->_this (TAO_TRY_ENV);
- TAO_CHECK_ENV;
+ TAO_CHECK_ENV;
this->suppliers_->connect_push_consumer (objref.in (),
- dependencies.get_ConsumerQOS (),
- TAO_TRY_ENV);
+ dependencies.get_ConsumerQOS (),
+ TAO_TRY_ENV);
TAO_CHECK_ENV;
}
TAO_CATCH (RtecEventChannelAdmin::EventChannel::SUBSCRIPTION_ERROR, se)
@@ -134,64 +134,64 @@ Demo_Consumer::disconnect_push_consumer (CORBA::Environment &)
ACE_DEBUG ((LM_DEBUG, "Consumer received disconnect from channel.\n"));
}
-void
+void
Demo_Consumer::push (const RtecEventComm::EventSet &events,
CORBA::Environment &)
{
-
+
if (events.length () == 0)
{
ACE_DEBUG ((LM_DEBUG, "no events\n"));
return;
}
-
+
cout << "Number of events: " << received++ << endl;
for (CORBA::ULong i = 0; i < events.length (); ++i)
{
if (events[i].type_ == ACE_ES_EVENT_SHUTDOWN)
- {
- ACE_DEBUG ((LM_DEBUG, "Demo Consumer: received shutdown event\n"));
- this->shutdown ();
- }
+ {
+ ACE_DEBUG ((LM_DEBUG, "Demo Consumer: received shutdown event\n"));
+ this->shutdown ();
+ }
else
- {
- ACE_DEBUG ((LM_DEBUG, "Demo Consumer: received ACE_ES_EVENT_NOTIFICATION event.\n"));
-
- TAO_TRY
- {
- cout << "ID: " << events[i].data_.any_value.type()->id(TAO_TRY_ENV) << endl;
- TAO_CHECK_ENV;
- cout << "Name: " << events[i].data_.any_value.type()->name(TAO_TRY_ENV) << endl;
- TAO_CHECK_ENV;
- cout << "member_count: " << events[i].data_.any_value.type()->member_count(TAO_TRY_ENV) << endl;
- TAO_CHECK_ENV;
- cout << "TCKind: " << events[i].data_.any_value.type()->kind(TAO_TRY_ENV) << endl;
- TAO_CHECK_ENV;
-
- if (_tc_Navigation->equal (events[i].data_.any_value.type(), TAO_TRY_ENV))
- {
- TAO_CHECK_ENV;
- Navigation *navigation_ = (Navigation*) events[i].data_.any_value.value ();
-
- cout << "Found a Navigation struct in the any: pos_lat = " << navigation_->position_latitude << endl;
- }
- else if (_tc_Weapons->equal (events[i].data_.any_value.type(), TAO_TRY_ENV))
- {
- TAO_CHECK_ENV;
- Weapons *weapons_ = (Weapons*) events[i].data_.any_value.value ();
-
- cout << "Found a Navigation struct in the any: pos_lat = " << weapons_->number_of_weapons << endl;
- }
-
-
- }
- TAO_CATCHANY
- {
- ACE_ERROR ((LM_ERROR, "(%t)Error in extracting the Navigation and Weapons data.\n"));
- }
- TAO_ENDTRY;
- }
+ {
+ ACE_DEBUG ((LM_DEBUG, "Demo Consumer: received ACE_ES_EVENT_NOTIFICATION event.\n"));
+
+ TAO_TRY
+ {
+ cout << "ID: " << events[i].data_.any_value.type()->id(TAO_TRY_ENV) << endl;
+ TAO_CHECK_ENV;
+ cout << "Name: " << events[i].data_.any_value.type()->name(TAO_TRY_ENV) << endl;
+ TAO_CHECK_ENV;
+ cout << "member_count: " << events[i].data_.any_value.type()->member_count(TAO_TRY_ENV) << endl;
+ TAO_CHECK_ENV;
+ cout << "TCKind: " << events[i].data_.any_value.type()->kind(TAO_TRY_ENV) << endl;
+ TAO_CHECK_ENV;
+
+ if (_tc_Navigation->equal (events[i].data_.any_value.type(), TAO_TRY_ENV))
+ {
+ TAO_CHECK_ENV;
+ Navigation *navigation_ = (Navigation*) events[i].data_.any_value.value ();
+
+ cout << "Found a Navigation struct in the any: pos_lat = " << navigation_->position_latitude << endl;
+ }
+ else if (_tc_Weapons->equal (events[i].data_.any_value.type(), TAO_TRY_ENV))
+ {
+ TAO_CHECK_ENV;
+ Weapons *weapons_ = (Weapons*) events[i].data_.any_value.value ();
+
+ cout << "Found a Navigation struct in the any: pos_lat = " << weapons_->number_of_weapons << endl;
+ }
+
+
+ }
+ TAO_CATCHANY
+ {
+ ACE_ERROR ((LM_ERROR, "(%t)Error in extracting the Navigation and Weapons data.\n"));
+ }
+ TAO_ENDTRY;
+ }
}
}
@@ -241,25 +241,25 @@ get_options (int argc, char *argv [])
switch (opt) {
case '?':
ACE_DEBUG ((LM_DEBUG,
- "Usage: %s %s\n",
- argv[0], usage));
+ "Usage: %s %s\n",
+ argv[0], usage));
ACE_OS::exit (0);
break;
default:
ACE_ERROR_RETURN ((LM_ERROR,
- "%s: unknown arg, -%c\n"
- "Usage: %s %s\n",
- argv[0], char(opt),
- argv[0], usage), 1);
+ "%s: unknown arg, -%c\n"
+ "Usage: %s %s\n",
+ argv[0], char(opt),
+ argv[0], usage), 1);
}
}
if (argc != get_opt.optind)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "%s: too many arguments\n"
- "Usage: %s %s\n",
- argv[0], argv[0], usage), 1);
+ "%s: too many arguments\n"
+ "Usage: %s %s\n",
+ argv[0], argv[0], usage), 1);
}
return 0;
@@ -281,34 +281,34 @@ main (int argc, char *argv [])
CORBA::Object_var poa_object = orb->resolve_initial_references("RootPOA");
if (CORBA::is_nil (poa_object.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to initialize the POA.\n"),
- 1);
- }
-
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+ }
+
PortableServer::POA_var root_poa = PortableServer::POA::_narrow (poa_object.in (), TAO_TRY_ENV);
TAO_CHECK_ENV;
-
+
PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (TAO_TRY_ENV);
TAO_CHECK_ENV;
CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService");
if (CORBA::is_nil (naming_obj.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to initialize the POA.\n"),
- 1);
- }
-
- CosNaming::NamingContext_var naming_context =
- CosNaming::NamingContext::_narrow (naming_obj.in (), TAO_TRY_ENV);
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in (), TAO_TRY_ENV);
TAO_CHECK_ENV;
ACE_Scheduler_Factory::use_config (naming_context.in ());
-
+
if (get_options (argc, argv))
- ACE_OS::exit (-1);
+ ACE_OS::exit (-1);
// Get the Event Channel
@@ -321,11 +321,11 @@ main (int argc, char *argv [])
RtecEventChannelAdmin::EventChannel_var ec =
- RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in(), TAO_TRY_ENV);
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in(), TAO_TRY_ENV);
TAO_CHECK_ENV;
if (ec.ptr() == 0)
- ACE_ERROR_RETURN ((LM_ERROR,"Not able to get the Event Service reference.\n"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR,"Not able to get the Event Service reference.\n"), -1);
// Create consumer.
@@ -333,7 +333,7 @@ main (int argc, char *argv [])
ACE_NEW_RETURN (demo_consumer, Demo_Consumer (), -1);
if (demo_consumer->open_consumer (ec.ptr (), "demo_consumer") == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "Someone was feeling introverted.\n"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "Someone was feeling introverted.\n"), -1);
poa_manager->activate (TAO_TRY_ENV);
TAO_CHECK_ENV;
@@ -341,16 +341,16 @@ main (int argc, char *argv [])
// Run the ORB
if (orb->run () == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1);
TAO_CHECK_ENV;
delete demo_consumer;
root_poa->destroy (CORBA::B_TRUE,
- CORBA::B_TRUE,
- TAO_TRY_ENV);
-
+ CORBA::B_TRUE,
+ TAO_TRY_ENV);
+
TAO_CHECK_ENV;
diff --git a/TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp b/TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp
index a928c6dcd83..2b99cbe0b25 100644
--- a/TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp
+++ b/TAO/examples/Simulator/Event_Supplier/Event_Sup.cpp
@@ -2,7 +2,7 @@
//
// ============================================================================
//
-//
+//
// = FILENAME
// Event_Sup.cpp
//
@@ -57,15 +57,15 @@ Demo_Supplier::Internal_Demo_Consumer::Internal_Demo_Consumer (Demo_Supplier *im
}
-void
+void
Demo_Supplier::Internal_Demo_Consumer::push (const RtecEventComm::EventSet &events,
- CORBA::Environment &env)
-{
- this->impl_->push (events, env);
+ CORBA::Environment &env)
+{
+ this->impl_->push (events, env);
ACE_DEBUG ((LM_DEBUG, "Internal Demo Consumer received push.\n"));
}
-void
+void
Demo_Supplier::Internal_Demo_Consumer::disconnect_push_consumer (CORBA::Environment &) { }
@@ -76,7 +76,7 @@ Demo_Supplier::Internal_Demo_Supplier::Internal_Demo_Supplier (Demo_Supplier *im
{
}
-void
+void
Demo_Supplier::Internal_Demo_Supplier::disconnect_push_supplier (CORBA::Environment &) { }
@@ -99,7 +99,7 @@ Demo_Supplier::~Demo_Supplier (void)
int
Demo_Supplier::open_supplier (RtecEventChannelAdmin::EventChannel_ptr ec,
- const char *name)
+ const char *name)
{
TAO_TRY
@@ -114,18 +114,18 @@ Demo_Supplier::open_supplier (RtecEventChannelAdmin::EventChannel_ptr ec,
// Generate the Real-time information
this->rt_info_ = scheduler_->create (name, TAO_TRY_ENV);
-
- scheduler_->set (rt_info_,
- ORBSVCS_Time::zero,
- ORBSVCS_Time::zero,
- ORBSVCS_Time::zero,
- 2500000,
- RtecScheduler::VERY_LOW,
- ORBSVCS_Time::zero,
- 1,
- TAO_TRY_ENV);
+
+ scheduler_->set (rt_info_,
+ ORBSVCS_Time::zero,
+ ORBSVCS_Time::zero,
+ ORBSVCS_Time::zero,
+ 2500000,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ ORBSVCS_Time::zero,
+ 1,
+ TAO_TRY_ENV);
TAO_CHECK_ENV;
-
+
// Set the publications to report them to the event channel
CORBA::Short x = 0;
@@ -139,7 +139,7 @@ Demo_Supplier::open_supplier (RtecEventChannelAdmin::EventChannel_ptr ec,
qos_.publications_[0].event_.ec_send_time_ = ORBSVCS_Time::zero;
qos_.publications_[0].event_.data_.x = 0;
qos_.publications_[0].event_.data_.y = 0;
- qos_.publications_[0].event_.data_.any_value.replace (CORBA::_tc_short, &x, 0, TAO_TRY_ENV);
+ qos_.publications_[0].event_.data_.any_value.replace (CORBA::_tc_short, &x, 0, TAO_TRY_ENV);
qos_.publications_[0].dependency_info_.number_of_calls = 1;
qos_.publications_[0].dependency_info_.rt_info = rt_info_;
qos_.publications_[1].event_.source_ = SOURCE_ID;
@@ -157,21 +157,21 @@ Demo_Supplier::open_supplier (RtecEventChannelAdmin::EventChannel_ptr ec,
// = Connect as a supplier.
this->supplier_admin_ =
- channel_admin_->for_suppliers (TAO_TRY_ENV);
+ channel_admin_->for_suppliers (TAO_TRY_ENV);
TAO_CHECK_ENV;
this->proxy_consumer_ = supplier_admin_->obtain_push_consumer (TAO_TRY_ENV);
TAO_CHECK_ENV;
- // In calling _this we get back an object reference and register the servant with
+ // In calling _this we get back an object reference and register the servant with
// the POA
RtecEventComm::PushSupplier_var objref = this->internal_demo_supplier_->_this (TAO_TRY_ENV);
TAO_CHECK_ENV;
// Connect the supplier to the proxy consumer
this->proxy_consumer_->connect_push_supplier (objref.in (),
- qos_,
- TAO_TRY_ENV);
+ qos_,
+ TAO_TRY_ENV);
TAO_CHECK_ENV;
}
@@ -204,7 +204,7 @@ Demo_Supplier::start_generating_events (void)
// load the scheduling data for the simulation
ACE_Unbounded_Queue<Schedule_Viewer_Data *> schedule_data;
this->load_schedule_data (schedule_data);
- ACE_Unbounded_Queue_Iterator<Schedule_Viewer_Data *>
+ ACE_Unbounded_Queue_Iterator<Schedule_Viewer_Data *>
schedule_iter (schedule_data);
if (schedule_iter.done ())
@@ -218,33 +218,33 @@ Demo_Supplier::start_generating_events (void)
TAO_TRY
{
do {
- RtecEventComm::Event event;
- event.source_ = SOURCE_ID;
- event.type_ = ACE_ES_EVENT_NOTIFICATION;
- event.ttl_ = 1;
- event.creation_time_ = ORBSVCS_Time::zero;
- event.ec_recv_time_ = ORBSVCS_Time::zero;
- event.ec_send_time_ = ORBSVCS_Time::zero;
- event.data_.x = 0;
- event.data_.y = 0;
-
- this->insert_event_data (event.data_.any_value, schedule_iter);
-
- RtecEventComm::EventSet events;
- events.length (1);
- events[0] = event;
-
- proxy_consumer_->push (events, TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- if (total_sent_ < 5)
- ACE_DEBUG ((LM_DEBUG, "Pushing event data.\n"));
- else if (total_sent_ == 5)
- ACE_DEBUG ((LM_DEBUG, "Everything is running. Going to be mute.\n"));
+ RtecEventComm::Event event;
+ event.source_ = SOURCE_ID;
+ event.type_ = ACE_ES_EVENT_NOTIFICATION;
+ event.ttl_ = 1;
+ event.creation_time_ = ORBSVCS_Time::zero;
+ event.ec_recv_time_ = ORBSVCS_Time::zero;
+ event.ec_send_time_ = ORBSVCS_Time::zero;
+ event.data_.x = 0;
+ event.data_.y = 0;
+
+ this->insert_event_data (event.data_.any_value, schedule_iter);
+
+ RtecEventComm::EventSet events;
+ events.length (1);
+ events[0] = event;
+
+ proxy_consumer_->push (events, TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ if (total_sent_ < 5)
+ ACE_DEBUG ((LM_DEBUG, "Pushing event data.\n"));
+ else if (total_sent_ == 5)
+ ACE_DEBUG ((LM_DEBUG, "Everything is running. Going to be mute.\n"));
} while (++total_sent_ < total_messages);
-
+
// Sending a shutdown event -- not wanted right now
/* RtecEventComm::Event event;
event.source_ = SOURCE_ID;
@@ -282,7 +282,7 @@ Demo_Supplier::start_generating_events (void)
}
}
- this->shutdown ();
+ this->shutdown ();
}
@@ -308,7 +308,7 @@ Demo_Supplier::load_schedule_data (
char *temp = input_buf;
while ((*temp) && (isspace (*temp)))
{
- ++temp;
+ ++temp;
}
// if there is anything besides whitespace in the line read,
@@ -322,12 +322,12 @@ Demo_Supplier::load_schedule_data (
"Demo_Supplier::start_generating_events: "
"memory allocation for scheduling data failed\n"));
return;
- }
-
+ }
+
scan_count = sscanf (temp, "%s %lf %lf %lu %lu %lu %lu",
- &(data->operation_name), &(data->utilitzation),
+ &(data->operation_name), &(data->utilitzation),
&(data->overhead), &(data->arrival_time),
- &(data->deadline_time), &(data->completion_time),
+ &(data->deadline_time), &(data->completion_time),
&(data->computation_time));
if (scan_count != 7)
{
@@ -338,7 +338,7 @@ Demo_Supplier::load_schedule_data (
delete data;
return;
}
-
+
// insert the data into the queue
schedule_data.enqueue_tail (data);
}
@@ -348,7 +348,7 @@ Demo_Supplier::load_schedule_data (
{
ACE_ERROR ((LM_ERROR,
"Demo_Supplier::start_generating_events: "
- "could not open input file [%s].\n",
+ "could not open input file [%s].\n",
input_file_name));
return;
}
@@ -367,7 +367,7 @@ Demo_Supplier::load_schedule_data (
"Demo_Supplier::start_generating_events: "
"memory allocation for scheduling data failed\n"));
return;
- }
+ }
char *oper_name = 0;
@@ -400,9 +400,9 @@ Demo_Supplier::load_schedule_data (
data->computation_time = (ACE_OS::rand() % 100)+10;
data->completion_time = last_completion + (ACE_OS::rand() % 100) + 100;
- data->completion_time =
+ data->completion_time =
data->completion_time < data->arrival_time + data->computation_time
- ? data->arrival_time + data->computation_time
+ ? data->arrival_time + data->computation_time
: data->completion_time;
last_completion = data->completion_time;
@@ -411,11 +411,11 @@ Demo_Supplier::load_schedule_data (
// insert the data into the queue
schedule_data.enqueue_tail (data);
- }
+ }
}
}
-// This function fills in the random data into the anys transported by
+// This function fills in the random data into the anys transported by
// the event channel
void
Demo_Supplier::insert_event_data (
@@ -468,9 +468,9 @@ Demo_Supplier::insert_event_data (
weapons_.weapon3.status = 0;
weapons_.weapon4.identifier = CORBA::string_alloc (1);
weapons_.weapon4.identifier[0] = 0;
- weapons_.weapon4.status = 0;
+ weapons_.weapon4.status = 0;
weapons_.weapon5.identifier = CORBA::string_alloc (1);
- weapons_.weapon5.identifier[0] = 0;
+ weapons_.weapon5.identifier[0] = 0;
weapons_.weapon5.status = 0;
weapons_.utilitzation = (*sched_data)->utilitzation;
@@ -495,23 +495,23 @@ Demo_Supplier::insert_event_data (
if ((*sched_data)->completion_time >= last_completion)
{
- ACE_Time_Value pause (0, (*sched_data)->completion_time -
+ ACE_Time_Value pause (0, (*sched_data)->completion_time -
last_completion);
ACE_OS::sleep (pause);
last_completion = (*sched_data)->completion_time;
}
}
- else
+ else
{
ACE_ERROR ((LM_ERROR, "Demo_Supplier::insert_event_data: Could Not access scheduling data"));
}
-
+
schedule_iter.advance ();
if (schedule_iter.done ())
{
schedule_iter.first ();
}
- }
+ }
TAO_CATCHANY
{
ACE_ERROR ((LM_ERROR, "(%t)Error in Demo_Supplier::insert_event_data.\n"));
@@ -519,10 +519,10 @@ Demo_Supplier::insert_event_data (
TAO_ENDTRY;
}
-void
+void
Demo_Supplier::push (const RtecEventComm::EventSet &events,
- CORBA::Environment &env)
-{
+ CORBA::Environment &env)
+{
}
@@ -535,10 +535,10 @@ Demo_Supplier::shutdown (void)
// @@ Had problems with the next command, the application got stuck in it
// channel_admin_->destroy (TAO_TRY_ENV);
// TAO_CHECK_ENV;
-
+
TAO_ORB_Core_instance ()->orb ()->shutdown ();
TAO_CHECK_ENV;
-
+
}
TAO_CATCHANY
{
@@ -568,8 +568,8 @@ get_options (int argc, char *argv [])
switch (opt) {
case '?':
ACE_DEBUG ((LM_DEBUG,
- "Usage: %s %s\n",
- argv[0], usage));
+ "Usage: %s %s\n",
+ argv[0], usage));
ACE_OS::exit (0);
break;
case 'm':
@@ -581,8 +581,8 @@ get_options (int argc, char *argv [])
else
{
ACE_ERROR_RETURN ((LM_ERROR,
- "%s: count must be > 0",
- argv[0]), 1);
+ "%s: count must be > 0",
+ argv[0]), 1);
}
break;
case 'f':
@@ -595,25 +595,25 @@ get_options (int argc, char *argv [])
{
input_file_name = 0;
ACE_ERROR_RETURN ((LM_ERROR,
- "%s: file name must be specified with -f option",
- argv[0]), 1);
+ "%s: file name must be specified with -f option",
+ argv[0]), 1);
}
break;
default:
ACE_ERROR_RETURN ((LM_ERROR,
- "%s: unknown arg, -%c\n"
- "Usage: %s %s\n",
- argv[0], char(opt),
- argv[0], usage), 1);
+ "%s: unknown arg, -%c\n"
+ "Usage: %s %s\n",
+ argv[0], char(opt),
+ argv[0], usage), 1);
}
}
if (argc != get_opt.optind)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "%s: too many arguments\n"
- "Usage: %s %s\n",
- argv[0], argv[0], usage), 1);
+ "%s: too many arguments\n"
+ "Usage: %s %s\n",
+ argv[0], argv[0], usage), 1);
}
return 0;
@@ -637,37 +637,37 @@ main (int argc, char *argv [])
// Connect to the RootPOA
CORBA::Object_var poa_object = orb->resolve_initial_references("RootPOA");
if (CORBA::is_nil (poa_object.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to initialize the POA.\n"),
- 1);
- }
-
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+ }
+
PortableServer::POA_var root_poa = PortableServer::POA::_narrow (poa_object.in (), TAO_TRY_ENV);
TAO_CHECK_ENV;
-
+
PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (TAO_TRY_ENV);
TAO_CHECK_ENV;
// Get the Naming Service object reference
CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService");
if (CORBA::is_nil (naming_obj.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable get the Naming Service.\n"),
- 1);
- }
-
- CosNaming::NamingContext_var naming_context =
- CosNaming::NamingContext::_narrow (naming_obj.in (), TAO_TRY_ENV);
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable get the Naming Service.\n"),
+ 1);
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in (), TAO_TRY_ENV);
TAO_CHECK_ENV;
// Tell the ScheduleService to use the same naming service
ACE_Scheduler_Factory::use_config (naming_context.in ());
-
+
if (get_options (argc, argv))
- ACE_OS::exit (-1);
+ ACE_OS::exit (-1);
// Get the Event Channel
// @@ If you specify an invalid name, the Name Service crashes
@@ -675,12 +675,12 @@ main (int argc, char *argv [])
CosNaming::Name channel_name (1);
channel_name.length (1);
channel_name[0].id = CORBA::string_dup ("EventService");
-
+
CORBA::Object_var ec_obj = naming_context->resolve (channel_name, TAO_TRY_ENV);
TAO_CHECK_ENV;
RtecEventChannelAdmin::EventChannel_var ec =
- RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in(), TAO_TRY_ENV);
+ RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in(), TAO_TRY_ENV);
TAO_CHECK_ENV;
// Create the demo supplier
@@ -688,22 +688,22 @@ main (int argc, char *argv [])
ACE_NEW_RETURN (demo_supplier, Demo_Supplier (SOURCE_ID), -1);
if (demo_supplier->open_supplier (ec.ptr (), "demo_supplier") == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "Supplier open failed.\n"), -1);
-
+ ACE_ERROR_RETURN ((LM_ERROR, "Supplier open failed.\n"), -1);
+
// Register the internal demo consumer for timeout events
demo_supplier->start_generating_events ();
-
+
ACE_DEBUG ((LM_DEBUG, "Supplier is registered for timeout events.\n"));
// The POA Manager has to be activated before starting the ORB event loop
poa_manager->activate (TAO_TRY_ENV);
TAO_CHECK_ENV;
-
+
// Run the ORB
if (orb->run () == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "CORBA::ORB::run"), -1);
TAO_CHECK_ENV;