summaryrefslogtreecommitdiff
path: root/TAO/examples/RTScheduling
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/RTScheduling')
-rw-r--r--TAO/examples/RTScheduling/DT_Creator.cpp24
-rw-r--r--TAO/examples/RTScheduling/DT_Creator.h2
-rw-r--r--TAO/examples/RTScheduling/Fixed_Priority_Scheduler/FP_Scheduler.cpp2
-rw-r--r--TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp6
-rw-r--r--TAO/examples/RTScheduling/Job_i.cpp8
-rw-r--r--TAO/examples/RTScheduling/Job_i.h6
-rw-r--r--TAO/examples/RTScheduling/MIF_Scheduler/MIF_Task.cpp2
-rw-r--r--TAO/examples/RTScheduling/MIF_Scheduler/test.cpp6
-rw-r--r--TAO/examples/RTScheduling/POA_Holder.cpp4
-rw-r--r--TAO/examples/RTScheduling/POA_Holder.h7
-rw-r--r--TAO/examples/RTScheduling/Starter.cpp8
-rw-r--r--TAO/examples/RTScheduling/Task_Stats.cpp4
-rw-r--r--TAO/examples/RTScheduling/Task_Stats.h4
-rw-r--r--TAO/examples/RTScheduling/Thread_Task.cpp6
14 files changed, 50 insertions, 39 deletions
diff --git a/TAO/examples/RTScheduling/DT_Creator.cpp b/TAO/examples/RTScheduling/DT_Creator.cpp
index 4a7db7dd4ab..6a27728be15 100644
--- a/TAO/examples/RTScheduling/DT_Creator.cpp
+++ b/TAO/examples/RTScheduling/DT_Creator.cpp
@@ -8,10 +8,12 @@
#include "DT_Creator.h"
#include "tao/RTScheduling/Current.h"
+#include "ace/Arg_Shifter.h"
+
ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> guid_counter;
int
-DT_Creator::dt_task_init (ACE_Arg_Shifter& arg_shifter)
+DT_Creator::dt_task_init (ACE_TArg_Shifter<char>& arg_shifter)
{
static int dt_index = 0;
int start_time = 0;
@@ -20,7 +22,7 @@ DT_Creator::dt_task_init (ACE_Arg_Shifter& arg_shifter)
int importance = 0;
char *job_name = 0;
int dist = 0;
- const ACE_TCHAR* current_arg = 0;
+ const char* current_arg = 0;
if (arg_shifter.cur_arg_strncasecmp ("-Importance") == 0)
{
arg_shifter.consume_arg ();
@@ -70,9 +72,9 @@ DT_Creator::init (int argc, char *argv [])
active_job_count_ = 0;
ACE_NEW_RETURN (log, char*[BUFSIZ * 100],-1);
- ACE_Arg_Shifter arg_shifter (argc, argv);
+ ACE_TArg_Shifter<char> arg_shifter (argc, argv);
- const ACE_TCHAR* current_arg = 0;
+ const char* current_arg = 0;
dt_count_ = 0;
poa_count_ = 0;
@@ -136,7 +138,7 @@ DT_Creator::init (int argc, char *argv [])
delete this->job_list_[job_count];
return -1;
}
- else
+ else
job_count++;
}
else if ((current_arg = arg_shifter.get_the_parameter ("-OutFile")))
@@ -216,10 +218,10 @@ DT_Creator::register_synch_obj (ACE_ENV_SINGLE_ARG_DECL)
ACE_DEBUG ((LM_DEBUG,
"Synch Name %s\n",
synch_name.c_str ()));
-
+
ACE_NEW (synch_,
Synch_i);
-
+
Synch_var synch = synch_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
@@ -274,7 +276,7 @@ DT_Creator::activate_poa_list (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
-
+
for (int i = 0; i < poa_count_; ++i)
{
poa_list_[i]->activate (this->rt_orb_.in(), this->root_poa_.in ()
@@ -454,13 +456,13 @@ DT_Creator::create_distributable_threads (RTScheduling::Current_ptr current
ACE_DEBUG ((LM_DEBUG,
"Waiting to Synch\n"));
-
+
while (!this->synch ()->synched ())
{
this->orb_->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
}
-
+
CORBA::Policy_var sched_param;
sched_param = CORBA::Policy::_duplicate (this->sched_param (100));
const char * name = 0;
@@ -587,7 +589,7 @@ DT_Creator::check_ifexit (void)
shutdown = 1;
- FILE* log_file = ACE_OS::fopen (log_file_name_, "w");
+ FILE* log_file = ACE_OS::fopen (log_file_name_, ACE_TEXT("w"));
if (log_file != NULL)
{
diff --git a/TAO/examples/RTScheduling/DT_Creator.h b/TAO/examples/RTScheduling/DT_Creator.h
index b461ab298b2..da03d5b5f3f 100644
--- a/TAO/examples/RTScheduling/DT_Creator.h
+++ b/TAO/examples/RTScheduling/DT_Creator.h
@@ -28,7 +28,7 @@ class DT_Creator : public ACE_Service_Object
int init (int argc, char *argv []);
- int dt_task_init (ACE_Arg_Shifter& arg_shifter);
+ int dt_task_init (ACE_TArg_Shifter<char>& arg_shifter);
virtual void create_distributable_threads (RTScheduling::Current_ptr current
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
diff --git a/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/FP_Scheduler.cpp b/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/FP_Scheduler.cpp
index 5019ee6ae5d..9b874cefd04 100644
--- a/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/FP_Scheduler.cpp
+++ b/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/FP_Scheduler.cpp
@@ -213,7 +213,7 @@ Fixed_Priority_Scheduler::receive_request (PortableInterceptor::ServerRequestInf
char msg [BUFSIZ];
ACE_OS::sprintf (msg,
"The Guid is "
- ACE_SIZE_T_FORMAT_SPECIFIER
+ ACE_SIZE_T_FORMAT_SPECIFIER_A
"\n", gu_id);
DT_TEST::instance ()->dt_creator ()->log_msg (msg);
diff --git a/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp b/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp
index 2d328877266..e88c41a27eb 100644
--- a/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp
+++ b/TAO/examples/RTScheduling/Fixed_Priority_Scheduler/test.cpp
@@ -8,6 +8,7 @@
#include "../Task_Stats.h"
#include "../Synch_i.h"
#include "ace/OS_NS_errno.h"
+#include "ace/Argv_Type_Converter.h"
DT_Test::DT_Test (void)
{
@@ -259,13 +260,14 @@ DT_Test::orb (void)
}
int
-main (int argc, char* argv [])
+ACE_TMAIN (int argc, ACE_TCHAR* argv [])
{
+ ACE_Argv_Type_Converter convert (argc, argv);
ACE_TRY_NEW_ENV
{
ACE_Service_Config::static_svcs ()->insert (&ace_svc_desc_FP_DT_Creator);
- DT_TEST::instance ()->run (argc, argv
+ DT_TEST::instance ()->run (convert.get_argc(), convert.get_ASCII_argv()
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
diff --git a/TAO/examples/RTScheduling/Job_i.cpp b/TAO/examples/RTScheduling/Job_i.cpp
index 6179d1dac37..b8aee4ede56 100644
--- a/TAO/examples/RTScheduling/Job_i.cpp
+++ b/TAO/examples/RTScheduling/Job_i.cpp
@@ -37,7 +37,7 @@ Job_i::poa (void)
}
int
-Job_i::init (ACE_Arg_Shifter& arg_shifter)
+Job_i::init (ACE_TArg_Shifter<char>& arg_shifter)
{
job_name_ = arg_shifter.get_current (); // Read the name of the Job
arg_shifter.consume_arg ();
@@ -75,7 +75,7 @@ Job_i::work (CORBA::ULong work,
char msg [BUFSIZ];
ACE_OS::sprintf (msg,
"Guid is "
- ACE_SIZE_T_FORMAT_SPECIFIER
+ ACE_SIZE_T_FORMAT_SPECIFIER_A
"\n", guid_);
dt_creator_->log_msg (msg);
@@ -137,7 +137,7 @@ Job_i::dump_stats (void)
char fname [BUFSIZ];
ACE_OS::sprintf (fname,
"Job_"
- ACE_SIZE_T_FORMAT_SPECIFIER
+ ACE_SIZE_T_FORMAT_SPECIFIER_A
".dat",
guid_);
@@ -150,7 +150,7 @@ Job_i::dump_stats (void)
char msg [BUFSIZ];
ACE_OS::sprintf (msg,
"#Schedule Output for DT "
- ACE_SIZE_T_FORMAT_SPECIFIER,
+ ACE_SIZE_T_FORMAT_SPECIFIER_A,
guid_);
task_stats_->dump_samples (fname,
diff --git a/TAO/examples/RTScheduling/Job_i.h b/TAO/examples/RTScheduling/Job_i.h
index 3aaf9bf3e1b..6b290a7e7a6 100644
--- a/TAO/examples/RTScheduling/Job_i.h
+++ b/TAO/examples/RTScheduling/Job_i.h
@@ -17,8 +17,10 @@
#include "Task_Stats.h"
#include "ace/SString.h"
+#include "ace/Arg_Shifter.h"
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-class ACE_Arg_Shifter;
+//class ACE_TArg_Shifter<char>;
ACE_END_VERSIONED_NAMESPACE_DECL
class DT_Creator;
@@ -38,7 +40,7 @@ class Job_i : public POA_Job
~Job_i (void);
/// Init the state of this object.
- int init (ACE_Arg_Shifter& arg_shifter);
+ int init (ACE_TArg_Shifter<char>& arg_shifter);
/// = Accessors
const ACE_CString& name (void);
diff --git a/TAO/examples/RTScheduling/MIF_Scheduler/MIF_Task.cpp b/TAO/examples/RTScheduling/MIF_Scheduler/MIF_Task.cpp
index bfb170e19b2..7aca93a7626 100644
--- a/TAO/examples/RTScheduling/MIF_Scheduler/MIF_Task.cpp
+++ b/TAO/examples/RTScheduling/MIF_Scheduler/MIF_Task.cpp
@@ -92,7 +92,7 @@ MIF_Task::perform_task (void)
char msg [BUFSIZ];
ACE_OS::sprintf (msg,
"MIF_Task::perform_task "
- ACE_SIZE_T_FORMAT_SPECIFIER
+ ACE_SIZE_T_FORMAT_SPECIFIER_A
"\n",
count_);
dt_creator_->log_msg (msg);
diff --git a/TAO/examples/RTScheduling/MIF_Scheduler/test.cpp b/TAO/examples/RTScheduling/MIF_Scheduler/test.cpp
index 8ef6d268b8d..ebf9c28cd9d 100644
--- a/TAO/examples/RTScheduling/MIF_Scheduler/test.cpp
+++ b/TAO/examples/RTScheduling/MIF_Scheduler/test.cpp
@@ -8,6 +8,7 @@
#include "../Thread_Task.h"
#include "../Task_Stats.h"
#include "../Synch_i.h"
+#include "ace/Argv_Type_Converter.h"
DT_Test::DT_Test (void)
{
@@ -155,15 +156,16 @@ DT_Test::current (void)
}
int
-main (int argc, char* argv [])
+ACE_TMAIN (int argc, ACE_TCHAR* argv [])
{
+ ACE_Argv_Type_Converter convert (argc, argv);
ACE_TRY_NEW_ENV
{
ACE_Service_Config::static_svcs ()->insert (&ace_svc_desc_MIF_DT_Creator);
ACE_DEBUG ((LM_DEBUG,
"%t\n"));
- DT_TEST::instance ()->run (argc, argv
+ DT_TEST::instance ()->run (convert.get_argc(), convert.get_ASCII_argv()
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
diff --git a/TAO/examples/RTScheduling/POA_Holder.cpp b/TAO/examples/RTScheduling/POA_Holder.cpp
index 3013a8769f7..61a51a7ff8c 100644
--- a/TAO/examples/RTScheduling/POA_Holder.cpp
+++ b/TAO/examples/RTScheduling/POA_Holder.cpp
@@ -12,12 +12,12 @@ POA_Holder::POA_Holder (void)
}
int
-POA_Holder::init (ACE_Arg_Shifter& arg_shifter)
+POA_Holder::init (ACE_TArg_Shifter<char>& arg_shifter)
{
ACE_DEBUG ((LM_DEBUG,
"Init POA\n"));
- const ACE_TCHAR *current_arg = 0;
+ const char *current_arg = 0;
POA_name_ = arg_shifter.get_current (); // Read the name of the POA
arg_shifter.consume_arg ();
diff --git a/TAO/examples/RTScheduling/POA_Holder.h b/TAO/examples/RTScheduling/POA_Holder.h
index 28adbd31a18..b155203b515 100644
--- a/TAO/examples/RTScheduling/POA_Holder.h
+++ b/TAO/examples/RTScheduling/POA_Holder.h
@@ -17,11 +17,12 @@
#include "tao/RTCORBA/RTCORBA.h"
#include "tao/PortableServer/PortableServer.h"
-//#include "activity_export.h"
#include "ace/SString.h"
+#include "ace/Arg_Shifter.h"
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-class ACE_Arg_Shifter;
+//class ACE_TArg_Shifter<char>;
ACE_END_VERSIONED_NAMESPACE_DECL
/**
@@ -38,7 +39,7 @@ public:
/// The arg_shifter options are read in the following manner:
///-POA <name> -PriorityModel <CLIENT|SERVER> <priority> -Lanes <count> (-Lane <priority> ,<static_threads> <dynamic_threads>)* -Bands <count> (-Band <low> <high>)*
- int init (ACE_Arg_Shifter& arg_shifter);
+ int init (ACE_TArg_Shifter<char>& arg_shifter);
/// Activate the new POA using the parameters initialized before.
void activate (RTCORBA::RTORB_ptr rt_orb, PortableServer::POA_ptr parent_poa
diff --git a/TAO/examples/RTScheduling/Starter.cpp b/TAO/examples/RTScheduling/Starter.cpp
index 3e0b46bca7d..8abff46a9f0 100644
--- a/TAO/examples/RTScheduling/Starter.cpp
+++ b/TAO/examples/RTScheduling/Starter.cpp
@@ -2,6 +2,7 @@
#include "Starter.h"
#include "ace/OS_NS_sys_time.h"
+#include "ace/Argv_Type_Converter.h"
Starter::Starter (CORBA::ORB_ptr orb)
@@ -132,12 +133,13 @@ Starter::add_to_synchs (CosNaming::BindingList &binding_list
int
-main (int argc, char** argv)
+ACE_TMAIN (int argc, ACE_TCHAR** argv)
{
+ ACE_Argv_Type_Converter convert (argc, argv);
ACE_TRY_NEW_ENV
{
- CORBA::ORB_var orb = CORBA::ORB_init (argc,
- argv,
+ CORBA::ORB_var orb = CORBA::ORB_init (convert.get_argc(),
+ convert.get_ASCII_argv(),
""
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
diff --git a/TAO/examples/RTScheduling/Task_Stats.cpp b/TAO/examples/RTScheduling/Task_Stats.cpp
index 77d364d710d..c3078316775 100644
--- a/TAO/examples/RTScheduling/Task_Stats.cpp
+++ b/TAO/examples/RTScheduling/Task_Stats.cpp
@@ -57,11 +57,11 @@ Task_Stats::end_time (ACE_hrtime_t time)
}
void
-Task_Stats::dump_samples (const ACE_TCHAR *file_name, const ACE_TCHAR *msg,
+Task_Stats::dump_samples (const char *file_name, const char *msg,
ACE_UINT32)
{
- FILE* output_file = ACE_OS::fopen (file_name, "w");
+ FILE* output_file = ACE_OS::fopen (file_name, ACE_TEXT("w"));
if (output_file == 0)
{
diff --git a/TAO/examples/RTScheduling/Task_Stats.h b/TAO/examples/RTScheduling/Task_Stats.h
index b32f1041bfc..e76f669562f 100644
--- a/TAO/examples/RTScheduling/Task_Stats.h
+++ b/TAO/examples/RTScheduling/Task_Stats.h
@@ -60,10 +60,10 @@ class Task_Stats
/// Record a sample
int sample (ACE_UINT32 thr_run_time, int thr_count);
- void dump_samples (const ACE_TCHAR *file_name, const ACE_TCHAR *msg,
+ void dump_samples (const char *file_name, const char *msg,
ACE_UINT32 scale_factor);
protected:
- void dump_latency_stats (ACE_TCHAR *out_msg, ACE_UINT32 sf);
+ void dump_latency_stats (char *out_msg, ACE_UINT32 sf);
/// Base and end times
ACE_hrtime_t base_time_;
diff --git a/TAO/examples/RTScheduling/Thread_Task.cpp b/TAO/examples/RTScheduling/Thread_Task.cpp
index e7c3997f565..217f34ed25e 100644
--- a/TAO/examples/RTScheduling/Thread_Task.cpp
+++ b/TAO/examples/RTScheduling/Thread_Task.cpp
@@ -45,7 +45,7 @@ Thread_Task::svc (void)
char msg [BUFSIZ];
ACE_OS::sprintf (msg,
"Thread_Task::svc Imp=%d Guid="
- ACE_SIZE_T_FORMAT_SPECIFIER
+ ACE_SIZE_T_FORMAT_SPECIFIER_A
"\n",
importance_,
count_);
@@ -112,7 +112,7 @@ Thread_Task::dump_stats (void)
char fname [BUFSIZ];
ACE_OS::sprintf (fname,
"DT_"
- ACE_SIZE_T_FORMAT_SPECIFIER
+ ACE_SIZE_T_FORMAT_SPECIFIER_A
".dat",count_);
if (TAO_debug_level > 0)
@@ -123,7 +123,7 @@ Thread_Task::dump_stats (void)
char msg [BUFSIZ];
ACE_OS::sprintf (msg,
"#Schedule Output for DT "
- ACE_SIZE_T_FORMAT_SPECIFIER,
+ ACE_SIZE_T_FORMAT_SPECIFIER_A,
count_);
task_stats_->dump_samples (fname,