1 #include "orbsvcs/Log_Macros.h"
2 #include "ace/Sched_Params.h"
3 #include "ace/Get_Opt.h"
4 #include "ace/Argv_Type_Converter.h"
5 #include "ace/OS_main.h"
7 #include "orbsvcs/CosNamingC.h"
8 #include "orbsvcs/Scheduler_Factory.h"
10 // This program dumps the results of one scheduling in a C++ file.
13 ACE_TMAIN (int argc
, ACE_TCHAR
* argv
[])
17 // Copy command line parameter.
18 ACE_Argv_Type_Converter
command_line(argc
, argv
);
22 CORBA::ORB_init (argc
, argv
, "internet");
24 CORBA::Object_var naming_obj
=
25 orb
->resolve_initial_references ("NameService");
27 if (CORBA::is_nil(naming_obj
.in ()))
28 ORBSVCS_ERROR_RETURN ((LM_ERROR
,
29 " (%P|%t) Unable to find the Naming Service\n"),
32 CosNaming::NamingContext_var naming_context
=
33 CosNaming::NamingContext::_narrow (naming_obj
.in ());
35 const char *name
= "ScheduleService";
36 if (command_line
.get_argc() > 1)
38 name
= command_line
.get_ASCII_argv()[1];
40 ACE_Scheduler_Factory::use_config (naming_context
.in (), name
);
42 RtecScheduler::RT_Info_Set_var infos
;
43 RtecScheduler::Dependency_Set_var deps
;
44 RtecScheduler::Config_Info_Set_var configs
;
45 RtecScheduler::Scheduling_Anomaly_Set_var anomalies
;
47 ACE_Scheduler_Factory::server ()->compute_scheduling
48 (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO
,
50 ACE_Sched_Params::priority_max (ACE_SCHED_FIFO
,
52 infos
.out (), deps
.out (), configs
.out (), anomalies
.out ());
54 ACE_Scheduler_Factory::dump_schedule (infos
.in (),
58 ACE_TEXT("Scheduler_Runtime.cpp"));
60 catch (const CORBA::Exception
& ex
)
62 ex
._tao_print_exception ("Dump_Schedule");