diff options
Diffstat (limited to 'TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp')
-rw-r--r-- | TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp | 59 |
1 files changed, 39 insertions, 20 deletions
diff --git a/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp index 18be67cb507..9c6f3a46b3d 100644 --- a/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp +++ b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp @@ -1,6 +1,4 @@ -// // $Id$ -// #include "ace/Sched_Params.h" #include "ace/Get_Opt.h" @@ -11,56 +9,77 @@ // This program dumps the results of one scheduling in a C++ file. - - -int main (int argc, char *argv[]) +int +main (int argc, char *argv[]) { TAO_TRY { // Initialize ORB. - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "internet", TAO_TRY_ENV); + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "internet", TAO_TRY_ENV); TAO_CHECK_ENV; - CORBA::Object_var poa_object = - orb->resolve_initial_references("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); + PortableServer::POA::_narrow (poa_object.in(), TAO_TRY_ENV); TAO_CHECK_ENV; PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (TAO_TRY_ENV); + root_poa->the_POAManager (TAO_TRY_ENV); TAO_CHECK_ENV; CORBA::Object_var naming_obj = - orb->resolve_initial_references ("NameService"); + 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); + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); - CosNaming::NamingContext_var naming_context = + 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 ()); RtecScheduler::RT_Info_Set_var infos; + +#if defined (__SUNPRO_CC) + // Sun C++ 4.2 warns with the code below: + // Warning (Anachronism): Temporary used for non-const + // reference, now obsolete. + // Note: Type "CC -migration" for more on anachronisms. + // Warning (Anachronism): The copy constructor for argument + // infos of type RtecScheduler::RT_Info_Set_out should take + // const RtecScheduler::RT_Info_Set_out&. + // But, this code is not CORBA conformant, because users should + // not define instances of _out types. + + RtecScheduler::RT_Info_Set_out infos_out (infos); + ACE_Scheduler_Factory::server ()->compute_scheduling + (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, + ACE_SCOPE_THREAD), + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO, + ACE_SCOPE_THREAD), + infos_out, TAO_TRY_ENV); +#else /* ! __SUNPRO_CC */ ACE_Scheduler_Factory::server ()->compute_scheduling (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, ACE_SCOPE_THREAD), ACE_Sched_Params::priority_max (ACE_SCHED_FIFO, ACE_SCOPE_THREAD), infos.out (), TAO_TRY_ENV); +#endif /* ! __SUNPRO_CC */ + TAO_CHECK_ENV; ACE_Scheduler_Factory::dump_schedule (infos.in (), - "Scheduler_Runtime.cpp"); + "Scheduler_Runtime.cpp"); } TAO_CATCH (CORBA::SystemException, sys_ex) { |